/* ==========================================================================
   1. CORE: VARIABLES, FONTS & RESET
   ========================================================================== */
:root {
  /* Cores */
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  
  /* Badge INSS */
  --hot-bg: #fee2e2;
  --hot-text: #dc2626;
  
  /* Backgrounds */
  --bg-body: #f3f4f6;
  --bg-card: #ffffff;
  
  /* Design Tokens */
  --radius: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Tipografia */
  --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Fontes */
@font-face { font-family: 'Poppins'; src: url('../fonts/Poppins-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../fonts/Poppins-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../fonts/Poppins-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

/* Reset Básico */
* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }
body.no-scroll { overflow: hidden; }

/* Utilities */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

/* ==========================================================================
   2. GLOBAL LAYOUT (Wrapper, Containers, Footer)
   ========================================================================== */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Container padrão para centralizar conteúdo */
.container, .header-inner, .footer-inner, #main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 30px 0;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 15px; }
.footer-links { display: flex; gap: 20px; font-size: 13px; }
.footer-links a { color: var(--text-muted); }

/* Acessibilidade */
.skip-link {
  position: absolute; top: -40px; left: 0; background: #000; color: white; padding: 8px; z-index: 200;
  transition: top 0.3s;
}
.skip-link:focus { top: 0; }

/* ==========================================================================
   3. NAVBAR & HEADER (Novo Design Sólido + Grid Mega Menu)
   ========================================================================== */
.site-header {
  background: #ffffff; /* Fundo branco sólido */
  border-bottom: 1px solid #e5e7eb;
  padding: 0; /* Padding removido pois header-inner controla altura */
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03); /* Sombra bem leve */
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 72px; /* Altura fixa para manter consistência */
}

.brand { display: flex; align-items: center; }

/* Menu Toggle (Mobile Hamburguer) */
.menu-toggle {
  display: none; /* Desktop default */
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: var(--text-main);
  margin-right: 12px;
}

/* Lista de Navegação Principal */
nav ul.nav-list {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-list > li { position: relative; padding: 10px 0; }
.nav-list > li > a {
  color: var(--text-main);
  font-weight: 500;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-list > li > a:hover { color: var(--primary); }
.arrow { font-size: 10px; transition: transform 0.2s; color: var(--primary); }

/* Link do Blog (Estilo sutil de botão) */
.nav-link-blog {
    font-weight: 600;
}

/* --- Search System --- */
.mobile-search { display: none; } /* Só aparece no mobile */

.search-form { display: flex; position: relative; align-items: center; }
.search-form input {
  padding: 8px 16px;
  border-radius: 6px; /* Bordas um pouco menos arredondadas */
  border: 1px solid #d1d5db;
  background: #f9fafb;
  width: 200px;
  transition: all 0.3s;
  outline: none;
  font-size: 14px;
}
.search-form input:focus {
  width: 240px;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}
.search-form button {
  position: absolute; right: 10px; 
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  padding: 0; display: flex;
}

/* Search Results Dropdown */
.search-results-desktop {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #fff; border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15); border: 1px solid #e5e7eb;
  margin-top: 8px; z-index: 1000;
  display: none; max-height: 300px; overflow-y: auto;
}
.search-results-desktop.active { display: block; }
.search-result-item {
  display: block; padding: 12px 16px; color: var(--text-main);
  border-bottom: 1px solid #f3f4f6; font-size: 14px; transition: background 0.2s;
}
.search-result-item:hover { background-color: #f3f4f6; color: var(--primary); }

/* --- MEGA MENU COM GRID --- */
.dropdown-menu {
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  border-radius: 8px;
  opacity: 0; visibility: hidden;
  transition: all 0.2s ease-in-out;
  border: 1px solid #e5e7eb;
  z-index: 1000;
  overflow: hidden; /* Importante para o border-radius */
}

/* Comportamento Hover Desktop */
.dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.dropdown:hover .arrow { transform: rotate(180deg); }

/* Configuração do Mega Menu Grid */
.mega-menu {
  display: grid; 
  grid-template-columns: 240px 1fr 1fr 1fr; /* Coluna 1 fixa, outras flexíveis */
  width: 950px; /* Largura total */
  padding: 0; /* Padding zerado para o grid controlar */
}

/* Colunas do Menu */
.menu-column {
    display: flex; flex-direction: column; gap: 5px;
    padding: 20px 25px;
}

/* Coluna de Destaque (Esquerda) */
.featured-column {
    background-color: #f9fafb; /* Cinza bem claro */
    border-right: 1px solid #e5e7eb;
}

.menu-title {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px;
}

.dropdown-menu a {
  display: block; padding: 8px 10px; color: var(--text-main); font-size: 14px;
  border-radius: 6px; transition: background 0.1s; white-space: nowrap;
  text-decoration: none; margin-left: -10px; /* Alinha visualmente */
}
.dropdown-menu a:hover { background-color: #f3f4f6; color: var(--primary); }

/* Badge "EM ALTA" */
.badge-hot {
    font-size: 10px;
    background-color: var(--hot-bg);
    color: var(--hot-text);
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

/* ==========================================================================
   4. HOME & SECTIONS (Hero, Grid, Cards, FAQ)
   ========================================================================== */
/* Hero Section */
.hero {
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
  padding: 40px 20px;
  margin-top: 20px; margin-bottom: 40px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.hero h2 { margin: 0 0 10px 0; color: #111827; font-size: 24px; }
.hero p { margin: 0; color: var(--text-muted); max-width: 610px; margin: 0 auto; }

/* Grid de Ferramentas (Cards) */
.section-title { font-size: 20px; margin-bottom: 20px; border-left: 4px solid var(--primary); padding-left: 12px; }

.tools-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px; margin-bottom: 40px;
}
.tool-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-md); display: flex; flex-direction: column;
  justify-content: space-between; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  border: 1px solid transparent;
}
.tool-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); border-color: #e5e7eb; }
.tool-card h3 { margin: 0 0 8px 0; font-size: 18px; color: #111; }
.tool-card p { margin: 0 0 20px 0; font-size: 14px; color: var(--text-muted); line-height: 1.5; }

.icon-placeholder {
  width: 40px; height: 40px; background: #e8f0fe; color: var(--primary);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: 18px; margin-bottom: 16px;
}

/* SEO Content Area */
.seo-content { background: #fff; padding: 30px; border-radius: var(--radius); margin-bottom: 30px; box-shadow: var(--shadow-sm); }
.seo-content h2 { font-size: 22px; margin-top: 0; }
.features-list { list-style: none; padding: 0; }
.features-list li { margin-bottom: 10px; padding-left: 20px; position: relative; }

/* Articles */
.content-article { margin: 0 auto; margin-top: 40px; margin-bottom: 40px; }
.content-article h2 { margin-top: 30px; font-size: 24px; }
.example-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0; }
.example-card { background: #fff; padding: 20px; border-radius: 8px; border: 1px solid #eee; }
.example-card code { background: #f4f4f4; padding: 4px 8px; border-radius: 4px; display: block; margin: 10px 0; font-family: monospace; }
.ad-placeholder-horizontal {
  background: #f1f1f1; border: 1px dashed #ccc; height: 100px;
  display: flex; align-items: center; justify-content: center;
  color: #999; margin: 30px 0; border-radius: 8px;
}

 /* Tabela Comparativa */
.table-responsive { overflow-x: auto; margin: 25px 0; border-radius: var(--radius); border: 1px solid #e5e7eb; }
.simple-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.simple-table th, .simple-table td { padding: 14px; text-align: left; border-bottom: 1px solid #e5e7eb; }
.simple-table th { background: #f3f4f6; color: #111; font-weight: 600; }
.simple-table tr:nth-child(even) { background-color: #f9fafb; }

.gestacao-table { width: 100%; border-collapse: collapse; min-width: 500px; }
.gestacao-table th, .gestacao-table td { padding: 14px; text-align: left; border-bottom: 1px solid #e5e7eb; }
.gestacao-table th { background: #dcfce7; color: #14532d; font-weight: 600; }
.gestacao-table tr:nth-child(even) { background-color: #f0fdf4; }

.churras-table { width: 100%; border-collapse: collapse; min-width: 500px; }
.churras-table th, .churras-table td { padding: 14px; text-align: left; border-bottom: 1px solid #e5e7eb; }
.churras-table th { background: #dcfce7; color: #14532d; font-weight: 600; }
.churras-table tr:nth-child(even) { background-color: #f0fdf4; }

.ipva-table { width: 100%; border-collapse: collapse; min-width: 500px; }
.ipva-table th, .ipva-table td { padding: 14px; text-align: left; border-bottom: 1px solid #e5e7eb; }
.ipva-table th { background: #ffedd5; color: #9a3412; font-weight: 600; }
.ipva-table tr:nth-child(even) { background-color: #fff7ed; }
        
.comparison-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.comparison-table th, .comparison-table td { padding: 16px; text-align: left; border-bottom: 1px solid #e5e7eb; }
.comparison-table th { background: #f9fafb; color: #111; font-weight: 600; }
.comparison-table tr:last-child td { border-bottom: none; }

.inss-table { width: 100%; border-collapse: collapse; min-width: 500px; }
.inss-table th, .inss-table td { padding: 14px; text-align: left; border-bottom: 1px solid #e5e7eb; }
.inss-table th { background: #f3f4f6; color: #111; font-weight: 600; }
.inss-table tr:nth-child(even) { background-color: #f9fafb; }
.inss-table tr:last-child td { border-bottom: none; }
        
.highlight-percentage {
    display: inline-block;
    background: #dcfce7; color: #166534;
    padding: 4px 8px; border-radius: 6px; font-weight: 700; font-size: 0.9em;
}

.article-excerpt {
    font-size: 0.9rem;
    color: #4b5563;
    margin-bottom: 20px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.imc-table th, .imc-table td { padding: 14px; text-align: left; border-bottom: 1px solid #e5e7eb; }
.imc-table { width: 100%; border-collapse: collapse; min-width: 500px; }
.imc-table tr:nth-child(even) { background-color: #f9fafb; }
.imc-table th { background: #f3f4f6; color: #111; font-weight: 600; }
        
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
/* Cores das Faixas */
.dot-green { background-color: #22c55e; } /* Normal */
.dot-blue { background-color: #3b82f6; } /* Abaixo */
.dot-orange { background-color: #f97316; } /* Obesidade I */
.dot-yellow { background-color: #eab308; } /* Sobrepeso */
.dot-purple { background-color: #a855f7; } /* Obesidade III */
.dot-red { background-color: #ef4444; } /* Obesidade II */
        
.badge-yes { background-color: #dcfce7; color: #166534; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.badge-no { background-color: #fee2e2; color: #991b1b; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.badge-maybe { background-color: #fef9c3; color: #854d0e; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.badge-sac { background-color: #dbeafe; color: #1e40af; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 0.9em; }
.badge-price { background-color: #fae8ff; color: #86198f; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 0.9em; }



.alert-box { background: #fef2f2; border-left: 4px solid #ef4444; padding: 15px; margin: 20px 0; border-radius: 4px; color: #991b1b; }

/* FAQ Component */
.faq-grid details {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 10px; overflow: hidden;
}
.faq-grid summary {
  padding: 16px; cursor: pointer; font-weight: 600; list-style: none; position: relative;
}
.faq-grid summary::after { content: '+'; position: absolute; right: 20px; font-weight: 300; }
.faq-grid details[open] summary::after { content: '-'; }
.faq-answer { padding: 0 16px 16px 16px; font-size: 14px; color: var(--text-muted); }

/* ==========================================================================
   5. UI COMPONENTS (Buttons, Forms)
   ========================================================================== */
/* Buttons */
.btn-primary {
  display: block; text-align: center; background: var(--primary); color: #fff;
  padding: 10px 16px; border-radius: 8px; font-weight: 600;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-primary:active { transform: scale(0.98); }

.btn-lg { padding: 14px 24px; font-size: 16px; flex: 2; cursor: pointer; border:none; }
.btn-text { background: none; border: none; color: var(--text-muted); cursor: pointer; text-decoration: underline; flex: 1; }
.btn-copy {
  background: #fff; border: 1px solid #d1d5db; padding: 6px 12px;
  border-radius: 4px; cursor: pointer; font-size: 13px; color: #555;
}
.btn-copy:hover { background: #f9fafb; border-color: #bbb; }

/* Inputs & Form Groups */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.select-wrapper select {
  width: 100%; padding: 12px; border-radius: 8px; border: 1px solid #d1d5db;
  background-color: #f9fafb; font-size: 16px; cursor: pointer;
}
input[type="number"], input[type="date"] {
  width: 100%; padding: 12px; border-radius: 8px; border: 1px solid #d1d5db; font-size: 16px; cursor: pointer;
}

/* Input Group (with prefix/suffix) */
.input-group {
  display: flex; align-items: center; border: 1px solid #d1d5db;
  border-radius: 8px; overflow: hidden; background: #fff; transition: box-shadow 0.2s;
}
.input-group:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1); }
.input-prefix, .input-suffix {
  background: #f3f4f6; padding: 10px 14px; color: #555;
  font-weight: 600; font-size: 14px; border-right: 1px solid #d1d5db;
}
.input-suffix { border-right: none; border-left: 1px solid #d1d5db; }
.input-group input { border: none; flex: 1; padding: 12px; font-size: 18px; outline: none; width: 100%; }

/* ==========================================================================
   6. TOOLS & CALCULATORS SPECIFIC
   ========================================================================== */
.breadcrumbs { padding: 20px 0 10px 0; font-size: 14px; color: var(--text-muted); }
.breadcrumbs a { color: var(--text-muted); text-decoration: underline; }
.breadcrumbs strong { color: var(--text-main); font-weight: 500; }

.tool-container {
  background: #fff; border-radius: var(--radius); padding: 30px;
  box-shadow: var(--shadow-sm); margin-bottom: 30px; text-align: center;
}
.tool-container h1 { margin-bottom: 10px; font-size: 28px; color: #111; }
.tool-subtitle { color: var(--text-muted); margin-bottom: 30px; }

.calculator-card { max-width: 600px; margin: 0 auto; text-align: left; }
.inputs-row { display: flex; gap: 20px; }
.inputs-row .form-group { flex: 1; }
.actions { display: flex; gap: 15px; flex-wrap: wrap; align-items: center; margin-top: 25px; }

/* Result Box */
.result-box {
  margin-top: 30px; background: #e8f0fe; border: 1px solid #d2e3fc;
  border-radius: 8px; padding: 24px; text-align: center; animation: fadeIn 0.3s ease;
}
.result-header { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--primary); font-weight: 700; margin-bottom: 8px; }
.result-value { font-size: 36px; font-weight: 700; color: #1a73e8; margin-bottom: 8px; }
.result-detail { font-size: 16px; color: #444; margin-bottom: 16px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   7. RESPONSIVE & MOBILE
   ========================================================================== */

/* Mobile Menu & Sidebar (Breakpoint: 900px) */
@media (max-width: 900px) {
  /* Header Layout */
  .header-inner { flex-wrap: nowrap; }
  .menu-toggle { display: block; } /* Hamburguer visível */
  
  /* Busca Mobile */
  .mobile-search { display: block; margin: 0 0 20px 0; }
  .mobile-search input { 
    width: 100%; padding: 12px; border-radius: 8px; 
    border: 1px solid #d1d5db; background-color: #f9fafb;
  }
  .search-form { display: none; } /* Oculta busca Desktop */

  /* OVERLAY (Fundo escuro) */
  .menu-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.45);
    opacity: 0; visibility: hidden; transition: opacity .3s ease; z-index: 110;
  }
  .menu-overlay.show { opacity: 1; visibility: visible; }

  /* MAIN NAV SIDEBAR (O Menu lateral) */
  .main-nav {
    position: fixed; top: 0; left: -100%;
    width: 85%; max-width: 320px; height: 100vh;
    background: #fff; box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    padding: 20px; transition: left .3s ease;
    z-index: 120; overflow-y: auto;
  }
  .main-nav.open { left: 0; }

  /* Lista de Links no Mobile */
  .nav-list { flex-direction: column; align-items: flex-start; gap: 0; width: 100%; }
  .nav-list > li { width: 100%; padding: 0; }
  .nav-list > li > a {
    padding: 14px 0; font-size: 16px; border-bottom: 1px solid #eee; justify-content: space-between;
  }

  /* Dropdown Mobile (Accordion) */
  .dropdown-menu {
    position: static; transform: none; box-shadow: none; border: none;
    padding: 0; display: none; opacity: 1; visibility: visible;
    min-width: 100%; background: transparent;
  }
  .dropdown.open .dropdown-menu { display: flex; flex-direction: column; } 

  /* Reset do Mega Menu para Mobile (Desfaz o Grid do Desktop) */
  .dropdown-menu.mega-menu { 
    display: none; /* Só aparece se .open estiver ativo */
    grid-template-columns: 1fr; 
    min-width: 100%; 
    transform: none; 
    left: auto;
  }
  .dropdown.open .mega-menu { display: flex; flex-direction: column; }

  /* Reset das Colunas no Mobile */
  .menu-column { padding: 10px 0; border: none; background: transparent; }
  .featured-column { background: transparent; border: none; }
  
  .menu-title { margin-top: 15px; color: var(--primary); font-size: 13px; }

  /* Setas e Interatividade */
  .arrow { margin-left: auto; transition: transform 0.3s; }
  .dropdown.open .arrow { transform: rotate(180deg); }

  /* Forçar override de hover styles */
  .dropdown:hover .dropdown-menu.mega-menu,
  .dropdown .dropdown-menu.mega-menu {
    transform: none !important; left: auto !important;
    position: static !important; opacity: 1 !important; visibility: visible !important;
  }
}

/* Tablet (Breakpoint: 700px) */
@media (max-width: 700px) {
  .header-inner { gap: 10px; }
  .footer-inner { text-align: center; }
  .brand { width: 100%; justify-content: space-between; }
}

/* Small Mobile (Breakpoint: 600px) */
@media (max-width: 600px) {
  .inputs-row { flex-direction: column; gap: 0; }
  .example-grid { grid-template-columns: 1fr; }
  .result-value { font-size: 28px; }
}