/* ==========================================================================
   💎 IKEBANA SEGUROS — ENTERPRISE DESIGN SYSTEM (V.ULTIMATE)
   Architecture: Token-Based | Mobile-First | High-Performance
   ========================================================================== */

/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
   1. DESIGN TOKENS (A MATEMÁTICA DO DESIGN)
   :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
:root {
  /* --- 1.1 Paleta de Cores Semântica --- */
  /* Brand - A identidade da marca */
  --brand-50:  #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-500: #3b82f6;
  --brand-600: #2563eb; /* Cor Principal (Primary) */
  --brand-700: #1d4ed8; /* Hover State */
  --brand-900: #1e3a8a; /* Deep Navy */

  /* Neutral - Texto e Fundos */
  --gray-50:   #f8fafc; /* Background Body */
  --gray-100:  #f1f5f9; /* Background Secundário */
  --gray-200:  #e2e8f0; /* Bordas */
  --gray-300:  #cbd5e1;
  --gray-500:  #64748b; /* Texto de Apoio (Muted) */
  --gray-700:  #334155; /* Texto Principal (Body) */
  --gray-900:  #0f172a; /* Títulos (Headings) */

  /* Feedback */
  --success:   #10b981; /* Verde WhatsApp */
  --warning:   #f59e0b;
  --danger:    #ef4444;

  /* --- 1.2 Tipografia (Modular Scale 1.25) --- */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  
  --text-xs:   0.75rem;  /* 12px */
  --text-sm:   0.875rem; /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg:   1.125rem; /* 18px */
  --text-xl:   1.25rem;  /* 20px */
  --text-2xl:  1.5rem;   /* 24px */
  --text-3xl:  1.875rem; /* 30px */
  --text-4xl:  2.25rem;  /* 36px */
  --text-5xl:  3rem;     /* 48px */

  --leading-tight: 1.1;
  --leading-snug:  1.3;
  --leading-normal: 1.6;

  /* --- 1.3 Espaçamento (8pt Grid System) --- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-6:  24px;
  --space-8:  32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;

  /* --- 1.4 Layout --- */
  --container-max: 1280px;
  --header-height: 80px;
  --radius-sm:     6px;
  --radius-md:     12px;
  --radius-lg:     24px;
  --radius-full:   9999px;

  /* --- 1.5 Sombras (Depth) --- */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --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);
  --shadow-brand: 0 10px 30px -10px rgba(37, 99, 235, 0.4); /* Glow Azul */

  /* --- 1.6 Animações --- */
  --transition-base: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
   2. RESET CSS AVANÇADO & BASE
   :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-width: 0;
  border-style: solid;
  border-color: var(--gray-200);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 2rem);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--gray-50);
  color: var(--gray-700);
  line-height: var(--leading-normal);
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Imagens responsivas e seguras */
img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Tipografia Hierárquica */
h1, h2, h3, h4, h5, h6 {
  color: var(--gray-900);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: -0.025em; /* Tracking negativo para títulos */
}

h1 { font-size: clamp(2rem, 5vw, var(--text-5xl)); margin-bottom: var(--space-6); }
h2 { font-size: clamp(1.75rem, 4vw, var(--text-4xl)); margin-bottom: var(--space-6); }
h3 { font-size: var(--text-xl); margin-bottom: var(--space-3); }

p {
  margin-bottom: var(--space-6);
  max-width: 65ch; /* Limite de leitura confortável (65 caracteres) */
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-base);
}

/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
   3. SISTEMA DE LAYOUT (GRID & WRAPPER)
   :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
.wrap {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
  position: relative;
  overflow: hidden; /* Evita vazamento lateral */
}

/* Grid Inteligente e Defensivo */
.grid {
  display: grid;
  /* Cria colunas automaticamente. Mínimo 300px. Se sobrar espaço, divide igualmente. */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-8);
  width: 100%;
}

/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
   4. COMPONENTE: HEADER & NAVEGAÇÃO
   :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
header {
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

/* Brand Area */
.brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.brand a {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--brand-600);
  letter-spacing: -0.04em;
  line-height: 1;
}
.brand .badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  margin-top: 4px;
}

/* Desktop Menu */
.nav-menu {
  display: flex;
  gap: var(--space-8);
  align-items: center;
}

.nav-menu > a, .dropbtn {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-700);
  padding: var(--space-2) 0;
  position: relative;
  background: transparent;
  cursor: pointer;
}

/* Hover Effect (Underline Animado) */
.nav-menu > a::after, .dropbtn::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--brand-600);
  transition: width 0.3s ease;
}
.nav-menu > a:hover, .dropbtn:hover { color: var(--brand-600); }
.nav-menu > a:hover::after, .dropbtn:hover::after { width: 100%; }

/* Dropdown Menu */
.dropdown { position: relative; }
.dropdown-content {
  display: none;
  position: absolute;
  top: 150%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  min-width: 240px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-100);
  padding: var(--space-2);
  z-index: 101;
  animation: fadeUp 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.dropdown:hover .dropdown-content { display: block; }

.dropdown-content a {
  display: block;
  padding: var(--space-3) var(--space-4);
  color: var(--gray-700);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.dropdown-content a:hover {
  background-color: var(--brand-50);
  color: var(--brand-700);
}

/* Botão Header (CTA) */
.header-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem; /* 10px 24px */
  background-color: var(--gray-900);
  color: white;
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
}
.header-cta a:hover {
  background-color: var(--brand-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
   5. COMPONENTE: HERO & SEÇÕES
   :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
.intro {
  text-align: center;
  padding: var(--space-24) 0;
  background: radial-gradient(50% 50% at 50% 50%, #F0F9FF 0%, var(--gray-50) 100%);
}

.intro h1 {
  max-width: 20ch;
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--brand-900) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro p {
  font-size: var(--text-lg);
  color: var(--gray-500);
  margin-left: auto;
  margin-right: auto;
  max-width: 700px;
}

/* Centralização para Seções de Serviço */
.servicos h2, .faq h2 { text-align: center; }
.servicos > p { text-align: center; margin: 0 auto var(--space-12) auto; }

/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
   6. COMPONENTE: CARDS (O Coração do Site)
   :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
.card {
  background-color: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition-base);
  height: 100%; /* Garante altura uniforme */
  isolation: isolate; /* Cria novo contexto de empilhamento */
}

/* Efeito Hover Premium */
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-brand);
  border-color: var(--brand-200);
  z-index: 2;
}

.card h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

/* Link Full-Card Pattern */
.card h3 a { color: inherit; }
.card h3 a::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius-lg);
}

.card p {
  font-size: var(--text-base);
  color: var(--gray-500);
  margin-bottom: var(--space-8);
  flex-grow: 1; /* Empurra o botão para o fundo */
}

/* Botão Mini dentro do Card */
.cta-mini {
  position: relative;
  z-index: 2; /* Fica acima do link full-card */
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.5rem 1.25rem;
  background-color: var(--brand-50);
  color: var(--brand-700);
  font-weight: 700;
  font-size: var(--text-sm);
  border-radius: var(--radius-full);
  transition: var(--transition-base);
  border: 1px solid transparent;
}

.card:hover .cta-mini {
  background-color: var(--brand-600);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Caso o cta-mini seja usado fora de cards (ex: textos) */
section:not(.intro):not(.servicos) .cta-mini {
  background-color: var(--brand-600);
  color: white;
  margin-top: var(--space-4);
}

/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
   7. COMPONENTE: CONTEÚDO RICO (Tabelas, Listas, Detalhes)
   :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
/* Tabelas Estilizadas */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: var(--space-8) 0;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow-sm);
}

th {
  background-color: var(--gray-50);
  color: var(--gray-900);
  font-weight: 700;
  padding: var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--gray-200);
  font-size: var(--text-sm);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background-color: var(--brand-50); }

/* Listas de Conteúdo */
.lista-detalhada h3 { color: var(--brand-600); margin-top: var(--space-8); }
ul { list-style: none; padding-left: var(--space-4); }
li {
  position: relative;
  margin-bottom: var(--space-2);
  padding-left: var(--space-4);
}
/* Custom Bullet */
li::before {
  content: '•';
  color: var(--brand-600);
  font-weight: bold;
  position: absolute;
  left: 0;
  top: 0;
}

/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
   8. COMPONENTE: FAQ (ACCORDION)
   :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
.faq { background-color: white; border-top: 1px solid var(--gray-200); }

details {
  background-color: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  overflow: hidden;
  transition: var(--transition-base);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

details[open] {
  background-color: white;
  border-color: var(--brand-200);
  box-shadow: var(--shadow-md);
}

summary {
  padding: var(--space-5, 20px);
  cursor: pointer;
  font-weight: 600;
  color: var(--gray-900);
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }

/* Ícone Rotativo */
summary::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--brand-500);
  transition: transform 0.3s;
}
details[open] summary::after { transform: rotate(45deg); }

details p {
  padding: 0 20px 20px 20px;
  margin: 0;
  border-top: 1px solid var(--gray-100);
  padding-top: var(--space-4);
  color: var(--gray-500);
  animation: slideDown 0.3s ease-out;
}

/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
   9. FOOTER ROBUSTO
   :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
footer {
  background-color: var(--gray-900);
  color: var(--gray-300);
  padding-top: var(--space-16);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

.footer-col h3 {
  color: white;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-6);
  border-left: 2px solid var(--brand-500);
  padding-left: var(--space-2);
}

.footer-col ul li { padding-left: 0; }
.footer-col ul li::before { content: none; }
.footer-col a { display: inline-block; transition: color 0.2s; font-size: var(--text-sm); }
.footer-col a:hover { color: white; text-decoration: underline; }

.footer-bottom {
  background-color: #020617; /* Quase preto absoluto */
  padding: var(--space-8) 0;
  text-align: center;
  font-size: var(--text-xs);
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
   10. BOTÕES FLUTUANTES E UTILITÁRIOS
   :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
.sticky-whats {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  background-color: var(--success);
  color: white;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
  z-index: 5000;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: transform 0.3s var(--transition-base);
}
.sticky-whats:hover { transform: scale(1.05) translateY(-4px); }

/* Animações Globais */
@keyframes fadeUp {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
   11. RESPONSIVIDADE MOBILE (MOBILE FIRST REAL)
   :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
.menu-toggle { display: none; }

@media (max-width: 1024px) {
  :root {
    --header-height: 70px; /* Header menor no mobile */
    --space-24: 60px; /* Menos espaço em branco */
  }

  .wrap { padding-left: var(--space-4); padding-right: var(--space-4); }
  .grid { gap: var(--space-4); }

  /* Header Mobile */
  .menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-900);
    padding: var(--space-2);
    cursor: pointer;
  }
  .header-cta { display: none; } /* Oculta botão grande */

  /* Menu Drawer - Gaveta Lateral */
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background-color: white;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-6);
    gap: 0;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    border-top: 1px solid var(--gray-200);
  }
  .nav-menu.active { transform: translateX(0); }

  /* Links Mobile - Área de Toque Grande (44px min) */
  .nav-menu > a, .dropbtn {
    width: 100%;
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: var(--text-lg);
    display: flex;
    justify-content: space-between;
  }
  .nav-menu > a::after { display: none; } /* Remove underline animation */

  /* Dropdown Mobile - Accordion */
  .dropdown { width: 100%; }
  .dropdown-content {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    background-color: var(--gray-50);
    width: 100%;
    display: none;
    padding: var(--space-2) var(--space-4);
    margin-top: 0;
    animation: none;
  }
  .dropdown.active .dropdown-content { display: block; }

  /* Ajustes de Tipografia Mobile */
  .intro h1 { font-size: 2.5rem; }
  .intro p { font-size: 1rem; }

  /* Ajustes de Tabela Mobile (Scroll Horizontal) */
  .lista-detalhada {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table { min-width: 600px; } /* Força o scroll */
  
  /* Ajuste Cards Mobile */
  .card { padding: var(--space-6); }
}

/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
   12. PRINT STYLES (Para Impressão de Apólices/Páginas)
   :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
@media print {
  header, footer, .sticky-whats, .menu-toggle, .header-cta { display: none !important; }
  body { background: white; color: black; font-size: 12pt; }
  .wrap { max-width: 100%; padding: 0; margin: 0; }
  .card { border: 1px solid #ccc; break-inside: avoid; box-shadow: none; }
  a { text-decoration: none; color: black; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}
/* ==========================================================================
   V2 - COMPONENTES DE CONTEÚDO LONGO
   ========================================================================== */
.eyebrow{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background:var(--brand-50);
  color:var(--brand-900);
  font-size:var(--text-sm);
  font-weight:700;
  margin-bottom:var(--space-4);
}
.split-grid{
  display:grid;
  grid-template-columns:minmax(0, .95fr) minmax(0, 1.05fr);
  gap:var(--space-8);
  align-items:start;
}
.cards-compact{gap:var(--space-6)}
.card-soft{
  background:#fff;
  border:1px solid var(--gray-200);
  box-shadow:var(--shadow-sm);
}
.number-list,
.check-list,
.links-secundarios,
.pill-list{
  padding-left:1.25rem;
  margin:0;
}
.number-list li,
.check-list li,
.links-secundarios li,
.pill-list li{
  margin-bottom:12px;
  color:var(--gray-700);
}
.pill-list{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  padding-left:0;
  list-style:none;
  margin-top:var(--space-4);
}
.pill-list li,
.pill{
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border-radius:999px;
  background:var(--brand-50);
  color:var(--brand-900);
  font-size:var(--text-sm);
  font-weight:700;
}
.micro-note{
  font-size:var(--text-sm);
  color:var(--gray-500);
}
@media (max-width: 920px){
  .split-grid{grid-template-columns:1fr}
}
