/* ============================================================
   FSS Forms — identidade Full Sales System
   Navy #0c1936 · Vermelho #FE063B · Sora (títulos) + Inter (texto)
   ============================================================ */

:root {
  --red: #fe063b;
  --red-dark: #c90030;
  --red-glow: rgba(254, 6, 59, 0.07);
  --red-glow-md: rgba(254, 6, 59, 0.18);

  --navy: #0c1936;
  --navy-deep: #081128;
  --navy-soft: #14244a;

  --text-on-dark: #ffffff;
  --text-muted-on-dark: rgba(255, 255, 255, 0.68);
  --text-faint: rgba(255, 255, 255, 0.42);
  --border-on-dark: rgba(255, 255, 255, 0.12);

  --radius: 14px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-on-dark);
  background: var(--navy-deep);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* Brilho vermelho difuso ao fundo — assinatura visual da marca. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, var(--red-glow-md), transparent 60%),
    radial-gradient(ellipse 90% 60% at 50% 100%, rgba(20, 36, 74, 0.9), transparent 70%),
    var(--navy-deep);
}

/* ---------------- layout ---------------- */

/* Mobile-first: o conteúdo fica centrado na tela, não colado no topo. */
.page {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 20px;
}

/*
 * Espaçamento por margin (não padding) de propósito: assim a caixa da .topbar
 * casa exatamente com a logo, e o halo abaixo pode usar `inset: 0` sem cálculo.
 */
.topbar {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.topbar img {
  position: relative;
  z-index: 1;
  height: 60px;
  width: auto;
  display: block;
  animation: logoFloat 5.5s ease-in-out infinite;
}

/* Halo que pulsa em contratempo com a subida, sugerindo distância do fundo. */
.topbar::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 190px 58px at center, var(--red-glow-md), transparent 70%);
  opacity: 0.5;
  animation: logoHalo 5.5s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

@keyframes logoHalo {
  0%, 100% { opacity: 0.5;  transform: scale(1); }
  50%      { opacity: 0.28; transform: scale(1.06); }
}

.card {
  background: rgba(12, 25, 54, 0.72);
  border: 1px solid var(--border-on-dark);
  border-radius: var(--radius-lg);
  padding: 34px 30px 30px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

/* ---------------- progresso ---------------- */

.progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.progress-track {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red-dark), var(--red));
  transition: width 0.45s var(--ease);
}

.progress-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

/* ---------------- headline ---------------- */

.headline {
  font-family: 'Sora', system-ui, sans-serif;
  font-size: clamp(1.4rem, 5.4vw, 1.7rem);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.015em;
  margin-bottom: 30px;
}

.headline .accent { color: var(--red); }

/* ---------------- etapas ---------------- */

.step {
  display: none;
  animation: stepIn 0.42s var(--ease) both;
}

.step.is-active { display: block; }

@keyframes stepIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.step-label {
  display: block;
  font-family: 'Sora', system-ui, sans-serif;
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 16px;
}

.step-label .required { color: var(--red); margin-left: 2px; }

/* ---------------- inputs ---------------- */

/*
 * O :not() exclui a busca do dropdown de país: ela também é um <input> dentro
 * de .field e herdaria o anel vermelho e o padding do campo principal.
 */
.field input:not(.iti__search-input) {
  width: 100%;
  padding: 17px 16px;
  font-family: inherit;
  /* 16px é o mínimo que impede o iOS de dar zoom ao focar o campo. */
  font-size: 1.05rem;
  color: var(--text-on-dark);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-on-dark);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.field input:not(.iti__search-input)::placeholder { color: rgba(255, 255, 255, 0.32); }

.field input:not(.iti__search-input):focus {
  border-color: var(--red);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.field input.has-error {
  border-color: var(--red);
  background: rgba(254, 6, 59, 0.06);
}

.field-error {
  display: block;
  min-height: 18px;
  margin-top: 8px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--red);
}

/* ---------------- seletor de DDI (intl-tel-input v29) ---------------- */

/*
 * A lib expõe variáveis oficiais no :root. Este arquivo carrega DEPOIS do CSS
 * dela, então redefinir aqui basta — e vale também quando o dropdown é montado
 * no <body> (dropdownParent), fora da árvore do formulário.
 */
:root {
  --iti-country-selector-bg: #101f42;
  --iti-hover-color: rgba(254, 6, 59, 0.16);
  --iti-border-color: rgba(255, 255, 255, 0.12);
  --iti-icon-color: rgba(255, 255, 255, 0.55);
  --iti-spacer-horizontal: 12px;
}

/* O wrapper que a lib injeta precisa ocupar a linha inteira. */
.iti { width: 100%; display: block; }

/* ---- botão do país (dentro do campo) ---- */

.iti__selected-country {
  border-radius: var(--radius) 0 0 var(--radius);
}

.iti__selected-country-primary {
  padding: 0 4px 0 14px;
  border-radius: var(--radius) 0 0 var(--radius);
  transition: background-color 0.2s;
}

.iti__selected-dial-code {
  color: var(--text-on-dark);
  font-size: 1.05rem;
  margin-left: 8px;
}

/* Linha sutil separando o país do número. */
.iti__country-container::after {
  content: '';
  position: absolute;
  right: 0;
  top: 24%;
  height: 52%;
  width: 1px;
  background: var(--border-on-dark);
  pointer-events: none;
}

.field-tel .iti__tel-input { padding-left: 6px; }

/* ---- dropdown ---- */

/*
 * O seletor duplicado não é engano: a lib estiliza borda e sombra em
 * `.iti--inline-country-selector .iti__country-selector`, que tem especificidade
 * maior. Repetindo o par, a sombra da marca é a que vale.
 */
.iti__country-selector,
.iti--inline-country-selector .iti__country-selector {
  color: var(--text-on-dark);
  border: 1px solid var(--border-on-dark);
  border-radius: var(--radius);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.iti__search-input-wrapper {
  border-bottom: 1px solid var(--border-on-dark);
}

.iti__search-input {
  padding: 13px 14px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-on-dark);
  background: rgba(255, 255, 255, 0.05);
  border: none;
  outline: none;
}

.iti__search-input::placeholder { color: rgba(255, 255, 255, 0.36); }

.iti__country-list {
  max-height: 260px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.iti__country-list::-webkit-scrollbar { width: 8px; }
.iti__country-list::-webkit-scrollbar-track { background: transparent; }
.iti__country-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

.iti__country {
  padding-top: 11px;
  padding-bottom: 11px;
  color: var(--text-muted-on-dark);
  font-size: 0.97rem;
}

.iti__country-name { color: inherit; }

.iti__dial-code { color: var(--text-faint); }

.iti__country.iti__highlight { color: var(--text-on-dark); }
.iti__country.iti__highlight .iti__dial-code { color: var(--text-muted-on-dark); }

.iti__country-check { color: var(--red); }

/* Sem resultados na busca. */
.iti__no-results { color: var(--text-faint); }

/* ---- popup em tela cheia (mobile) ---- */

.iti--fullscreen-popup .iti__country-selector {
  background: var(--navy);
  border-radius: var(--radius-lg);
}

.iti--fullscreen-popup .iti__country-list { max-height: none; }

/* ---------------- ações ---------------- */

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 14px 30px;
  font-family: 'Sora', system-ui, sans-serif;
  font-size: 0.97rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s, filter 0.18s;
  box-shadow: 0 8px 24px rgba(254, 6, 59, 0.28);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(254, 6, 59, 0.38);
}

.btn:active:not(:disabled) { transform: translateY(0); }

.btn:disabled { cursor: not-allowed; filter: saturate(0.6) brightness(0.85); }

.btn.is-loading { color: transparent; }

.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.btn-back {
  padding: 0;
  font-family: inherit;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--text-faint);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-back:hover { color: var(--text-muted-on-dark); }

.enter-hint {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-faint);
  white-space: nowrap;
}

.enter-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  margin-right: 4px;
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--text-muted-on-dark);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-on-dark);
  border-radius: 5px;
}

.form-error {
  min-height: 20px;
  margin-top: 16px;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--red);
  text-align: center;
}

/* ---------------- rodapé ---------------- */

.footnote {
  margin-top: 22px;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-faint);
}

/* ---------------- responsivo ---------------- */

@media (max-width: 520px) {
  .page { padding: 20px 16px; }
  .card { padding: 28px 20px 24px; border-radius: 18px; }
  .topbar { margin-bottom: 26px; }
  .topbar img { height: 52px; }
  /* halo acompanha a largura da logo (proporcao 3.2:1) */
  .topbar::after { background: radial-gradient(ellipse 165px 50px at center, var(--red-glow-md), transparent 70%); }

  /* Botão em largura total e no topo: alvo de toque grande e óbvio. */
  .actions { flex-wrap: wrap; gap: 10px; }
  .btn { flex: 1; min-width: 100%; order: -1; padding: 17px 24px; font-size: 1.02rem; }
  .btn-back { margin: 4px auto 0; padding: 6px 10px; }
  .enter-hint { display: none; }
}

/* Telas muito baixas: recupera espaço vertical sem perder legibilidade. */
@media (max-height: 680px) {
  .topbar { margin-bottom: 18px; }
  .topbar img { height: 44px; }
  .topbar::after { background: radial-gradient(ellipse 140px 42px at center, var(--red-glow-md), transparent 70%); }
  .headline { margin-bottom: 22px; }
  .card { padding: 24px 20px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    /* Sem isto, a flutuação `infinite` viraria um loop frenético em vez de parar. */
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* A logo pousa e o halo fica estável. */
  .topbar img { transform: none !important; }
  .topbar::after { opacity: 0.4 !important; transform: none !important; }
}
