/* ===================================
   PATRIMONIAL - MODERN STYLES
   Professional Insurance Website
   =================================== */

/* === ROOT VARIABLES === */
:root {
  /* Colors - Modern Professional Palette */
  --primary: #1e40af;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #059669;
  --secondary-hover: #047857;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  
  /* Neutral Colors */
  --text: #1f2937;
  --text-light: #6b7280;
  --text-muted: #9ca3af;
  --background: #ffffff;
  --surface: #f9fafb;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  
  /* Dark Theme */
  --dark-bg: #0f172a;
  --dark-surface: #1e293b;
  --dark-border: #334155;
  --dark-text: #f1f5f9;
  --dark-text-light: #cbd5e1;
  
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Inter', var(--font-sans);
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  
  /* Container */
  --container-max: 1280px;
}
/* === DARK THEME === */
[data-theme="dark"] {
  --text: var(--dark-text);
  --text-light: var(--dark-text-light);
  --text-muted: #64748b;
  --background: var(--dark-bg);
  --surface: var(--dark-surface);
  --border: var(--dark-border);
  --border-light: #475569;
}

/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--background);
  transition: background-color var(--transition-base), color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: var(--space-md);
}

h1 { font-size: clamp(2.25rem, 4vw, 3.5rem); }
h2 { font-size: clamp(1.875rem, 3.5vw, 2.75rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p {
  margin-bottom: var(--space-md);
  color: var(--text-light);
}

.lead {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text-light);
  line-height: 1.7;
}

.big {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
}

/* === LINKS === */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

/* === LISTS === */
ul, ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

li {
  margin-bottom: var(--space-sm);
  color: var(--text-light);
}
/* === LAYOUT COMPONENTS === */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }
}

.section {
  padding: var(--space-3xl) 0;
}

@media (max-width: 768px) {
  .section {
    padding: var(--space-2xl) 0;
  }
}

/* === GRID SYSTEM === */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

@media (max-width: 768px) {
  .cols-2, .cols-3 {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left var(--transition-slow);
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
/* === CARDS === */
.card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-light);
}

.card-hover:hover::before {
  transform: scaleX(1);
}

/* === FORMS === */
.input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--text);
  transition: all var(--transition-fast);
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

label {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-sm);
  font-size: 0.875rem;
}

.form-hint {
  font-size: 0.875rem;
  color: var(--secondary);
  padding: var(--space-sm);
  background: rgba(5, 150, 105, 0.1);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--secondary);
}

/* === PILLS & BADGES === */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  border-radius: 9999px;
  margin-bottom: var(--space-sm);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 9999px;
  margin-bottom: var(--space-md);
}
/* === HEADER & NAVIGATION === */
header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all var(--transition-base);
}

[data-theme="dark"] header {
  background: rgba(15, 23, 42, 0.95);
  border-bottom-color: var(--dark-border);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--space-lg);
  min-height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  transition: transform var(--transition-fast);
}

.brand:hover {
  transform: scale(1.05);
  color: var(--text);
}

.dot {
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-links a {
  font-weight: 500;
  color: var(--text-light);
  padding: 0.5rem 0;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width var(--transition-base);
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a:hover::after {
  width: 100%;
}
.nav-cta {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover)) !important;
  color: white !important;
  padding: 0.625rem 1.25rem !important;
  border-radius: var(--radius-md) !important;
  font-weight: 600 !important;
  transition: all var(--transition-fast) !important;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white !important;
}

.nav-cta::after {
  display: none !important;
}

/* Theme Toggle */
.theme-toggle {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Mobile Menu */
.menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-btn::before,
.menu-btn::after {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: all var(--transition-base);
}

#mobile {
  display: none;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-top: 1px solid var(--border);
  background: var(--background);
}

#mobile a {
  padding: var(--space-sm) 0;
  font-weight: 500;
  color: var(--text-light);
  border-bottom: 1px solid var(--border-light);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .menu-btn {
    display: flex;
  }
  
  #mobile.active {
    display: flex;
  }
}
/* === HERO SECTION === */
.hero {
  background: linear-gradient(135deg, 
    rgba(30, 64, 175, 0.05) 0%, 
    rgba(5, 150, 105, 0.05) 50%, 
    rgba(124, 58, 237, 0.05) 100%);
  padding: var(--space-3xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(30, 64, 175, 0.1) 0%, transparent 70%);
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(180deg); }
}

.hero .container {
  position: relative;
  z-index: 2;
}

/* KPIs Section */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}

.kpi {
  text-align: center;
  padding: var(--space-lg);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .kpi {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

.kpi .big {
  display: block;
  margin-bottom: var(--space-sm);
}

/* === FOOTER === */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: var(--space-3xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-xl);
  padding: var(--space-2xl) var(--space-lg);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    padding: var(--space-xl) var(--space-md);
  }
}

footer h4 {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

footer li {
  margin-bottom: var(--space-sm);
}

footer a {
  color: var(--text-light);
  transition: color var(--transition-fast);
}

footer a:hover {
  color: var(--primary);
}
/* === SERVICES SECTION === */
.services article {
  position: relative;
  transition: all var(--transition-base);
}

.services article:hover {
  z-index: 10;
}

.services .pill {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === PROSE CONTENT === */
.prose {
  max-width: 65ch;
  margin: 0 auto;
}

.prose h1 {
  font-size: 2.5rem;
  margin-bottom: var(--space-lg);
}

.prose h3 {
  color: var(--primary);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
}

.prose ul {
  background: var(--surface);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
}

.prose li {
  color: var(--text);
  font-weight: 500;
}

/* === TESTIMONIALS === */
blockquote {
  font-size: 1.125rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.6;
  position: relative;
}

blockquote::before {
  content: '"';
  font-size: 3rem;
  color: var(--primary);
  position: absolute;
  top: -0.5rem;
  left: -0.75rem;
  font-family: serif;
}

figcaption {
  font-weight: 600;
  color: var(--text);
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.reveal {
  animation: fadeInUp 0.6s ease-out;
}

/* === UTILITIES === */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
/* === RESPONSIVE DESIGN === */
@media (max-width: 1024px) {
  .hero {
    padding: var(--space-2xl) 0;
  }
  
  .kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.25rem;
  }
  
  .hero .lead {
    font-size: 1rem;
  }
  
  .kpis {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .btn {
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
  }
  
  .services {
    grid-template-columns: 1fr;
  }
  
  .prose h1 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-sm);
  }
  
  .navbar {
    padding: 0.75rem var(--space-sm);
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .hero .container > div:last-child {
    flex-direction: column;
    gap: var(--space-sm);
  }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: var(--dark-text);
    --text-light: var(--dark-text-light);
    --text-muted: #64748b;
    --background: var(--dark-bg);
    --surface: var(--dark-surface);
    --border: var(--dark-border);
    --border-light: #475569;
  }
}

/* === FOCUS STYLES === */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* === PRINT STYLES === */
@media print {
  header, footer, .theme-toggle, .menu-btn {
    display: none;
  }
  
  .hero {
    background: none;
    padding: var(--space-lg) 0;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}