/* ============================================
   TRINITY — FORMULÁRIO DE BOAS-VINDAS
   Paleta extraída da logo (assets/trinity-logo.jpg): dourado sobre preto,
   prata como secundária.
   ============================================ */

:root {
    --bg: #070707;
    --surface: #2F281E;
    --surface-hover: #3A3226;
    --border: rgba(221, 180, 101, 0.42);
    --border-strong: rgba(221, 180, 101, 0.58);

    --brand: #DDB465;
    --brand-soft: #F5D489;
    --brand-deep: #9E7431;
    --brand-glow: rgba(221, 180, 101, 0.28);
    --silver: #A7A39F;

    --text: #F5F2EA;
    --text-muted: #B3ADA2;
    --danger: #FF8F7E;

    --radius: 14px;
    --radius-lg: 22px;
    --max-width: 640px;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding: 0 20px 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Brilho de fundo */
body::before {
    content: '';
    position: fixed;
    inset: -30% 0 auto 50%;
    transform: translateX(-50%);
    width: min(900px, 130vw);
    height: 520px;
    background: radial-gradient(ellipse at top, var(--brand-glow) 0%, transparent 70%);
    opacity: 0.28;
    pointer-events: none;
    z-index: 0;
}

/* ─── Barra de progresso ─────────────────────────────────────────── */

.progress-bar {
    visibility: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    z-index: 100;
}

body.form-started .progress-bar {
    visibility: visible;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--brand), var(--brand-soft));
    box-shadow: 0 0 16px var(--brand-glow);
    transition: width 0.4s ease;
}

/* ─── Container ──────────────────────────────────────────────────── */

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--max-width);
    padding: 48px 0;
}

/* ─── Logo ───────────────────────────────────────────────────────── */

.brand-logo {
    display: block;
    width: 104px;
    height: auto;
    margin: 0 auto 24px;
    border-radius: 16px;
}

@media (max-width: 520px) {
    .brand-logo {
        width: 84px;
    }
}

/* ─── Tela de abertura ───────────────────────────────────────────── */

.intro-screen {
    display: none;
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

.intro-screen.active {
    display: block;
}

.intro-badge {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--brand-soft);
    margin-bottom: 28px;
}

.intro-screen h1 {
    font-size: clamp(2rem, 7vw, 3.2rem);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 28px;
}

.intro-screen h1 .highlight {
    background: linear-gradient(90deg, var(--brand-deep), var(--brand-soft) 50%, var(--brand));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.intro-screen p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 20px;
}

.intro-screen p:last-of-type {
    margin-bottom: 36px;
}

/* ─── Formulário ─────────────────────────────────────────────────── */

.form-wrapper {
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.form-wrapper.active {
    display: block;
}

.step-indicator {
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.form-section {
    display: none;
}

.form-section.active {
    display: block;
    animation: fadeInUp 0.4s ease-out;
}

.question-number {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--brand-soft);
    margin-bottom: 10px;
}

.question-label {
    display: block;
    font-size: clamp(1.35rem, 4.5vw, 1.9rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}

.label-note {
    display: block;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 20px;
}

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

.form-group > .question-label + input,
.form-group > .question-label + textarea,
.label-note + input,
.label-note + textarea {
    margin-top: 12px;
}

input[type="text"],
input[type="tel"],
input[type="email"],
textarea {
    width: 100%;
    padding: 16px 18px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

textarea {
    min-height: 130px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #BDB5A6;
}

input:focus,
textarea:focus {
    outline: none;
    background: var(--surface-hover);
    border-color: var(--brand-soft);
    box-shadow: 0 0 0 3px var(--brand-glow), inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Segunda pergunta dentro da mesma etapa */
.question-label-sub {
    font-size: clamp(1.05rem, 3.2vw, 1.3rem);
    margin-top: 4px;
}

.email-suggestion {
    display: none;
    margin-top: 10px;
    font-size: 0.875rem;
    color: var(--brand-soft);
}

.email-suggestion.show {
    display: block;
}

.email-suggestion button {
    font: inherit;
    color: var(--brand-soft);
    background: none;
    border: none;
    padding: 0;
    text-decoration: underline;
    cursor: pointer;
}

/* ─── Escolha única ──────────────────────────────────────────────── */

.radio-group {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.radio-option {
    position: relative;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.radio-option label {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option label::before {
    content: '';
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    transition: all 0.2s;
}

.radio-option label:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

.radio-option input[type="radio"]:focus-visible + label {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.radio-option.selected label,
.radio-option input[type="radio"]:checked + label {
    background: rgba(221, 180, 101, 0.10);
    border-color: var(--brand);
}

.radio-option.selected label::before,
.radio-option input[type="radio"]:checked + label::before {
    border-color: var(--brand);
    background: var(--brand);
    box-shadow: inset 0 0 0 4px var(--bg);
}

/* ─── Erros ──────────────────────────────────────────────────────── */

.error-message {
    display: none;
    margin-top: 10px;
    font-size: 0.875rem;
    color: var(--danger);
}

.form-group.error .error-message {
    display: block;
}

.form-group.error input,
.form-group.error textarea {
    border-color: var(--danger);
}

.form-group.error .radio-option label {
    border-color: rgba(255, 143, 126, 0.55);
}

.submit-error {
    display: none;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: rgba(255, 143, 126, 0.12);
    border: 1px solid rgba(255, 143, 126, 0.4);
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: #FFC9C9;
}

.submit-error.show {
    display: block;
}

/* ─── Botões ─────────────────────────────────────────────────────── */

.form-navigation {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0A0A0A;
    background: linear-gradient(100deg, var(--brand), var(--brand-soft) 55%, var(--brand));
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px var(--brand-glow);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-lg {
    padding: 18px 40px;
    font-size: 1rem;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text);
    padding: 16px 20px;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--surface-hover);
    color: var(--text);
    box-shadow: none;
    transform: none;
}

.btn-next {
    margin-left: auto;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(10, 10, 10, 0.3);
    border-top-color: #0A0A0A;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ─── Notificação de progresso salvo ─────────────────────────────── */

.saved-progress-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(20, 22, 30, 0.95);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--text-muted);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 200;
}

.saved-progress-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Rodapé de privacidade ──────────────────────────────────────── */

.privacy-notice {
    margin-top: 32px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.privacy-notice a {
    color: var(--brand-soft);
}

/* ─── Honeypot ───────────────────────────────────────────────────── */

input.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

/* ─── intl-tel-input (tema escuro) ───────────────────────────────── */

.iti {
    width: 100%;
}

.iti__country-list {
    background: #14161E;
    color: var(--text);
    border: 1px solid var(--border-strong);
}

.iti__country.iti__highlight {
    background: rgba(221, 180, 101, 0.18);
}

.iti__divider {
    border-color: var(--border);
}

.iti--separate-dial-code .iti__selected-flag {
    background: transparent;
    border-radius: var(--radius) 0 0 var(--radius);
}

/* ─── Animações ──────────────────────────────────────────────────── */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

/* ─── Mobile ─────────────────────────────────────────────────────── */

@media (max-width: 520px) {
    body {
        padding: 0 16px 40px;
        align-items: flex-start;
    }

    .container {
        padding: 24px 0;
    }

    .form-navigation {
        flex-wrap: wrap;
    }

    .btn {
        flex: 1;
        min-width: 140px;
    }

    /* Abertura compacta: em tela de 640px de altura o CTA caía abaixo da dobra */
    .brand-logo {
        width: 68px;
        margin-bottom: 18px;
    }

    .intro-badge {
        margin-bottom: 16px;
    }

    .intro-screen h1 {
        margin-bottom: 18px;
    }

    .intro-screen p {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    .intro-screen p:last-of-type {
        margin-bottom: 24px;
    }

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