/* ============================================================
   PILAR TI — Design System e Estilos Globais
   Bricolage Grotesque (display) + Manrope (body) + JetBrains Mono (números)
   ============================================================ */

/* ========== TOKENS DE DESIGN ========== */
:root {
  /* Cores primárias */
  --azul: #0B3D91;
  --azul-claro: #2E5BB8;
  --azul-escuro: #061E47;
  --verde: #00D9A3;
  --verde-escuro: #00A37D;
  --verde-claro: #4DEDC0;

  /* Neutros */
  --branco: #FFFFFF;
  --cinza-50: #F9FAFB;
  --cinza-100: #F5F7FA;
  --cinza-200: #E2E8F0;
  --cinza-300: #CBD5E0;
  --cinza-400: #A0AEC0;
  --cinza-500: #718096;
  --cinza-600: #4A5568;
  --cinza-700: #2D3748;
  --cinza-800: #1A202C;
  --cinza-900: #0F1419;

  /* Semânticas */
  --bg: var(--branco);
  --bg-alt: var(--cinza-100);
  --texto: var(--cinza-800);
  --texto-suave: var(--cinza-600);
  --texto-fraco: var(--cinza-500);
  --borda: var(--cinza-200);

  /* Tipografia */
  --display: 'Bricolage Grotesque', 'Times New Roman', serif;
  --body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Espaçamentos (escala 4px) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Raios */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 24px;
  --r-full: 9999px;

  /* Sombras */
  --sh-sm: 0 2px 8px rgba(11, 61, 145, 0.04);
  --sh-md: 0 8px 24px rgba(11, 61, 145, 0.08);
  --sh-lg: 0 20px 50px rgba(11, 61, 145, 0.12);
  --sh-xl: 0 30px 60px rgba(11, 61, 145, 0.18);
  --sh-cta: 0 12px 32px rgba(11, 61, 145, 0.25);

  /* Transições */
  --t-fast: 0.15s ease;
  --t-base: 0.25s ease;
  --t-slow: 0.4s ease;

  /* Container */
  --container: 1280px;
  --container-narrow: 920px;

  /* Header */
  --header-h: 76px;

  /* Z-index */
  --z-cookies: 60;
  --z-whatsapp: 50;
  --z-modal: 80;
  --z-header: 100;
}

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--texto);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, picture, video, svg { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; transition: color var(--t-fast); }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; }
ul, ol { list-style: none; }

/* ========== ACESSIBILIDADE ========== */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--azul); color: #fff; padding: 12px 20px;
  border-radius: 0 0 var(--r-md) 0; z-index: 9999; font-weight: 600;
}
.skip:focus { left: 0; top: 0; }

*:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; border-radius: 2px; }

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

/* ========== CONTAINER ========== */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 24px; }

/* ========== TIPOGRAFIA ========== */
.h1, .h2, .h3, .h4, .h5 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--azul-escuro); }
.h1 { font-size: clamp(40px, 5.5vw, 68px); line-height: 1.05; letter-spacing: -0.03em; }
.h2 { font-size: clamp(32px, 4vw, 48px); }
.h3 { font-size: clamp(24px, 2.5vw, 32px); }
.h4 { font-size: 22px; }
.h5 { font-size: 18px; }

.h1 em, .h2 em, .h3 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--azul), var(--verde));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--azul); background: rgba(11, 61, 145, 0.06);
  padding: 8px 14px; border-radius: var(--r-full);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.eyebrow-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--verde); box-shadow: 0 0 0 4px rgba(0, 217, 163, 0.2);
  animation: pulse 2s infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(0, 217, 163, 0); } }

.section-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--azul); text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.section-tag::before { content: ""; width: 24px; height: 1px; background: var(--azul); }

.section-desc { font-size: 17px; color: var(--texto-suave); line-height: 1.6; }
.lead { font-size: 19px; color: var(--texto-suave); line-height: 1.55; }

/* ========== BOTÕES ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 24px; border-radius: var(--r-md); font-weight: 600;
  font-size: 15px; transition: all var(--t-base); white-space: nowrap;
}
.btn-primary { background: var(--azul); color: #fff; box-shadow: var(--sh-cta); }
.btn-primary:hover { background: var(--azul-escuro); transform: translateY(-2px); box-shadow: 0 16px 40px rgba(11, 61, 145, 0.3); color: #fff; }
.btn-secondary { background: transparent; color: var(--azul-escuro); border: 1.5px solid var(--borda); }
.btn-secondary:hover { border-color: var(--azul); color: var(--azul); }
.btn-green { background: var(--verde-escuro); color: #fff; }
.btn-green:hover { background: var(--verde); color: var(--azul-escuro); }
.btn-lg { padding: 16px 28px; font-size: 16px; }
.btn-sm { padding: 10px 18px; font-size: 14px; }

.section-link {
  font-weight: 600; color: var(--azul); font-size: 15px;
  display: inline-flex; align-items: center; gap: 8px;
  padding-bottom: 8px; border-bottom: 1.5px solid var(--azul);
  white-space: nowrap;
}
.section-link:hover { gap: 12px; color: var(--azul-escuro); }

/* ========== HEADER ========== */
.header {
  position: sticky; top: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--borda); z-index: var(--z-header);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; gap: 32px; }

.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 800; font-size: 22px;
  color: var(--azul-escuro); letter-spacing: -0.02em;
}
.logo svg { width: 32px; height: 32px; }

.nav { display: flex; align-items: center; gap: 32px; }
.nav-link {
  font-size: 15px; font-weight: 500; color: var(--texto);
  position: relative; padding: 6px 0;
}
.nav-link:hover { color: var(--azul); }
.nav-link.has-mega { display: inline-flex; align-items: center; gap: 4px; }
.nav-link.has-mega::after {
  content: ""; width: 7px; height: 7px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); margin-top: -3px; transition: transform var(--t-fast);
}
.has-mega-wrapper { position: relative; }
.has-mega-wrapper:hover .mega { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.has-mega-wrapper:hover .nav-link.has-mega::after { transform: rotate(-135deg); margin-top: 3px; }

/* Megamenu */
.mega {
  position: fixed; top: var(--header-h); left: 50%;
  transform: translateX(-50%) translateY(-10px);
  width: min(1180px, calc(100vw - 40px));
  max-height: calc(100vh - var(--header-h) - 24px); overflow-y: auto;
  background: #fff; border: 1px solid var(--borda); border-radius: var(--r-xl);
  padding: 28px 32px; box-shadow: var(--sh-xl);
  opacity: 0; visibility: hidden; transition: all var(--t-base);
}
.mega-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px 20px; align-items: start; }
.mega-col { display: flex; flex-direction: column; min-width: 0; }
.mega-col-title {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--texto-suave);
  margin: 0 0 6px; padding: 0 0 10px;
  border-bottom: 1px solid var(--borda);
}
.mega-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border-radius: var(--r-md); transition: background var(--t-fast);
}
.mega-item:hover { background: var(--cinza-100); }
.mega-item-title { font-weight: 600; font-size: 14px; color: var(--texto); }
.mega-item-desc { font-size: 12px; color: var(--texto-suave); }

/* Mobile menu trigger */
.menu-trigger { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: var(--r-md); }
.menu-trigger svg { width: 24px; height: 24px; }

/* ========== FOOTER ========== */
.footer {
  background: var(--azul-escuro); color: #fff;
  padding: 80px 0 32px; position: relative; overflow: hidden;
}
.footer::before {
  content: ""; position: absolute; top: 0; left: 50%;
  transform: translateX(-50%); width: 90%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--verde), transparent);
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px; margin-bottom: 48px;
}
.footer-brand .logo { color: #fff; margin-bottom: 20px; }
.footer-brand .logo svg path,
.footer-brand .logo svg rect { fill: var(--verde); }
.footer-about {
  font-size: 14px; color: rgba(255, 255, 255, 0.6);
  line-height: 1.55; margin-bottom: 24px; max-width: 320px;
}
.footer-contact { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.footer-contact a {
  color: rgba(255, 255, 255, 0.7);
  display: inline-flex; align-items: center; gap: 10px;
}
.footer-contact a:hover { color: var(--verde); }
.footer-contact svg { color: var(--verde); flex-shrink: 0; }

.footer-col-title {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--verde); margin-bottom: 20px;
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: rgba(255, 255, 255, 0.65); font-size: 14px; }
.footer-links a:hover { color: #fff; }

.footer-bottom {
  padding-top: 32px; border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: rgba(255, 255, 255, 0.5);
  flex-wrap: wrap; gap: 16px;
}
.footer-bottom-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-bottom-links a { color: rgba(255, 255, 255, 0.5); }
.footer-bottom-links a:hover { color: #fff; }

.footer-disclaimer {
  margin-top: 16px; padding: 12px 16px;
  background: rgba(255, 193, 7, 0.1); border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: var(--r-md); font-size: 12px; color: rgba(255, 193, 7, 0.9);
  text-align: center;
}

/* ========== WHATSAPP FLUTUANTE ========== */
.whatsapp-float {
  position: fixed; bottom: 24px; right: 24px;
  width: 56px; height: 56px; background: #25D366; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  z-index: var(--z-whatsapp); transition: transform var(--t-base);
}
.whatsapp-float::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: #25D366; animation: ring 2s infinite; z-index: -1;
}
@keyframes ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}
.whatsapp-float:hover { transform: scale(1.1); }
.whatsapp-float svg { width: 28px; height: 28px; }

/* ========== BANNER COOKIES ========== */
.cookies {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid var(--borda);
  padding: 16px 24px; display: flex;
  justify-content: space-between; align-items: center; gap: 24px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.08);
  z-index: var(--z-cookies); font-size: 13px;
  transform: translateY(100%); transition: transform var(--t-slow);
}
.cookies.show { transform: translateY(0); }
.cookies-text { color: var(--texto-suave); max-width: 600px; }
.cookies-text strong { color: var(--texto); }
.cookies-text a { color: var(--azul); font-weight: 600; }
.cookies-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cookies-btn { padding: 10px 18px; border-radius: var(--r-sm); font-weight: 600; font-size: 13px; transition: all var(--t-base); }
.cookies-accept { background: var(--azul); color: #fff; }
.cookies-accept:hover { background: var(--azul-escuro); }
.cookies-reject { background: transparent; border: 1px solid var(--borda); color: var(--texto-suave); }
.cookies-reject:hover { border-color: var(--cinza-400); }

/* ========== EXIT INTENT MODAL ========== */
.exit-overlay {
  position: fixed; inset: 0; background: rgba(6, 30, 71, 0.7);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  z-index: var(--z-modal); padding: 24px;
}
.exit-overlay.show { display: flex; animation: fadeIn 0.3s; }
.exit-modal {
  background: #fff; border-radius: var(--r-2xl); padding: 48px;
  max-width: 480px; width: 100%; position: relative;
  animation: slideUp 0.4s; box-shadow: var(--sh-xl);
}
.exit-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--cinza-100); display: flex;
  align-items: center; justify-content: center;
  color: var(--texto-suave); transition: all var(--t-fast);
}
.exit-close:hover { background: var(--cinza-200); color: var(--texto); }
.exit-modal h3 {
  font-family: var(--display); font-size: 26px; font-weight: 700;
  color: var(--azul-escuro); margin-bottom: 12px; letter-spacing: -0.02em;
}
.exit-modal p { color: var(--texto-suave); margin-bottom: 24px; font-size: 15px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ========== FORMULÁRIOS ========== */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--texto-suave); margin-bottom: 6px;
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.04em;
}
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--borda);
  border-radius: var(--r-md); font-size: 14px;
  transition: border-color var(--t-fast); background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--azul);
}
.field textarea { resize: vertical; min-height: 100px; font-family: inherit; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn-form {
  width: 100%; padding: 14px; background: var(--azul-escuro); color: #fff;
  border-radius: var(--r-md); font-weight: 600; font-size: 14px;
  margin-top: 8px; transition: all var(--t-base);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-form:hover { background: var(--azul); transform: translateY(-1px); }
.form-disclaimer { font-size: 11px; color: var(--texto-suave); margin-top: 12px; text-align: center; }

/* Honeypot anti-spam (escondido) */
.hp-field { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

/* ========== BREADCRUMBS ========== */
.breadcrumbs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 24px 0; font-size: 13px; color: var(--texto-suave);
}
.breadcrumbs a { color: var(--texto-suave); }
.breadcrumbs a:hover { color: var(--azul); }
.breadcrumbs span[aria-current] { color: var(--texto); font-weight: 600; }
.breadcrumbs-sep {
  color: var(--cinza-400); font-family: var(--mono); font-size: 11px;
}

/* ========== SEÇÕES GENÉRICAS ========== */
.section { padding: 100px 0; }
.section-sm { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--azul-escuro); color: #fff; }
.section-dark .h1, .section-dark .h2, .section-dark .h3 { color: #fff; }
.section-dark .section-tag { color: var(--verde); }
.section-dark .section-tag::before { background: var(--verde); }
.section-dark .section-desc { color: rgba(255, 255, 255, 0.7); }

.section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 56px; gap: 48px;
}
.section-head-text { max-width: 680px; }
.section-head .h2 { margin-bottom: 18px; }

/* ========== CARDS GENÉRICOS ========== */
.card {
  background: #fff; border: 1px solid var(--borda);
  border-radius: var(--r-xl); padding: 32px;
  transition: all var(--t-base);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); border-color: var(--azul); }
.card-icon {
  width: 48px; height: 48px; border-radius: var(--r-lg);
  background: rgba(11, 61, 145, 0.08); color: var(--azul);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
}
.card-icon svg { width: 24px; height: 24px; }
.card-icon.green { background: rgba(0, 217, 163, 0.12); color: var(--verde-escuro); }

/* ========== FAQ ========== */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  border: 1px solid var(--borda); border-radius: var(--r-lg);
  overflow: hidden; transition: all var(--t-base);
}
.faq-item[open] { border-color: var(--azul); background: var(--cinza-100); }
.faq-q {
  padding: 18px 20px; font-weight: 600; color: var(--azul-escuro);
  font-size: 15px; cursor: pointer; display: flex;
  justify-content: space-between; align-items: center; list-style: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: "+"; font-family: var(--mono); font-size: 22px;
  color: var(--azul); font-weight: 400; transition: transform var(--t-base);
  margin-left: 16px;
}
.faq-item[open] .faq-q::after { content: "−"; }
.faq-a { padding: 0 20px 20px; font-size: 14px; color: var(--texto-suave); line-height: 1.6; }

/* ========== UTILITIES ========== */
.text-center { text-align: center; }
.text-mono { font-family: var(--mono); }
.text-display { font-family: var(--display); }
.gradient-text {
  background: linear-gradient(120deg, var(--azul), var(--verde));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* ========== SELETOR DE IDIOMA ========== */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; }
.lang-opt { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: var(--r-full); font-size: 12px; font-weight: 600; color: var(--texto-fraco); transition: all var(--t-fast); }
.lang-opt .flag { width: 18px; height: 13px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,0.08); flex: none; display: block; }
.lang-opt:hover { background: var(--cinza-100); color: var(--texto); }
.lang-opt.is-active { color: var(--azul); background: rgba(11,61,145,0.06); cursor: default; }

/* ========== RESPONSIVO ========== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .mega-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .nav { display: none; }
  .menu-trigger { display: inline-flex; }
  .section { padding: 64px 0; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .field-row { grid-template-columns: 1fr; }
  .exit-modal { padding: 32px 24px; }
  .cookies { flex-direction: column; align-items: flex-start; gap: 12px; }
  .cookies-actions { width: 100%; }
  .cookies-btn { flex: 1; }
}

/* ========== PRINT ========== */
@media print {
  .header, .footer, .whatsapp-float, .cookies, .exit-overlay { display: none; }
  body { font-size: 11pt; line-height: 1.4; }
  a { color: var(--texto); text-decoration: underline; }
}
