/* ─── RESET & BASE ─────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #000000;
    --surface: #111111;
    --surface2: #000000;
    --border: #2a2a2a;
    --border-focus: #4a4a4a;
    --text: #ffffff;
    --text-muted: #B3B3B3;
    --text-dim: #555555;
    --brand: #C9E600;
    /* ← cor da marca */
    --brand-hover: #A3B800;
    --brand-light: #000000;
    --danger: #ff4d4d;
    --radius: 8px;
    --transition: 300ms cubic-bezier(.4, 0, .2, 1);
    --font: 'Inter', sans-serif;

    /* ── COR DO TEXTO DIGITADO / SELECIONADO PELO USUÁRIO ────────────
     Altere este valor para mudar a cor de todos os inputs e opções.
     Exemplos: #ffffff (branco) | #a8e6cf (verde menta) | #f9ca24   */
    --input-text: #ffffff;
}

html,
body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* ─── PROGRESS BAR ──────────────────────────────────────────────── */
#progress-bar-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #1e1e1e;
    z-index: 100;
}

#progress-bar {
    height: 100%;
    background: var(--brand);
    width: 0%;
    transition: width var(--transition);
    border-radius: 0 2px 2px 0;
}

/* "X de Y" — centralizado, substituindo a % */
#progress-label {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: .08em;
    z-index: 101;
    white-space: nowrap;
    pointer-events: none;
}

/* ─── LOGO ──────────────────────────────────────────────────────── */
#logo-wrap {
    position: fixed;
    top: 16px;
    left: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
}

#logo-wrap img {
    height: 28px;
    object-fit: contain;
}

#logo-wrap .logo-text {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text);
}

/* ─── SLIDE CONTAINER ───────────────────────────────────────────── */
#form-root {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 72px 20px 96px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(60px);
    transition: opacity var(--transition), transform var(--transition);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.slide.active {
    opacity: 1;
    pointer-events: all;
    transform: translateX(0);
}

.slide.exit-left {
    opacity: 0;
    transform: translateX(-60px);
    pointer-events: none;
}

.slide.enter-right {
    opacity: 0;
    transform: translateX(60px);
    pointer-events: none;
}

.slide-inner {
    width: 100%;
    max-width: 640px;
}

/* ─── QUESTION TYPOGRAPHY ───────────────────────────────────────── */
.q-label {
    font-size: clamp(20px, 5vw, 30px);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    margin-bottom: 10px;
    letter-spacing: -.025em;
}

.q-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
}

.q-required {
    color: var(--brand);
    margin-left: 3px;
}

/* ─── INPUTS ────────────────────────────────────────────────────── */
.field-wrap {
    position: relative;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--input-text);
    /* ← variável customizável */
    font-family: var(--font);
    font-size: 16px;
    /* 16px evita zoom automático no iOS */
    padding: 14px 16px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    appearance: none;
    -webkit-appearance: none;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-dim);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-light);
}

textarea {
    resize: vertical;
    min-height: 110px;
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(.4);
}

/* ─── VALIDATION ────────────────────────────────────────────────── */
.field-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 6px;
    display: none;
    animation: shake .3s;
}

.field-error.visible {
    display: block;
}

input.invalid,
textarea.invalid,
select.invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(255, 77, 77, .15);
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0)
    }

    25% {
        transform: translateX(-6px)
    }

    75% {
        transform: translateX(6px)
    }
}

/* ─── RADIO / CHECKBOX ──────────────────────────────────────────── */
.choices-grid {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.choice-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .2s, background .2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.choice-item:hover {
    border-color: var(--border-focus);
    background: rgba(201, 230, 0, 0.04);
}

.choice-item.selected {
    border-color: var(--brand);
    background: var(--brand-light);
}

.choice-item input {
    display: none;
}

.choice-marker {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-focus);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s, background .2s;
}

.choice-item.checkbox .choice-marker {
    border-radius: 4px;
}

.choice-item.selected .choice-marker {
    border-color: var(--brand);
    background: var(--brand);
}

.choice-marker::after {
    content: '';
    display: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
}

.choice-item.selected .choice-marker::after {
    display: block;
}

.choice-item.checkbox.selected .choice-marker::after {
    border-radius: 1px;
    width: 5px;
    height: 8px;
    background: transparent;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(40deg) translate(-1px, -2px);
}

.choice-label {
    font-size: 15px;
    color: var(--input-text);
    /* ← cor das respostas */
    opacity: .7;
    transition: opacity .2s;
}

.choice-item.selected .choice-label {
    opacity: 1;
}

/* ─── BUTTON CHOICES ────────────────────────────────────────────── */
.btn-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.btn-choice {
    padding: 10px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface2);
    color: var(--input-text);
    /* ← cor das respostas */
    opacity: .7;
    font-family: var(--font);
    font-size: 14px;
    cursor: pointer;
    transition: all .2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-choice:hover {
    border-color: var(--border-focus);
    opacity: .9;
}

.btn-choice.selected {
    border-color: var(--brand);
    background: var(--brand-light);
    opacity: 1;
}

/* ─── SCALE ─────────────────────────────────────────────────────── */
.scale-wrap {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.scale-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: var(--surface2);
    color: var(--input-text);
    /* ← cor das respostas */
    opacity: .65;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.scale-btn:hover {
    border-color: var(--border-focus);
    opacity: .9;
}

.scale-btn.selected {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
    opacity: 1;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-dim);
}

/* ─── MESSAGE SLIDE ─────────────────────────────────────────────── */
/* Slide sem input — apenas texto/mensagem do responsável           */
.msg-icon {
    font-size: 30px;
    margin-bottom: 18px;
    display: block;
    line-height: 1;
}

.msg-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.msg-title {
    font-size: clamp(20px, 5vw, 30px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.025em;
    margin-bottom: 14px;
}

.msg-body {
    font-size: 15px;
    line-height: 1.75;
    margin-bottom: 20px;
}

.msg-highlight {
    display: block;
    padding: 13px 18px;
    border-left: 3px solid;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 14px;
    line-height: 1.65;
    margin-top: 4px;
}

/* ─── NAVIGATION BUTTONS ────────────────────────────────────────── */
#nav-wrap {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 16px 20px max(24px, env(safe-area-inset-bottom));
    background: linear-gradient(transparent, #000 55%);
    gap: 10px;
    z-index: 50;
}

.btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 13px 26px;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background .2s, transform .15s;
    letter-spacing: -.01em;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-nav:active {
    transform: scale(.97);
}

#btn-next,
#btn-submit {
    background: var(--brand);
    color: #000000;
}

#btn-next:hover,
#btn-submit:hover {
    background: var(--brand-hover);
}

#btn-back {
    background: var(--surface2);
    color: var(--text-muted);
    border: 1.5px solid var(--border);
}

#btn-back:hover {
    color: var(--text);
    border-color: var(--border-focus);
}

#btn-back.hidden,
#btn-submit.hidden,
#btn-next.hidden {
    display: none;
}

.btn-icon {
    font-size: 15px;
}

/* ─── KEYBOARD HINT ─────────────────────────────────────────────── */
#kbd-hint {
    position: fixed;
    bottom: 82px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--text-dim);
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .3s;
}

#kbd-hint.visible {
    opacity: 1;
}

@media (hover: none) {
    #kbd-hint {
        display: none;
    }
}

kbd {
    display: inline-block;
    padding: 1px 5px;
    border: 1px solid #333;
    border-radius: 4px;
    font-family: var(--font);
    font-size: 10px;
    background: #111;
}

/* ─── SUCCESS SCREEN ────────────────────────────────────────────── */
#success-screen {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    z-index: 200;
    animation: fadeIn .5s ease;
}

#success-screen.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.success-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--brand-light);
    border: 2px solid var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 24px;
}

.success-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -.03em;
}

.success-sub {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 360px;
}

/* ─── TOAST ─────────────────────────────────────────────────────── */
#toast {
    position: fixed;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%) translateY(14px);
    background: #1a1a1a;
    border: 1px solid #333;
    color: var(--text-muted);
    padding: 10px 18px;
    border-radius: 100px;
    font-size: 13px;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    pointer-events: none;
    white-space: nowrap;
    z-index: 300;
}

#toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─── WELCOME SLIDE ─────────────────────────────────────────────── */
.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--brand-light);
    border: 1px solid rgba(108, 99, 255, .3);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: var(--brand);
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: 22px;
}

.welcome-title {
    font-size: clamp(26px, 7vw, 44px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.04em;
    margin-bottom: 14px;
}

.welcome-sub {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 32px;
    max-width: 480px;
}

.welcome-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 36px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--text-dim);
}

.meta-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--brand);
    flex-shrink: 0;
}

/* ─── MOBILE RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 480px) {
    .slide {
        padding: 62px 16px 88px;
    }

    .btn-nav {
        padding: 13px 20px;
        font-size: 14px;
    }

    .scale-btn {
        width: 38px;
        height: 38px;
        font-size: 13px;
    }

    .choice-label {
        font-size: 14px;
    }

    .btn-choice {
        font-size: 13px;
        padding: 9px 14px;
    }

    #logo-wrap .logo-text {
        font-size: 13px;
    }

    .welcome-meta {
        gap: 14px;
    }

    .welcome-title {
        letter-spacing: -.03em;
    }
}

@media (max-width: 360px) {
    .scale-btn {
        width: 34px;
        height: 34px;
        font-size: 12px;
    }

    .scale-wrap {
        gap: 5px;
    }

    .btn-choices {
        gap: 7px;
    }

    .btn-choice {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Landscape mobile */
@media (max-height: 500px) {
    .slide {
        justify-content: flex-start;
        padding-top: 54px;
    }

    .q-label {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .q-desc {
        margin-bottom: 14px;
        font-size: 13px;
    }

    textarea {
        min-height: 80px;
    }
}