/* ==========================================================================
   Componentes: header, navegação, botões, títulos de seção, formulário,
   botão flutuante. Mobile primeiro; amplia em 40em, 60em e 80em.
   ========================================================================== */

/* ---------- Header (pílula flutuante) ---------- */
.site-header {
  position: fixed;
  inset: var(--space-3) 0 auto;
  z-index: 50;
  pointer-events: none;
}

.site-header__bar {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: min(100% - 2 * var(--space-3), var(--container) + 2rem);
  min-height: var(--header-h);
  margin-inline: auto;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  transition:
    background-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.site-header.is-scrolled .site-header__bar {
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  margin-right: auto;
}

.brand img {
  width: auto;
  height: 2.75rem;
  mix-blend-mode: lighten; /* some o fundo preto da arte sobre a pílula */
}

.brand__name {
  display: none;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

.site-header__bar .site-header__cta {
  display: none;
  white-space: nowrap;
}

.menu-toggle {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.menu-toggle .icon {
  width: 1.5rem;
  height: 1.5rem;
  grid-area: 1 / 1;
}

.menu-toggle .icon--close,
.menu-toggle[aria-expanded='true'] .icon--open {
  display: none;
}

.menu-toggle[aria-expanded='true'] .icon--close {
  display: block;
}

/* Menu no celular: painel abaixo da pílula. Sem JS, o menu fica sempre aberto. */
.nav {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  right: 0;
  padding: var(--space-3);
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.js .nav {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-0.5rem);
  transition:
    opacity 0.25s var(--ease),
    transform 0.25s var(--ease),
    visibility 0s linear 0.25s;
}

.js .nav.is-open {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}

.nav__list a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-family: var(--font-condensed);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
}

.nav__list a:hover,
.nav__list a[aria-current='true'] {
  background: var(--ink-3);
  color: var(--gold);
}

.nav__social a {
  color: var(--text-muted);
  text-transform: none;
}

@media (min-width: 22em) {
  .site-header__bar .site-header__cta {
    display: inline-flex;
  }
}

@media (min-width: 40em) {
  .brand__name {
    display: block;
  }
}

@media (min-width: 60em) {
  .menu-toggle {
    display: none;
  }

  .nav,
  .js .nav {
    position: static;
    visibility: visible;
    opacity: 1;
    transform: none;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }

  .nav__list {
    display: flex;
    align-items: center;
    gap: var(--space-1);
  }

  .nav__list a {
    padding: var(--space-2) var(--space-3);
    font-size: 1.0625rem;
    border-radius: var(--radius-pill);
  }

  .nav__social {
    display: none;
  }

  .site-header__cta {
    order: 3;
  }
}

/* ---------- Botões ---------- */
.btn {
  --btn-bg: var(--ink-3);
  --btn-fg: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 3rem;
  padding: var(--space-3) var(--space-5);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-condensed);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  transition:
    transform 0.2s var(--ease),
    background-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    color 0.2s var(--ease);
}

.btn .icon {
  transition: transform 0.2s var(--ease);
}

.btn:hover .icon:last-child {
  transform: translateX(3px);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.btn--gold {
  --btn-bg: var(--gold);
  --btn-fg: var(--ink);
  box-shadow: var(--glow-gold);
}

.btn--gold:hover {
  --btn-bg: var(--gold-hot);
}

.btn--ghost {
  --btn-bg: transparent;
  border-color: var(--line-strong);
}

.btn--ghost:hover {
  border-color: var(--text);
}

.btn--dark {
  --btn-bg: var(--ink);
  --btn-fg: var(--text);
}

.btn--dark:hover {
  --btn-bg: var(--red);
}

.btn--outline-dark {
  --btn-bg: transparent;
  --btn-fg: var(--text-dark);
  border-color: var(--text-dark);
}

.btn--outline-dark:hover {
  --btn-bg: var(--text-dark);
  --btn-fg: var(--paper);
}

.btn--sm {
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-4);
  font-size: 1rem;
}

.btn--lg {
  min-height: 3.5rem;
  padding: var(--space-3) var(--space-6);
  font-size: 1.25rem;
}

.btn--block {
  width: 100%;
}

/* ---------- Rótulos e títulos de seção ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-condensed);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow--red {
  color: var(--red-ink);
}

.section-head {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-7);
  max-width: 44rem;
}

.section-head h2 {
  font-size: var(--fs-h2);
}

.section-head__index {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-condensed);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red-ink);
}

.section-head__index::before {
  content: '';
  width: 2.5rem;
  height: 3px;
  background: currentColor;
  border-radius: 2px;
}

.section-head__lead {
  font-size: var(--fs-lg);
  color: var(--text-muted);
  max-width: 38rem;
}

.section-head--split {
  max-width: none;
}

@media (min-width: 60em) {
  .section-head--split {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

/* ---------- Formulário ---------- */
.form {
  display: grid;
  gap: var(--space-5);
  padding: clamp(1.25rem, 0.75rem + 2.5vw, 2.5rem);
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.field label,
.field legend {
  font-weight: 700;
  font-size: var(--fs-sm);
  letter-spacing: 0.02em;
}

.field__req {
  color: var(--red-ink);
}

.field__opt {
  font-weight: 400;
  color: var(--text-muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3.25rem;
  padding: var(--space-3) var(--space-4);
  background: var(--ink);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 1rem; /* 16px: impede o zoom automático do iOS ao focar */
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.field textarea {
  resize: vertical;
  min-height: 6rem;
}

.field ::placeholder {
  color: var(--text-muted);
  opacity: 0.75;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--text-muted);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent);
}

.field [aria-invalid='true'] {
  border-color: var(--error);
}

.field__error[hidden] {
  display: none;
}

.field__error {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--error);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.field__error::before {
  content: '!';
  display: grid;
  place-items: center;
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  background: var(--error);
  color: var(--ink);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

.select {
  position: relative;
}

.select select {
  appearance: none;
  padding-right: 2.75rem;
}

.select::after {
  content: '';
  position: absolute;
  right: 1.1rem;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.select option {
  background: var(--ink-2);
}

.field--choices {
  border: 0;
  padding: 0;
}

.field--choices legend {
  margin-bottom: var(--space-2);
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.choice {
  position: relative;
  flex: 1 1 6rem;
}

.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.choice span {
  display: grid;
  place-items: center;
  min-height: 3rem;
  padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.choice input:checked + span {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
  font-weight: 700;
}

.choice input:focus-visible + span {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.form__aviso {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-align: center;
}

.form__status {
  padding: var(--space-3) var(--space-4);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  border: 1px solid var(--ok);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
}

.form__status a {
  color: var(--gold);
  font-weight: 700;
}

/* ---------- Botão flutuante do WhatsApp ---------- */
.wa-float {
  position: fixed;
  right: var(--space-4);
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  background: var(--gold);
  color: var(--ink);
  border-radius: 50%;
  box-shadow: var(--glow-gold);
  transition:
    transform 0.3s var(--ease),
    opacity 0.3s var(--ease),
    visibility 0s;
}

.wa-float .icon {
  width: 1.75rem;
  height: 1.75rem;
}

.wa-float:hover {
  transform: scale(1.06);
}

.wa-float.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(1rem) scale(0.9);
  transition:
    transform 0.3s var(--ease),
    opacity 0.3s var(--ease),
    visibility 0s linear 0.3s;
}
