:root {
    --primary: #1a1a2e;
    --accent: #e94560;
    --secondary: #0f3460;
    --text: #ffffff;
    --muted: rgba(255, 255, 255, 0.72);
    --panel: rgba(255, 255, 255, 0.07);
    --panel-strong: rgba(255, 255, 255, 0.12);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    font-family: "Poppins", Arial, sans-serif;
    color: var(--text);
    background: #0b1020;
    overflow-x: hidden;
}

button,
input,
select {
    font: inherit;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.quiz-page {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    grid-template-columns: minmax(0, 640px);
    gap: clamp(10px, 2vw, 18px);
    align-content: center;
    align-items: start;
    justify-content: center;
    padding: clamp(14px, 3vw, 34px) clamp(12px, 5vw, 64px) calc(clamp(14px, 3vw, 34px) + env(safe-area-inset-bottom));
    overflow-x: hidden;
}

.quiz-page::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -3;
    background: url("../img/hero-showroom.jpg") center / cover no-repeat;
}

.quiz-page::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(90deg, rgba(10, 14, 28, 0.94) 0%, rgba(10, 14, 28, 0.78) 43%, rgba(10, 14, 28, 0.50) 100%),
        linear-gradient(180deg, rgba(10, 14, 28, 0.28) 0%, rgba(10, 14, 28, 0.82) 100%);
}

.hero-copy {
    width: min(100%, 660px);
    justify-self: center;
    text-align: center;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin: 0 0 18px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
    font-weight: 600;
}

.hero-title {
    max-width: 620px;
    margin-inline: auto;
    margin: 0;
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    line-height: 1.08;
    letter-spacing: 0;
}

.hero-text {
    max-width: 520px;
    margin: 8px 0 0;
    margin-inline: auto;
    color: rgba(255, 255, 255, 0.76);
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    line-height: 1.45;
}

.hero-highlights {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.hero-highlights span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.84);
    background: rgba(15, 52, 96, 0.42);
    font-size: 0.8rem;
    font-weight: 600;
}

.quiz-shell {
    width: min(100%, 560px);
    justify-self: center;
}

.brand {
    display: grid;
    justify-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.hero-brand {
    margin-bottom: 4px;
}

.brand-logo {
    width: 92px;
    max-height: 92px;
    object-fit: contain;
}

.brand-logo[src$=".png"]:not([src=""]) + .brand-fallback {
    margin-top: -6px;
}

.brand-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 600;
}

.progress-wrap {
    margin-bottom: 8px;
}

.progress-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.86rem;
    margin-bottom: 8px;
}

.progress-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
}

.progress-bar {
    width: 12%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 300ms ease;
}

.quiz-card,
.thanks-card {
    position: relative;
    overflow: hidden;
    min-height: 320px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: var(--panel);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
}

.step {
    display: none;
    animation: stepIn 280ms ease both;
}

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

@keyframes stepIn {
    from {
        opacity: 0;
        transform: translateX(18px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
}

h2,
.thanks-card h1 {
    margin: 0 0 14px;
    font-size: 1.42rem;
    line-height: 1.2;
    letter-spacing: 0;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.field-grid {
    display: grid;
    gap: 14px;
}

input,
select {
    width: 100%;
    min-height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    outline: none;
    padding: 0 15px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.09);
    transition: border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

select option {
    color: #111827;
}

input:focus,
select:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.13);
    box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.16);
}

.helper {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.error-message,
.submit-error {
    min-height: 18px;
    margin: 8px 0;
    color: #ffb4c0;
    font-size: 0.9rem;
}

.primary-btn,
.ghost-btn,
.option-btn,
.skip-btn {
    cursor: pointer;
    border: 0;
    min-height: 50px;
    border-radius: 12px;
    padding: 8px 14px;
    line-height: 1.2;
    transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.primary-btn {
    width: 100%;
    margin-top: 6px;
    color: var(--text);
    background: var(--accent);
    box-shadow: 0 14px 26px rgba(233, 69, 96, 0.24);
    font-weight: 600;
}

.primary-btn:hover,
.option-btn:hover {
    transform: translateY(-1px);
}

.primary-btn:hover {
    background: #d83a55;
}

.primary-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

.ghost-btn {
    width: 100%;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
}

.actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 8px;
}

.option-grid,
.option-stack {
    display: grid;
    gap: 8px;
}

.option-grid {
    grid-template-columns: 1fr;
}

.option-btn {
    width: 100%;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: var(--panel-strong);
    font-weight: 600;
    text-align: center;
    white-space: normal;
}

.option-btn.is-selected {
    border-color: var(--accent);
    background: rgba(233, 69, 96, 0.24);
}

.skip-btn {
    display: block;
    min-height: 34px;
    margin: 10px auto 0;
    color: var(--muted);
    background: transparent;
    font-weight: 600;
}

.skip-btn:hover {
    color: var(--text);
}

.trade-field {
    display: none;
    margin-top: 12px;
}

.trade-field.is-visible {
    display: grid;
    gap: 10px;
}

.loading-panel {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    background: rgba(26, 26, 46, 0.88);
    text-align: center;
    z-index: 4;
}

.loading-panel.is-visible {
    display: flex;
}

.spinner {
    width: 46px;
    height: 46px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
}

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

.thanks-card {
    width: min(100%, 560px);
    min-height: auto;
    text-align: center;
}

.thanks-page {
    grid-template-columns: 1fr;
}

.thanks-page .thanks-card {
    justify-self: center;
}

.thanks-card p {
    margin: 0 0 22px;
    color: var(--muted);
}

.whatsapp-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.site-link {
    display: inline-block;
    margin-top: 18px;
    color: var(--text);
    text-decoration: none;
    opacity: 0.8;
}

@media (min-width: 560px) {
    .quiz-card,
    .thanks-card {
        padding: 24px;
    }

    .field-grid,
    .option-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .primary-btn {
        grid-column: auto;
    }
}

@media (max-width: 980px) {
    .quiz-page {
        grid-template-columns: minmax(0, 640px);
        align-content: start;
        padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
    }

    .quiz-page::after {
        background:
            linear-gradient(180deg, rgba(10, 14, 28, 0.92) 0%, rgba(10, 14, 28, 0.80) 48%, rgba(10, 14, 28, 0.92) 100%);
    }

    .hero-title {
        font-size: clamp(1.25rem, 4.5vw, 1.6rem);
    }
}

@media (max-width: 420px) {
    .quiz-page {
        align-items: flex-start;
        gap: 8px;
        padding: 8px 10px calc(12px + env(safe-area-inset-bottom));
    }

    .hero-title {
        font-size: 1.04rem;
        line-height: 1.14;
    }

    .hero-text {
        margin-top: 5px;
        font-size: 0.78rem;
        line-height: 1.3;
    }

    .hero-highlights {
        justify-content: center;
        gap: 6px;
        margin-top: 8px;
    }

    .hero-highlights span {
        min-height: 28px;
        padding: 0 8px;
        font-size: 0.68rem;
    }

    .brand {
        margin-bottom: 8px;
    }

    .hero-brand {
        margin-bottom: 2px;
    }

    .brand-logo {
        width: 62px;
        max-height: 62px;
    }

    .quiz-card,
    .thanks-card {
        min-height: auto;
        padding: 14px;
        border-radius: 14px;
    }

    h2,
    .thanks-card h1 {
        margin-bottom: 10px;
        font-size: 1.1rem;
    }

    .eyebrow {
        margin-bottom: 6px;
        font-size: 0.72rem;
    }

    .field-grid,
    .option-grid,
    .option-stack {
        gap: 8px;
    }

    .helper {
        margin-top: 6px;
        font-size: 0.76rem;
        line-height: 1.35;
    }

    .error-message,
    .submit-error {
        min-height: 14px;
        margin: 6px 0;
        font-size: 0.78rem;
    }

    input,
    select,
    .primary-btn,
    .ghost-btn,
    .option-btn {
        min-height: 44px;
    }
}

@media (max-height: 740px) {
    .quiz-page {
        align-content: start;
        gap: 7px;
        padding-top: 7px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }

    .brand-logo {
        width: 58px;
        max-height: 58px;
    }

    .hero-title {
        font-size: 1rem;
        line-height: 1.14;
    }

    .hero-text {
        margin-top: 4px;
        font-size: 0.76rem;
        line-height: 1.28;
    }

    .hero-highlights {
        gap: 5px;
        margin-top: 6px;
    }

    .hero-highlights span {
        min-height: 26px;
        padding: 0 8px;
        font-size: 0.66rem;
    }

    .progress-wrap {
        margin-bottom: 5px;
    }

    .progress-copy {
        margin-bottom: 5px;
        font-size: 0.76rem;
    }

    .progress-track {
        height: 6px;
    }

    .quiz-card,
    .thanks-card {
        min-height: auto;
        padding: 12px;
    }

    h2,
    .thanks-card h1 {
        margin-bottom: 10px;
        font-size: 1.16rem;
    }

    .eyebrow,
    label,
    .helper,
    .error-message,
    .submit-error {
        font-size: 0.78rem;
    }

    input,
    select,
    .primary-btn,
    .ghost-btn,
    .option-btn {
        min-height: 42px;
    }
}

@media (max-width: 360px) {
    .quiz-page {
        padding-left: 8px;
        padding-right: 8px;
    }

    .hero-title {
        font-size: 0.96rem;
    }

    .hero-text {
        font-size: 0.72rem;
    }

    .brand-logo {
        width: 54px;
        max-height: 54px;
    }

    .hero-highlights span {
        padding: 0 6px;
        font-size: 0.62rem;
    }

    h2,
    .thanks-card h1 {
        font-size: 1.02rem;
    }
}
