/* =========================================================================
   LAUETI DF/GO — Formulário de Inscrição
   Estilo "soft": paleta suave azul/verde-água, cantos arredondados,
   sombras leves, transições sutis. Mobile-first.
   ========================================================================= */

/* ---------- Tokens de design ---------- */
:root {
  /* Paleta LAUETI: vermelho / carvão / preto (tema escuro) */
  --accent:        #e0313d;   /* vermelho vivo (contraste em fundo escuro) */
  --accent-dark:   #b3121b;   /* hover / vermelho escuro */
  --accent-soft:   #3a191c;   /* fundo de destaque (vinho escuro) */
  --accent-ring:   rgba(224, 49, 61, 0.45); /* anel de foco */

  --ink:           #f0f1f3;   /* quase branco — texto principal */
  --ink-soft:      #b3b9c0;   /* cinza claro — texto secundário */
  --muted:         #7d838b;   /* cinza médio — placeholder / dicas */
  --line:          #2a2a30;   /* bordas sutis no preto */
  --line-strong:   #3b3b42;
  --danger:        #ff6b6b;   /* erro legível no escuro */
  --danger-soft:   #2e1416;

  --card-bg:       #0a0a0c;   /* preto (fundo do card) */
  --field-bg:      #16161a;   /* campos: um tom acima do preto */

  --radius:        18px;
  --radius-sm:     12px;
  --radius-pill:   999px;

  --shadow-card:   0 18px 50px -12px rgba(0, 0, 0, 0.55);
  --shadow-soft:   0 4px 14px -4px rgba(0, 0, 0, 0.5);

  --font-body:  'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-head:  'Poppins', var(--font-body);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Reset leve ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.6;
  /* fundo preto com leve brilho vermelho nos cantos */
  background:
    radial-gradient(1200px 600px at 100% -10%, #1e0c0e 0%, transparent 60%),
    radial-gradient(1000px 500px at -10% 110%, #0a0a0c 0%, transparent 55%),
    #000000;
  min-height: 100vh;
}

/* Acessibilidade: conteúdo apenas para leitores de tela */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Layout raiz ---------- */
.app {
  max-width: 620px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

/* Marca d'água estilo papel timbrado: logo grande, bem apagado, centralizado.
   z-index/opacidade baixos garantem legibilidade do conteúdo por cima. */
.card::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(82%, 480px);
  aspect-ratio: 1;
  background: url("logo.png") center / contain no-repeat;  /* PNG transparente */
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}
/* Conteúdo sempre acima da marca d'água */
.card > * { position: relative; z-index: 1; }

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  padding: 18px 8px 4px;
}

/* ---------- Barra de progresso ---------- */
.progress {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #141418, var(--card-bg));
}
.progress__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.progress__brand {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.progress__count {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 500;
}
.progress__track {
  height: 8px;
  background: var(--line);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  transition: width 0.45s var(--ease);
}

/* ---------- Steps / transições ---------- */
.steps { position: relative; padding: 20px 18px 22px; }

.step { animation: none; }
.step[hidden] { display: none; }

/* Entrada suave (fade + slide) */
.step.is-active {
  animation: stepIn 0.4s var(--ease) both;
}
@keyframes stepIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .step.is-active { animation: none; }
  .progress__fill { transition: none; }
}

/* ---------- Tela de boas-vindas ---------- */
.welcome { text-align: center; }
.welcome__logo {
  display: block;
  width: 230px;
  max-width: 66%;
  height: auto;
  margin: 0 auto 14px;
  /* logo já é PNG transparente — sem crop/sombra, funde com o preto da página */
  filter: drop-shadow(0 6px 20px rgba(224, 49, 61, 0.22));
}
.welcome__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--ink);
}
.welcome__subtitle {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.92rem;
  margin: 0 0 22px;
}
.welcome__text {
  text-align: left;
  color: var(--ink-soft);
  font-size: 0.94rem;
  background: var(--field-bg);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 18px 18px 6px;
  margin-bottom: 24px;
}
.welcome__text p { margin: 0 0 14px; }

/* ---------- Títulos de step ---------- */
.step__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.35rem;
  margin: 0 0 4px;
  color: var(--ink);
}
.step__hint {
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin: 0 0 22px;
}
.req-mark { color: var(--danger); }
.opt { color: var(--muted); font-weight: 400; font-size: 0.82em; }

/* ---------- Campos ---------- */
.field { margin-bottom: 18px; }
.field > label,
.field legend {
  display: block;
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--ink);
  margin-bottom: 7px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="month"],
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--field-bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
textarea { resize: vertical; min-height: 84px; }

input::placeholder, textarea::placeholder { color: var(--muted); }

/* Select com seta customizada */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23b3b9c0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* Foco visível (acessibilidade) */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #1f1f25;
  box-shadow: 0 0 0 4px var(--accent-ring);
}

/* Estado inválido */
.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.field.has-error input:focus,
.field.has-error select:focus,
.field.has-error textarea:focus {
  box-shadow: 0 0 0 4px rgba(214, 69, 69, 0.18);
}

.error {
  color: var(--danger);
  font-size: 0.8rem;
  margin: 6px 2px 0;
  min-height: 0;
}
.error:empty { display: none; }

/* ---------- Fieldsets (grupos) ---------- */
fieldset.group {
  border: none;
  padding: 0;
  margin: 0 0 18px;
}
.choices {
  display: flex;
  gap: 10px;
}
.choices--wrap { flex-wrap: wrap; }

/* Chips selecionáveis (checkbox/radio) */
.choice {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 68px;
  padding: 11px 14px;
  background: var(--field-bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s var(--ease);
}
.choice input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.choice:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #ff8a92;
  font-weight: 500;
}
.choice:has(input:focus-visible) {
  box-shadow: 0 0 0 4px var(--accent-ring);
}

/* Checkboxes de termos (empilhados, alinhados à esquerda) */
.check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  background: var(--field-bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.18s var(--ease);
}
.check input { accent-color: var(--accent); width: 18px; height: 18px; margin-top: 1px; flex: 0 0 auto; }
.check:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent-ring);
  color: var(--ink);
}
.check:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--accent-ring); }

/* ---------- Dropzone de upload ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 26px 18px;
  background: var(--field-bg);
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.is-drag {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}
.dropzone__icon {
  font-size: 1.4rem;
  color: var(--accent-dark);
}
.dropzone__text { font-size: 0.9rem; color: var(--ink-soft); }
.dropzone__text strong { color: var(--accent-dark); }
.dropzone__hint { font-size: 0.76rem; color: var(--muted); }

/* Pílula do arquivo selecionado */
.file-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 14px;
  background: var(--accent-soft);
  border: 1.5px solid var(--accent-ring);
  border-radius: var(--radius-sm);
}
.file-pill__icon { font-size: 1.1rem; }
.file-pill__name {
  flex: 1 1 auto;
  font-size: 0.86rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-pill__remove {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  line-height: 1;
}
.file-pill__remove:hover { background: var(--danger-soft); }

/* ---------- Erro de envio ---------- */
.submit-error {
  background: var(--danger-soft);
  border: 1.5px solid #6b2b2e;
  color: #ff9a9a;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.86rem;
  margin-bottom: 18px;
}
.submit-error strong { display: block; margin-bottom: 2px; }

/* ---------- Botões ---------- */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.actions .btn--primary { flex: 1 1 auto; }
.actions .btn--ghost { flex: 0 0 auto; }

.btn {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 20px;
  cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease), opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-ring); }

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 6px 18px -6px rgba(193, 18, 31, 0.5);
}
.btn--primary:hover { background: linear-gradient(135deg, var(--accent-dark), #6f0a12); }
.btn--primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn--ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--line-strong);
}
.btn--ghost:hover { background: var(--field-bg); color: var(--ink); }

.btn--block { width: 100%; margin-top: 4px; }

/* Spinner no botão de envio */
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.45);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn__label { opacity: 0.85; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tela de sucesso ---------- */
.step--success { text-align: center; }
.success { padding: 20px 6px; }
.success__check { width: 96px; height: 96px; margin: 0 auto 20px; }
.success__svg { width: 100%; height: 100%; }
.success__circle {
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-dasharray: 152;
  stroke-dashoffset: 152;
  animation: drawCircle 0.6s var(--ease) forwards;
}
.success__path {
  stroke: var(--accent);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: drawCheck 0.4s var(--ease) 0.5s forwards;
}
@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawCheck  { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .success__circle, .success__path { animation: none; stroke-dashoffset: 0; }
}
.success__text { color: var(--ink-soft); font-size: 0.95rem; margin: 0 auto 10px; max-width: 40ch; }
.success__text--muted { color: var(--muted); font-size: 0.85rem; }

/* ---------- Responsivo ---------- */
@media (max-width: 420px) {
  .app { padding: 12px 10px 24px; }
  .steps { padding: 18px 14px 20px; }
  .progress { padding: 16px 16px 12px; }
  .welcome__title { font-size: 1.45rem; }
  .choices { flex-wrap: wrap; }
  .choice { min-width: calc(33.333% - 8px); }
}
