/* ============================================================
   BeautyBroker Quiz — Typeform-Style Single Stylesheet
   ============================================================ */

/* --- Brand Tokens ------------------------------------------ */
:root {
    --bb-blue: #1a6fb5;
    --bb-blue-dark: #155a94;
    --bb-blue-light: #e8f2fa;
    --bb-blue-wash: #f4f9fd;
    --bb-gold: #f59e0b;
    --bb-gold-light: #fef9ee;
    --bb-ink: #1a2332;
    --bb-muted: #5a6a7a;
    --bb-hint: #8a9bab;
    --bb-border: #c8d6e0;
    --bb-green: #059669;
    --bb-red: #dc2626;
}

/* --- Reset & Base ------------------------------------------ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    color: var(--bb-ink);
    background: #fff;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* --- Intro Screen (show-intro mode) ------------------------ */
body.show-intro .progress-track,
body.show-intro .site-header,
body.show-intro .quiz-viewport {
    display: none;
}

.intro-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 0;
    background: var(--bb-blue-wash);
    text-align: center;
}

/* --- Logo Top Bar ----------------------------------------- */
.intro-topbar {
    width: 100%;
    background: var(--bb-ink);
    display: flex;
    justify-content: center;
    padding: 0;
}

body.show-intro .intro-screen {
    display: flex;
}

.intro-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 480px;
    padding: 0 24px 48px;
}

.intro-logo {
    height: 120px;
    width: auto;
    margin-bottom: 32px;
}

.intro-topbar .intro-logo--sm {
    height: 200px;
    object-fit: contain;
    margin: -24px 0;
}

.intro-logo--circle {
    height: 120px;
    width: 120px;
    object-fit: contain;
    border-radius: 50%;
    background: var(--bb-blue-light);
    padding: 20px;
    margin-bottom: 32px;
}

.intro-headline {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--bb-ink);
    margin-bottom: 12px;
}

.intro-sub {
    font-size: 1rem;
    color: var(--bb-muted);
    line-height: 1.6;
    margin-bottom: 28px;
}

.intro-bullets {
    list-style: none;
    text-align: left;
    margin-bottom: 32px;
}

.intro-bullets li {
    position: relative;
    padding-left: 20px;
    font-size: 0.9375rem;
    color: var(--bb-ink);
    line-height: 1.7;
}

.intro-bullets li::before {
    content: "\25CF";
    position: absolute;
    left: 0;
    color: var(--bb-blue);
    font-size: 0.5rem;
    top: 0.55em;
}

.intro-cta {
    display: block;
    width: 100%;
    padding: 16px 28px;
    font-family: inherit;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #fff;
    background: var(--bb-blue);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 16px;
}

.intro-cta:hover {
    background: var(--bb-blue-dark);
}

.intro-cta:focus-visible {
    outline: 2px solid var(--bb-blue-dark);
    outline-offset: 2px;
}

.intro-trust {
    font-size: 0.8125rem;
    color: var(--bb-hint);
}

/* --- Stats Row --------------------------------------------- */
.intro-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--bb-border);
    border: 1px solid var(--bb-border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
}

.intro-stat {
    background: #fff;
    padding: 16px 8px;
    text-align: center;
}

.intro-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bb-blue);
    line-height: 1.2;
}

.intro-stat-label {
    font-size: 0.75rem;
    color: var(--bb-muted);
    margin-top: 2px;
}

/* --- Urgency Nudge ----------------------------------------- */
.intro-urgency {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--bb-muted);
    margin-bottom: 20px;
}

.intro-urgency-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bb-gold);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* --- Trust Grid -------------------------------------------- */
.intro-trust-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 16px;
}

.intro-trust-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--bb-hint);
}

.intro-trust-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* --- Testimonial ------------------------------------------- */
.intro-testimonial {
    position: relative;
    font-size: 1.125rem;
    font-style: italic;
    color: var(--bb-ink);
    line-height: 1.6;
    margin-bottom: 8px;
    padding: 0 8px;
}

.intro-testimonial::before {
    content: "\201C";
    position: absolute;
    left: -8px;
    top: -8px;
    font-size: 3rem;
    color: var(--bb-blue-light);
    font-style: normal;
    line-height: 1;
}

.intro-attribution {
    font-size: 0.875rem;
    font-style: normal;
    color: var(--bb-muted);
    margin-bottom: 28px;
}

.intro-attribution .stars {
    color: var(--bb-gold);
}

/* --- Numbered Steps ---------------------------------------- */
.intro-steps {
    list-style: none;
    text-align: left;
    margin-bottom: 28px;
}

.intro-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9375rem;
    color: var(--bb-ink);
    line-height: 1.5;
    margin-bottom: 12px;
}

.intro-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #fff;
    background: var(--bb-blue);
    border-radius: 50%;
}

/* --- Savings Callout --------------------------------------- */
.intro-callout {
    text-align: left;
    font-size: 0.9375rem;
    color: var(--bb-muted);
    line-height: 1.6;
    padding: 14px 18px;
    border-left: 3px solid var(--bb-blue);
    background: var(--bb-blue-wash);
    border-radius: 0 8px 8px 0;
    margin-bottom: 28px;
}

/* --- Progress Bar (fixed top) ------------------------------ */
.progress-track {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--bb-blue-light);
    box-shadow: inset 0 -1px 0 rgba(26, 35, 50, 0.06);
    z-index: 100;
}

.progress-bar {
    position: relative;
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(
        90deg,
        var(--bb-blue-dark) 0%,
        var(--bb-blue) 100%
    );
    border-radius: 0 999px 999px 0;
    box-shadow: 0 0 12px rgba(26, 111, 181, 0.5);
    transition: width 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.progress-bar::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40%;
    max-width: 160px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.35) 70%,
        rgba(255, 255, 255, 0.6) 100%
    );
    border-radius: inherit;
    pointer-events: none;
}

/* --- Site Header ------------------------------------------- */
.site-header {
    position: fixed;
    top: 8px;
    left: 0;
    right: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--bb-ink);
}

.site-logo {
    height: 200px;
    width: auto;
    object-fit: contain;
    margin: -24px 0;
}

.step-counter {
    position: absolute;
    right: 20px;
    bottom: 10px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
    letter-spacing: 0.01em;
}

/* hidden element for app.js mock-mode prompt */
.step-prompt {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* --- Quiz Viewport (full-screen centered) ------------------ */
.quiz-viewport {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 180px 24px 40px;
}

/* --- Form Shell -------------------------------------------- */
.quiz-form {
    width: 100%;
    max-width: 520px;
}

.hidden-state {
    display: none;
}

.honeypot-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* --- Question Panel (generated by app.js) ------------------- */
.question-panel {
    animation: fadeUp 0.3s ease both;
}

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

.question-tag {
    display: none;
}

.question-title {
    font-size: 1.625rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--bb-ink);
    margin-bottom: 6px;
}

.question-helper {
    font-size: 0.9375rem;
    color: var(--bb-muted);
    margin-bottom: 28px;
}

/* --- Option Grid (choice steps) ----------------------------- */
.option-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    counter-reset: option-letter;
}

.option-card {
    counter-increment: option-letter;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 18px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--bb-ink);
    background: #fff;
    border: 1.5px solid var(--bb-border);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
}

.option-card::before {
    content: counter(option-letter, upper-alpha);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bb-muted);
    border: 1.5px solid var(--bb-border);
    border-radius: 6px;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.option-card:hover {
    border-color: var(--bb-blue);
}

.option-card:hover::before {
    border-color: var(--bb-blue);
    color: var(--bb-blue);
}

.option-card:focus-visible {
    outline: 2px solid var(--bb-blue);
    outline-offset: 2px;
}

.option-card.is-selected {
    border-color: var(--bb-blue);
    background: var(--bb-blue-light);
}

.option-card.is-selected::before {
    background: var(--bb-blue);
    border-color: var(--bb-blue);
    color: #fff;
}

.step-note {
    margin-top: 16px;
    font-size: 0.8125rem;
    color: var(--bb-hint);
}

/* --- Input Fields (underline style) ------------------------- */
.field-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-control {
    width: 100%;
    padding: 10px 0;
    font-family: inherit;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--bb-ink);
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--bb-border);
    border-radius: 0;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.field-control::placeholder {
    color: var(--bb-hint);
    font-weight: 400;
}

.field-control:focus {
    border-bottom-color: var(--bb-blue);
}

.field-control--textarea {
    resize: vertical;
    min-height: 120px;
    border: 1.5px solid var(--bb-border);
    border-radius: 8px;
    padding: 14px 16px;
}

.field-control--textarea:focus {
    border-color: var(--bb-blue);
}

.helper-caption {
    font-size: 0.8125rem;
    color: var(--bb-hint);
}

.skip-link {
    display: block;
    margin: 18px auto 0;
    padding: 10px 20px;
    background: none;
    border: 1.5px dashed var(--bb-border);
    border-radius: 8px;
    color: var(--bb-muted);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.skip-link:hover {
    color: var(--bb-blue);
    border-color: var(--bb-blue);
}

/* intl-tel-input wrapper integration: match the bottom-border input style */
.iti {
    display: block;
    width: 100%;
}

.iti--inline-dropdown .iti__dropdown-content {
    border-radius: 8px;
}

/* --- Feedback / Validation ---------------------------------- */
.feedback {
    margin-top: 12px;
    padding: 10px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bb-red);
    background: #fef2f2;
    border-radius: 6px;
}

/* --- Navigation Row ----------------------------------------- */
.navigation-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
}

.nav-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 28px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.nav-button--back {
    padding: 12px 16px;
    color: var(--bb-muted);
    background: transparent;
}

.nav-button--back:hover {
    color: var(--bb-ink);
    background: #f3f4f6;
}

.nav-button--back svg {
    width: 18px;
    height: 18px;
}

.nav-button--primary {
    color: #fff;
    background: var(--bb-blue);
}

.nav-button--primary:hover {
    background: var(--bb-blue-dark);
}

.nav-button--primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-button:focus-visible {
    outline: 2px solid var(--bb-blue);
    outline-offset: 2px;
}

/* --- Success Panel ------------------------------------------ */
.success-panel {
    width: 100%;
    max-width: 480px;
    text-align: center;
    animation: fadeUp 0.4s ease both;
}

.success-icon {
    margin-bottom: 20px;
}

.success-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--bb-ink);
    margin-bottom: 8px;
}

.success-lead {
    font-size: 1rem;
    color: var(--bb-muted);
    line-height: 1.6;
    margin-bottom: 28px;
}

.success-next-heading {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bb-ink);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 16px;
}

.success-steps {
    list-style: none;
    text-align: left;
    margin-bottom: 24px;
}

.success-steps li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    font-size: 0.9375rem;
    color: var(--bb-ink);
    line-height: 1.5;
}

.success-steps li + li {
    border-top: 1px solid var(--bb-blue-light);
}

.success-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--bb-blue);
    background: var(--bb-blue-light);
    border-radius: 50%;
}

.success-runtime-note {
    font-size: 0.8125rem;
    color: var(--bb-hint);
    padding: 10px 14px;
    background: var(--bb-blue-wash);
    border-radius: 6px;
}

/* --- Mobile (<=600px) --------------------------------------- */
@media (max-width: 600px) {
    .site-header {
        padding: 0;
    }

    .site-logo {
        height: 120px;
    }

    .step-counter {
        right: 12px;
        bottom: 6px;
        font-size: 0.75rem;
    }

    .quiz-viewport {
        padding: 110px 20px 32px;
    }

    .question-title {
        font-size: 1.375rem;
    }

    .option-card {
        padding: 12px 14px;
        font-size: 0.875rem;
    }

    .option-card::before {
        width: 24px;
        height: 24px;
        font-size: 0.6875rem;
    }

    .field-control {
        font-size: 1rem;
    }

    .nav-button:not(.nav-button--back) {
        padding: 11px 22px;
    }

    .nav-button {
        font-size: 0.875rem;
    }

    .success-title {
        font-size: 1.5rem;
    }

    /* Intro mobile */
    .intro-topbar {
        padding: 0;
    }

    .intro-topbar .intro-logo--sm {
        height: 120px;
    }

    .intro-inner {
        justify-content: flex-start;
        padding: 24px 20px 32px;
    }

    .intro-headline {
        font-size: 1.5rem;
    }

    .intro-logo {
        height: 96px;
    }

    .intro-stats {
        gap: 1px;
    }

    .intro-stat-value {
        font-size: 1.25rem;
    }

    .intro-testimonial {
        font-size: 1rem;
    }
}
