/* ==========================================================================
   Formulário de pré-inscrição — mesma direção da home (cofre / brasão).
   Assinatura: o progresso é o dente de uma chave que vai se completando.
   ========================================================================== */

:root {
    --obsidian: #0a0806;
    --vault: #100d0a;
    --steel: #171410;
    --plate: #1f1b16;

    --line: rgba(233, 200, 150, 0.10);
    --line-strong: rgba(233, 200, 150, 0.22);

    --brass: #d9a566;
    --brass-hi: #ecc48c;
    --brass-lo: #a87a43;

    --ivory: #f3ece1;
    --bone: #bdb2a1;
    --ash: #8d8372;
    --faint: #5d5548;

    --danger: #e5726a;
    --ok: #8fc39a;

    --font-display: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
    --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --r-sm: 6px;
    --r-md: 10px;
    --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

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

[hidden] { display: none !important; }

body {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    background: var(--obsidian);
    color: var(--ivory);
    min-height: 100svh;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 3px; border-radius: 2px; }

/* ---------- Estrutura ---------- */

.shell {
    min-height: 100svh;
    display: grid;
    grid-template-columns: minmax(340px, 5fr) 7fr;
}

/* Painel da marca */
.brand-panel {
    position: sticky;
    top: 0;
    height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding: 32px 40px 48px;
    background:
        radial-gradient(80% 60% at 50% 55%, rgba(217, 165, 102, 0.14), transparent 70%),
        var(--vault);
    border-right: 1px solid var(--line);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    min-height: 44px;
    color: var(--bone);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.2s var(--ease);
    text-decoration: none;
}
.back-link:hover { color: var(--brass-hi); }
.back-link .icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Recorta só o escudo da arte */
.brand-art {
    flex: 1;
    min-height: 0;
    max-height: 480px;
    aspect-ratio: 1093 / 1439;
    max-width: 100%;
    align-self: center;
}
.brand-art img { width: 100%; height: 100%; object-fit: contain; object-position: center; }

.brand-eyebrow {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brass);
    margin-bottom: 8px;
}
.brand-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    font-weight: 700;
    line-height: 0.95;
    text-transform: uppercase;
    color: var(--brass-hi);
}

/* Coluna do formulário */
.form-wrapper {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 56px 40px 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100svh;
}

/* ---------- Progresso: dente de chave ---------- */

.progress { margin-bottom: 12px; }
.progress-bitting {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 28px;
}
.progress-bitting span {
    flex: 1;
    background: var(--plate);
    border-radius: 2px 2px 0 0;
    transition: background-color 0.3s var(--ease);
}
.progress-bitting span.done { background: var(--brass); }
.progress-bitting span.current { background: var(--brass-hi); }
/* alturas diferentes: o desenho de uma chave */
.progress-bitting span:nth-child(1)  { height: 55%; }
.progress-bitting span:nth-child(2)  { height: 80%; }
.progress-bitting span:nth-child(3)  { height: 40%; }
.progress-bitting span:nth-child(4)  { height: 95%; }
.progress-bitting span:nth-child(5)  { height: 60%; }
.progress-bitting span:nth-child(6)  { height: 30%; }
.progress-bitting span:nth-child(7)  { height: 75%; }
.progress-bitting span:nth-child(8)  { height: 50%; }
.progress-bitting span:nth-child(9)  { height: 90%; }
.progress-bitting span:nth-child(10) { height: 65%; }
.progress-bitting span:nth-child(11) { height: 85%; }

.step-counter {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ash);
    margin-bottom: 40px;
    font-variant-numeric: tabular-nums;
}

/* ---------- Etapas ---------- */

.form-page { display: none; }
.form-page.active { display: block; animation: stepIn 0.35s var(--ease); }
.form-page.leaving { animation: stepOut 0.15s var(--ease) forwards; }

@keyframes stepIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes stepOut { to { opacity: 0; transform: translateX(-12px); } }

.page-title {
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    color: var(--ivory);
    margin-bottom: 12px;
}
.page-subtitle { color: var(--bone); margin-bottom: 40px; }

.form-group { margin-bottom: 24px; }

.form-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--bone);
    margin-bottom: 8px;
}
/* Pergunta de etapa única: vira o título da etapa */
.form-question {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: 0.005em;
    color: var(--ivory);
    margin-bottom: 12px;
    text-wrap: balance;
}
.req { color: var(--brass); }

.form-help { font-size: 0.9375rem; color: var(--ash); margin-bottom: 20px; max-width: 34em; }

/* Campos: levemente mais escuros que o entorno (inset) */
.form-input {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    background: var(--obsidian);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    color: var(--ivory);
    font: inherit;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
    outline: none;
}
.form-input::placeholder { color: var(--faint); }
.form-input:hover { border-color: rgba(233, 200, 150, 0.34); }
.form-input:focus { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(217, 165, 102, 0.18); }
.form-input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(229, 114, 106, 0.16); }

.form-select {
    appearance: none;
    cursor: pointer;
    padding-right: 48px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23d9a566' stroke-width='2' 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 16px center;
}
.form-select option { background: var(--steel); color: var(--ivory); }

.form-textarea { resize: vertical; min-height: 160px; line-height: 1.55; }

/* ---------- Introdução e escolhas ---------- */

.page-eyebrow {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brass);
    margin-bottom: 12px;
}

.intro { margin-bottom: 40px; max-width: 34em; }
.intro p { color: var(--bone); font-size: 0.9375rem; }
.intro p + p { margin-top: 12px; }
.intro .intro-lead { color: var(--ivory); font-size: 1.1875rem; font-weight: 500; }

.opt { color: var(--ash); font-weight: 400; }

fieldset { border: 0; min-width: 0; }
legend.form-question { padding: 0; width: 100%; }

.choices { display: grid; gap: 8px; }

.choice { display: block; cursor: pointer; }
.choice input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.choice-body {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 56px;
    justify-content: center;
    padding: 14px 16px 14px 52px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--obsidian);
    transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
/* seletor circular */
.choice-body::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border-radius: 50%;
    border: 1.5px solid var(--faint);
    transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.choice:hover .choice-body { border-color: rgba(233, 200, 150, 0.4); }
.choice input:focus-visible + .choice-body { outline: 2px solid var(--brass-hi); outline-offset: 2px; }
.choice input:checked + .choice-body { border-color: var(--brass); background: var(--steel); }
.choice input:checked + .choice-body::before {
    border-color: var(--brass);
    background: var(--brass);
    box-shadow: inset 0 0 0 3px var(--steel);
}
.choice-title { font-size: 1rem; font-weight: 500; color: var(--ivory); line-height: 1.4; }
.choice-desc { font-size: 0.875rem; color: var(--ash); line-height: 1.45; }
.choice input:checked + .choice-body .choice-desc { color: var(--bone); }

.choice-group.invalid .choice-body { border-color: var(--danger); }

/* ---------- Botões ---------- */

.form-actions { display: flex; gap: 12px; margin-top: 32px; }

.btn-continue,
.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 28px;
    border-radius: var(--r-sm);
    font-family: var(--font-display);
    font-size: 1.1875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.16s var(--ease);
}
.btn-continue:active, .btn-back:active { transform: scale(0.97); }

.btn-continue { flex: 1; background: var(--brass); color: var(--obsidian); }
.btn-continue:hover { background: var(--brass-hi); }
.btn-continue:disabled { opacity: 0.55; cursor: progress; transform: none; }

.btn-back { background: transparent; color: var(--ivory); border-color: var(--line-strong); }
.btn-back:hover { border-color: var(--brass); color: var(--brass-hi); }

/* ---------- Termos ---------- */

.termos-content {
    max-height: 320px;
    overflow-y: auto;
    padding: 24px;
    margin-bottom: 20px;
    background: var(--obsidian);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}
.termos-text h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brass);
    margin: 24px 0 8px;
}
.termos-text h3:first-child { margin-top: 0; }
.termos-text p, .termos-text li { color: var(--bone); font-size: 0.9375rem; }
.termos-text ul { margin: 8px 0 0 20px; }
.termos-text li + li { margin-top: 4px; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 56px;
    padding: 12px 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.checkbox-label:hover { border-color: var(--brass); }
.checkbox-label.invalid { border-color: var(--danger); }
.checkbox-label input { width: 22px; height: 22px; flex: none; accent-color: var(--brass); cursor: pointer; }
.checkbox-label span { font-size: 0.9375rem; }

/* ---------- Mensagem ---------- */

.mensagem {
    display: none;
    margin-top: 24px;
    padding: 14px 16px;
    border-radius: var(--r-sm);
    border: 1px solid;
    font-size: 0.9375rem;
    font-weight: 500;
}
.mensagem.success { display: block; color: var(--ok); border-color: rgba(143, 195, 154, 0.4); background: rgba(143, 195, 154, 0.08); }
.mensagem.error   { display: block; color: var(--danger); border-color: rgba(229, 114, 106, 0.45); background: rgba(229, 114, 106, 0.08); }

/* ---------- Agradecimento ---------- */

.thank-you {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(50% 50% at 50% 45%, rgba(217, 165, 102, 0.16), transparent 70%),
        var(--obsidian);
    overflow-y: auto;
}
.thank-you-content { text-align: center; max-width: 560px; animation: stepIn 0.5s var(--ease); }

.thank-you-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--brass);
    color: var(--brass-hi);
}
.thank-you-icon svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.thank-you-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 7vw, 3.75rem);
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    color: var(--brass-hi);
    margin-bottom: 20px;
}
.thank-you-message { font-size: 1.0625rem; color: var(--bone); margin-bottom: 24px; }
.thank-you-submessage { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--brass); margin-bottom: 40px; text-wrap: balance; }
.thank-you-link { padding: 0 32px; }

/* ---------- Responsivo ---------- */

@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }

    .brand-panel {
        position: static;
        height: auto;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        padding: 12px 20px;
        gap: 16px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .brand-art { display: none; }
    .brand-copy { order: -1; flex: 1; }
    .brand-eyebrow { display: none; }
    .brand-title { font-size: 1.5rem; line-height: 1; }
    .brand-title br { display: none; }

    .form-wrapper { min-height: 0; padding: 32px 20px 56px; justify-content: flex-start; }
    .step-counter { margin-bottom: 28px; }
}

@media (max-width: 480px) {
    .form-actions { flex-direction: column-reverse; }
    .btn-back, .btn-continue { width: 100%; }
    .termos-content { padding: 16px; max-height: 260px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
