/* ─────────────────────────────────────
   FARMASEGURA — Design System
   Referências: GSales (clean/minimal) + tipografia moderna
   ───────────────────────────────────── */

/* ── Tokens ── */
:root {
  /* Cores institucionais ACERTI (Manual IDV, seção 3.2) */
  --navy-deep:   #1a2030;   /* fundo base — mais escuro que o primary para profundidade */
  --navy-primary:#262E3D;   /* azul-escuro primário ACERTI (#262E3D) */
  --navy-mid:    #2d3a52;   /* tom intermediário para cards */
  --blue-accent: #3B567B;   /* azul secundário ACERTI (#3B567B) */

  --bg:          var(--navy-deep);
  --bg-2:        var(--navy-primary);
  --bg-card:     var(--navy-mid);
  --border:      rgba(59,86,123,0.28);     /* borda azul-tintada */
  --border-hover:rgba(59,86,123,0.55);

  --accent:      #FBB040;   /* âmbar ACERTI exato (Manual IDV Hex FBB040) */
  --accent-dim:  rgba(251,176,64,0.12);
  --accent-glow: rgba(251,176,64,0.28);

  --red-warn:    #ef4444;
  --red-dim:     rgba(239,68,68,0.12);

  --txt-primary:  #eef0f4;
  --txt-secondary:#9aaec8;   /* azul-acinzentado, harmoniza com o navy */
  --txt-muted:    #6a82a0;

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --max-w: 1200px;
  --px:    clamp(1.25rem, 5vw, 3rem);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--txt-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ─────────────────────────────────────
   NAV
   ───────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem var(--px);
  border-bottom: 1px solid var(--border);
  background: rgba(26,32,48,0.9);   /* navy-deep com blur */
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-img-nav {
  height: 48px;
  width: auto;
  display: block;
}

.nav-byline {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--txt-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ─────────────────────────────────────
   HERO — 2 colunas
   ───────────────────────────────────── */
#hero {
  padding-top: calc(80px + clamp(1.5rem, 4vw, 2.5rem));
  padding-bottom: clamp(1.25rem, 2.5vw, 2rem);
  padding-left: var(--px);
  padding-right: var(--px);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: start;
}

/* ── Coluna esquerda ── */
.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding-top: 0.5rem;
}

/* Badge pill */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: var(--accent-dim);
  border: 1px solid rgba(248,190,64,0.25);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  width: fit-content;
}

.badge-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* H1 */
h1 {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--txt-primary);
}

h1 .accent { color: var(--accent); }

/* Subtítulo */
.hero-sub {
  font-size: clamp(1rem, 1.8vw, 1.1rem);
  color: var(--txt-secondary);
  line-height: 1.65;
  max-width: 520px;
}

/* Lista de riscos */
.risk-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.risk-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--txt-secondary);
}

.risk-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--red-warn);
}

.guia-teaser {
  font-size: 0.9rem;
  color: var(--txt-muted);
  line-height: 1.7;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
}

.guia-teaser strong { color: var(--txt-secondary); }

/* ── Coluna direita — card formulário ── */
.hero-form-wrap {
  position: sticky;
  top: 96px;
}

.form-card {
  position: relative;
  overflow: visible;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow:
    0 1px 3px rgba(0,0,0,0.3),
    0 20px 60px rgba(0,0,0,0.4);
}

.form-header {
  margin-bottom: 1.5rem;
}

.form-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.form-header h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--txt-primary);
  margin-bottom: 0.5rem;
}

.form-desc {
  font-size: 0.82rem;
  color: var(--txt-muted);
}

/* Campos */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--txt-secondary);
  letter-spacing: 0.01em;
}

.field-group input,
.field-group select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  color: var(--txt-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.field-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.field-group input::placeholder { color: var(--txt-muted); }

.field-group input:focus,
.field-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field-group input.error,
.field-group select.error {
  border-color: var(--red-warn);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}

/* Botão CTA */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: var(--accent);
  color: #000;
  font-size: 0.92rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
  margin-top: 0.25rem;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  background: #fcc060;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-spinner svg {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Form feedback */
.form-error {
  font-size: 0.8rem;
  color: var(--red-warn);
  background: var(--red-dim);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  text-align: center;
}

/* ── Animação de flutuação do selo ── */
@keyframes selo-float {
  0%   { transform: translateY(0px)   rotate(-3deg); }
  25%  { transform: translateY(-8px)  rotate(0deg);  }
  50%  { transform: translateY(-12px) rotate(3deg);  }
  75%  { transform: translateY(-6px)  rotate(1deg);  }
  100% { transform: translateY(0px)   rotate(-3deg); }
}

/* Selo FarmaSegura — flutuando no canto superior direito do card */
.selo-img {
  position: absolute;
  top: -28px;
  right: -28px;
  width: 130px;
  height: auto;
  opacity: 0.95;
  animation: selo-float 4s ease-in-out infinite;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.45));
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  z-index: 10;
}

/* Pausa a animação ao hover, dá leve zoom */
.form-card:hover .selo-img {
  animation-play-state: paused;
  opacity: 1;
  filter: drop-shadow(0 12px 28px rgba(248,190,64,0.3));
}

/* ── Stats bar ── */
.hero-stats {
  max-width: var(--max-w);
  margin: clamp(2.5rem, 5vw, 4rem) auto 0;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem 2rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.stat-num {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--txt-muted);
  line-height: 1.3;
}

.stat-divider {
  width: 1px;
  height: 48px;
  background: var(--border);
  flex-shrink: 0;
}

/* ─────────────────────────────────────
   SEÇÃO CONTEXTO
   ───────────────────────────────────── */
#contexto {
  padding: clamp(2rem, 4vw, 3rem) var(--px);
  border-bottom: 1px solid var(--border);
}

.ctx-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.section-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt-muted);
  display: block;
  padding-top: 0.4rem;
  position: sticky;
  top: 100px;
}

.ctx-content-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ctx-content-col h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--txt-primary);
}

.ctx-content-col > p {
  font-size: 0.97rem;
  color: var(--txt-secondary);
  line-height: 1.7;
  max-width: 560px;
}

.ctx-itens {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ctx-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1.25rem;
  align-items: start;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.ctx-item:last-child { border-bottom: none; }

.ctx-item:hover { background: rgba(59,86,123,0.08); }

.ctx-item-num {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.ctx-item-body strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--txt-primary);
  margin-bottom: 0.3rem;
}

.ctx-item-body p {
  font-size: 0.85rem;
  color: var(--txt-muted);
  line-height: 1.6;
  margin: 0;
}

.ctx-cta-text {
  font-size: 0.9rem;
  color: var(--txt-secondary);
  line-height: 1.7;
  padding: 1rem 1.25rem;
  background: var(--accent-dim);
  border: 1px solid rgba(248,190,64,0.18);
  border-radius: var(--radius-sm);
}

.ctx-cta-text em {
  font-style: normal;
  font-weight: 700;
  color: var(--accent);
}

/* Botão outline */
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--txt-primary);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  width: fit-content;
  background: transparent;
}

.btn-outline:hover {
  background: rgba(59,86,123,0.15);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* ─────────────────────────────────────
   FOOTER
   ───────────────────────────────────── */
#footer {
  padding: 2.5rem var(--px);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.85rem;
  color: var(--txt-secondary);
}

.footer-logo {
  height: 30px;
  width: auto;
  opacity: 0.8;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.footer-links a {
  color: var(--txt-muted);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent); }

.footer-sep { color: var(--border-hover); }

.footer-legal {
  font-size: 0.75rem;
  color: var(--txt-muted);
  line-height: 1.6;
  max-width: 480px;
}

/* ─────────────────────────────────────
   RESPONSIVIDADE
   ───────────────────────────────────── */

/* Tablet */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-form-wrap {
    position: static;
    overflow: hidden; /* impede o selo de extravazar horizontalmente */
  }

  .hero-sub { max-width: 100%; }

  .hero-stats {
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-top: 1.25rem; /* reduz o gap entre form e stats */
  }

  .stat-divider { display: none; }

  /* selo fica dentro dos limites do card no mobile */
  .selo-img {
    width: 90px;
    top: -18px;
    right: 12px;
  }

  .ctx-inner {
    grid-template-columns: 1fr;
  }

  .section-tag {
    position: static;
    padding-top: 0;
    margin-bottom: -0.5rem;
  }
}

/* Mobile pequeno */
@media (max-width: 480px) {
  :root { --px: 1.25rem; }

  h1 { font-size: 2.2rem; }

  .hero-stats {
    padding: 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-top: 1rem;
  }

  #hero { padding-bottom: 0.75rem; }

  #contexto { padding-top: 1rem; padding-bottom: 1.5rem; }

  .ctx-item {
    grid-template-columns: 40px 1fr;
    gap: 0.75rem;
    padding: 1rem;
  }
}

/* ─────────────────────────────────────
   ANIMAÇÕES DE ENTRADA
   ───────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Delays escalonados */
.fade-up:nth-child(2) { transition-delay: 0.08s; }
.fade-up:nth-child(3) { transition-delay: 0.16s; }
.fade-up:nth-child(4) { transition-delay: 0.24s; }

/* ─────────────────────────────────────
   BREAKPOINT 360px (dispositivos muito pequenos)
   ───────────────────────────────────── */
@media (max-width: 360px) {
  h1 { font-size: 1.85rem; }

  .form-card { padding: 1.25rem; }

  .selo-img {
    top: -20px;
    right: -10px;
    width: 90px;
  }

  .badge-pill { font-size: 0.65rem; }

  .hero-stats { padding: 1rem; }

  .stat-num { font-size: 1.4rem; }
}

/* ─────────────────────────────────────
   PÁGINA OBRIGADO — estilos complementares
   ───────────────────────────────────── */

/* Alias de token para compatibilidade com obrigado.html */
:root {
  --text-tertiary: var(--txt-muted);
}

/* Layout genérico */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--px);
}

/* Header da página obrigado */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem var(--px);
  border-bottom: 1px solid var(--border);
  background: rgba(26,32,48,0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo img { height: 36px; width: auto; }

.header-cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--txt-muted);
  padding: 0.45rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: color 0.2s, border-color 0.2s;
}

.header-cta:hover {
  color: var(--txt-primary);
  border-color: var(--border-hover);
}

/* Página de obrigado */
.thankyou {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(80px + 3rem) var(--px) 4rem;
}

.thankyou-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
}

/* Check icon animado */
.check-icon {
  width: 80px;
  height: 80px;
  color: var(--accent);
  animation: check-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes check-pop {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}

/* Estados de loading / ready */
#loading-state,
#ready-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

#loading-state h1,
#ready-state h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

#ready-state p {
  font-size: 0.92rem;
  color: var(--txt-secondary);
}

.hidden { display: none !important; }

/* Spinner de loading */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Botões genéricos */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s, box-shadow 0.18s, border-color 0.2s;
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-primary:hover {
  background: #fcc060;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--txt-primary);
  border: 1px solid var(--border-hover);
}

.btn-outline:hover {
  background: rgba(59,86,123,0.15);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* CTA de diagnóstico */
.thankyou-cta {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.thankyou-cta h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--txt-primary);
}

.thankyou-cta p {
  font-size: 0.88rem;
  color: var(--txt-secondary);
  line-height: 1.65;
  max-width: 420px;
}

/* Info WhatsApp */
.thankyou-info {
  background: var(--accent-dim);
  border: 1px solid rgba(248,190,64,0.18);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.25rem;
  width: 100%;
}

.thankyou-info p {
  font-size: 0.85rem;
  color: var(--txt-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Footer da página obrigado */
.footer {
  padding: 2rem var(--px);
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.footer-logo img { height: 28px; width: auto; opacity: 0.7; }

.footer-tagline {
  font-size: 0.82rem;
  color: var(--txt-muted);
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--txt-muted);
  opacity: 0.6;
}
