/* ============================================================
   REAL CREDI — Componentes: header pill, botões, cards, badges,
   accordion, slider, chips, cookie banner, botão flutuante.
   ============================================================ */

/* =========================
   HEADER PILL GLASS (seção 4)
   ========================= */
.header {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1140px, 92vw);
  height: var(--header-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-inline: clamp(16px, 3vw, 28px);
  background: var(--white);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
  transition: all .4s var(--ease-brand);
}

.header.scrolled {
  height: var(--header-h-scrolled);
  background: rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: var(--shadow-lift);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--green-700);
  flex-shrink: 0;
}

.header__logo img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  transition: width .4s var(--ease-brand), height .4s var(--ease-brand);
}

.header.scrolled .header__logo img { width: 38px; height: 38px; }

.header__nav {
  display: none;
}

.header__cta { flex-shrink: 0; }

/* Em telas estreitas o CTA vive no painel do menu (evita estourar a pill).
   Especificidade dupla para vencer a regra .btn declarada depois. */
@media (max-width: 599px) {
  .btn.header__cta { display: none; }
}

/* Desktop nav */
@media (min-width: 900px) {
  .header__nav {
    display: flex;
    gap: 4px;
  }

  .header__nav a {
    position: relative;
    padding: 8px 14px;
    font-weight: 500;
    font-size: .95rem;
    color: var(--ink-900);
    border-radius: var(--radius-pill);
    transition: color var(--dur-micro) var(--ease-brand), background var(--dur-micro) var(--ease-brand);
  }

  .header__nav a:hover {
    color: var(--green-700);
    background: var(--mint-050);
  }

  .header__nav a.active {
    color: var(--green-700);
    background: var(--mint-050);
    font-weight: 600;
  }
}

/* Hamburger (mobile) */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 50%;
  z-index: 110;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--green-700);
  border-radius: 2px;
  transition: transform .3s var(--ease-brand), opacity .3s var(--ease-brand);
  transform-origin: center;
}

.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 900px) {
  .hamburger { display: none; }
}

/* Painel mobile fullscreen glass */
.mobile-menu {
  position: fixed;
  inset: 0;
  /* Abaixo do header (100): a pill e o botão X continuam clicáveis */
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s var(--ease-brand), visibility .35s;
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu a,
.mobile-menu button {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--green-900);
  padding: 12px 24px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .4s var(--ease-brand), transform .4s var(--ease-brand);
}

.mobile-menu.open a,
.mobile-menu.open button {
  opacity: 1;
  transform: translateY(0);
  /* stagger de 60ms aplicado via transition-delay inline no JS */
}

.mobile-menu .btn { margin-top: 16px; }

/* =========================
   BOTÕES
   ========================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  padding: 16px 32px;
  border-radius: var(--radius-pill);
  transition: transform var(--dur-micro) var(--ease-brand),
              box-shadow var(--dur-micro) var(--ease-brand),
              background var(--dur-micro) var(--ease-brand);
  white-space: nowrap;
}

.btn:active { transform: scale(.97); }

.btn svg { width: 20px; height: 20px; flex-shrink: 0; }

/* CTA primário — vermelho EXCLUSIVO de conversão, sempre sobre branco/menta */
.btn--primary {
  background: var(--red-600);
  color: var(--white);
  box-shadow: var(--shadow-cta);
  position: relative;
}

.btn--primary:hover {
  background: var(--red-500);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(200, 41, 30, .36);
}

/* Anel de pulse sutil a cada 6s (hero) */
.btn--pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid var(--red-500);
  opacity: 0;
  animation: cta-pulse 6s var(--ease-brand) infinite;
  pointer-events: none;
}

/* Secundário — outline verde */
.btn--outline {
  background: var(--white);
  color: var(--green-700);
  border: 2px solid var(--green-300);
}

.btn--outline:hover {
  background: var(--mint-050);
  border-color: var(--green-500);
  transform: translateY(-2px);
}

/* Ghost sobre fundo verde (CTA final) */
.btn--light {
  background: rgba(255, 255, 255, .14);
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, .45);
}

.btn--light:hover { background: rgba(255, 255, 255, .24); }

.btn--sm { padding: 11px 22px; font-size: .9rem; }

.btn--lg { padding: 19px 42px; font-size: 1.08rem; }

/* Microcopy de redução de ansiedade junto ao CTA */
.cta-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--ink-500);
  margin-top: 12px;
}

.cta-note svg { width: 15px; height: 15px; color: var(--green-500); }

/* =========================
   BADGES / CARDS / CHIPS
   ========================= */
.badge-glass {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--green-900);
  background: rgba(255, 255, 255, .6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  box-shadow: var(--shadow-soft);
}

.badge-glass svg { width: 16px; height: 16px; color: var(--green-500); }

.card {
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: clamp(24px, 4vw, 36px);
}

/* Borda em gradiente verde (simulador, hovers) */
.card--gradient-border {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-card);
}

.card--gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: var(--grad-brand);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--mint-050);
  flex-shrink: 0;
}

.icon-circle svg {
  width: 24px;
  height: 24px;
  color: var(--green-700);
  stroke-width: 1.75;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--green-700);
  background: var(--mint-050);
  border: 1px solid var(--mint-200);
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  transition: all var(--dur-micro) var(--ease-brand);
  cursor: pointer;
}

.chip:hover, .chip.selected {
  background: var(--green-700);
  color: var(--white);
  border-color: var(--green-700);
  transform: translateY(-2px);
}

/* =========================
   ACCORDION FAQ (seção 9)
   ========================= */
.accordion-item {
  background: var(--white);
  border: 1px solid var(--mint-200);
  border-radius: 16px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color var(--dur-micro) var(--ease-brand), box-shadow var(--dur-micro) var(--ease-brand);
}

.accordion-item.open {
  border-color: var(--green-300);
  box-shadow: var(--shadow-soft);
}

.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 20px 24px;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--green-900);
}

.accordion-trigger .chevron {
  width: 22px;
  height: 22px;
  color: var(--green-500);
  flex-shrink: 0;
  transition: transform .35s var(--ease-brand);
}

.accordion-item.open .chevron { transform: rotate(180deg); }

.accordion-panel {
  height: 0;
  overflow: hidden;
  transition: height .4s var(--ease-brand);
}

.accordion-panel > div {
  padding: 0 24px 22px;
  color: var(--ink-500);
}

/* =========================
   SLIDER DO SIMULADOR (seção 5.4)
   ========================= */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--green-700) 0%, var(--green-500) var(--fill, 50%), var(--mint-050) var(--fill, 50%));
  outline-offset: 6px;
  cursor: pointer;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--green-500);
  box-shadow: 0 4px 14px rgba(6, 71, 55, .25);
  transition: transform var(--dur-micro) var(--ease-brand);
}

.range::-webkit-slider-thumb:hover { transform: scale(1.15); }

.range::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--green-500);
  box-shadow: 0 4px 14px rgba(6, 71, 55, .25);
}

.select {
  width: 100%;
  padding: 14px 44px 14px 16px;
  border: 1.5px solid var(--mint-200);
  border-radius: 14px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230B6B4F' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  appearance: none;
  -webkit-appearance: none;
  color: var(--ink-900);
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--dur-micro) var(--ease-brand);
}

.select:hover, .select:focus { border-color: var(--green-300); }

/* =========================
   BOTÃO FLUTUANTE WHATSAPP
   ========================= */
.wa-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 10px 30px rgba(20, 154, 110, .4);
  opacity: 0;
  transform: scale(.4) translateY(30px);
  pointer-events: none;
  transition: opacity .5s var(--ease-brand), transform .5s var(--ease-brand);
}

.wa-float.show {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.wa-float:hover { background: var(--green-700); }

.wa-float svg { width: 30px; height: 30px; color: var(--white); fill: var(--white); }

.wa-float__tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--white);
  color: var(--ink-900);
  font-size: .85rem;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .4s var(--ease-brand);
}

.wa-float.show .wa-float__tooltip { opacity: 1; animation: tooltip-hide 0s 6s forwards; }

@keyframes tooltip-hide { to { opacity: 0; visibility: hidden; } }

/* =========================
   BANNER DE COOKIES (LGPD)
   ========================= */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 120;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  max-width: 620px;
  margin-inline: auto;
  background: var(--white);
  border: 1px solid var(--mint-200);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lift);
  padding: 18px 22px;
}

.cookie-banner.show { display: flex; }

.cookie-banner p { font-size: .85rem; flex: 1 1 280px; margin: 0; }

.cookie-banner .actions { display: flex; gap: 8px; }

/* =========================
   MODAL — SIMULAÇÃO CRÉDITO PESSOAL (formulário de lead)
   ========================= */
.credit-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s var(--ease-brand), visibility .35s;
}

.credit-modal.open {
  opacity: 1;
  visibility: visible;
}

.credit-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 71, 55, .55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.credit-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  transform: translateY(24px) scale(.97);
  opacity: 0;
  transition: transform .4s var(--ease-brand), opacity .4s var(--ease-brand);
}

.credit-modal.open .credit-modal__dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.credit-modal__header {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: var(--grad-brand);
  color: var(--white);
  padding: 22px 26px;
}

.credit-modal__header h2 {
  color: var(--white);
  font-size: 1.25rem;
}

.credit-modal__header p {
  color: rgba(255, 255, 255, .85);
  font-size: .88rem;
  margin-top: 4px;
}

.credit-modal__close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--white);
  background: rgba(255, 255, 255, .16);
  transition: background var(--dur-micro) var(--ease-brand);
}

.credit-modal__close:hover { background: rgba(255, 255, 255, .3); }

.credit-modal__close svg { width: 18px; height: 18px; }

.credit-modal__body {
  overflow-y: auto;
  padding: 24px 26px 28px;
}

.credit-modal__warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--amber-050);
  border: 1px solid var(--amber-300);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 22px;
}

.credit-modal__warning svg {
  width: 20px;
  height: 20px;
  color: var(--amber-600);
  flex-shrink: 0;
  margin-top: 1px;
}

.credit-modal__warning span {
  font-size: .87rem;
  font-weight: 600;
  color: var(--amber-900);
}

.form-field { margin-bottom: 16px; }

.form-field label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--green-900);
  margin-bottom: 6px;
}

.form-field input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--mint-200);
  border-radius: 14px;
  color: var(--ink-900);
  font-weight: 500;
  transition: border-color var(--dur-micro) var(--ease-brand);
}

.form-field input::placeholder { color: var(--ink-500); opacity: .65; }

.form-field input:hover,
.form-field input:focus { border-color: var(--green-300); }

.form-field input:invalid:not(:placeholder-shown) { border-color: var(--red-500); }

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 560px) {
  .form-row { grid-template-columns: repeat(3, 1fr); }
  .form-row--2 { grid-template-columns: repeat(2, 1fr); }
}

.select--locked {
  pointer-events: none;
  background-color: var(--mint-050);
  color: var(--ink-500);
}

.credit-modal__utility {
  background: var(--green-900);
  border-radius: 16px;
  padding: 18px 20px;
  margin: 22px 0;
}

.credit-modal__utility label {
  display: block;
  color: var(--white);
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 10px;
}

.form-checks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .85rem;
  color: var(--ink-500);
  cursor: pointer;
}

.form-check input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--green-700);
}

.form-check a { color: var(--green-700); font-weight: 600; text-decoration: underline; }

.btn--amber {
  background: var(--amber-600);
  color: var(--green-900);
  width: 100%;
}

.btn--amber:hover {
  background: var(--amber-700);
  transform: translateY(-2px);
}

.credit-modal__success,
.credit-modal__disqualified { text-align: center; padding: 8px 4px 4px; }

.credit-modal__success .icon-circle,
.credit-modal__disqualified .icon-circle {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  background: var(--mint-050);
}

.credit-modal__disqualified .icon-circle { background: var(--red-050); }

.credit-modal__disqualified .icon-circle svg { color: var(--red-600); }

.credit-modal__success .icon-circle svg,
.credit-modal__disqualified .icon-circle svg { width: 34px; height: 34px; }

.credit-modal__success h3,
.credit-modal__disqualified h3 { margin-bottom: 10px; }

.credit-modal__success p,
.credit-modal__disqualified p { margin-bottom: 26px; }

/* =========================
   PERGUNTAS DE QUALIFICAÇÃO (gate do popup)
   ========================= */
.gate-question { margin-bottom: 22px; }

.gate-question__label {
  display: block;
  font-size: .95rem;
  font-weight: 600;
  color: var(--green-900);
  margin-bottom: 10px;
}

.gate-options { display: flex; gap: 10px; }

.gate-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border: 1.5px solid var(--mint-200);
  border-radius: 14px;
  font-weight: 600;
  color: var(--ink-900);
  cursor: pointer;
  transition: all var(--dur-micro) var(--ease-brand);
}

.gate-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.gate-option:hover { border-color: var(--green-300); }

.gate-option.selected {
  background: var(--green-700);
  border-color: var(--green-700);
  color: var(--white);
}
