/* ===================================
   LUMIRA QUIZ OG — Dark theme, matched to lumira-app.com
   =================================== */

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

:root {
    --primary:       #A78BFA;
    --primary-dark:  #7C3AED;
    --primary-light: #C4B5FD;
    --accent:        #C4B5FD;

    --text-dark:    #FFFFFF;
    --text-medium:  #A99FC8;
    --text-light:   #6C5F90;

    --bg:           #08041A;
    --bg-2:         #110827;
    --bg-3:         #1A0E3A;
    --bg-surface:   #25144C;
    --white:        #110827;

    --line:         rgba(167, 139, 250, 0.14);
    --line-strong:  rgba(167, 139, 250, 0.30);

    --bg-gradient-start: #08041A;
    --bg-gradient-end:   #110827;
}

html { background: var(--bg); }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(ellipse 60% 40% at 30% 10%, rgba(167, 139, 250, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 85% 90%, rgba(167, 139, 250, 0.10) 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    padding: 0;
    overflow-x: hidden;
    position: relative;
}

/* Grain overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
    opacity: 0.07;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' fill='%23ffffff'/%3E%3C/svg%3E");
}

::selection { background: var(--primary-dark); color: #fff; }

/* ===================================
   LAYOUT
   =================================== */

.quiz-wrapper {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===================================
   HEADER (inline, fades after Q1)
   =================================== */

.quiz-header {
    text-align: center;
    padding: 32px 16px 20px;
    transition: opacity 0.5s ease, max-height 0.5s ease, padding 0.5s ease, margin 0.5s ease;
    opacity: 1;
    max-height: 300px;
    overflow: hidden;
}

.quiz-header.header-hidden {
    opacity: 0;
    max-height: 0;
    padding: 0 16px;
    margin: 0;
}

.header-logo {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.header-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

.header-subtitle {
    font-size: 14px;
    color: var(--text-medium);
    line-height: 1.5;
    margin-bottom: 0;
}

/* ===================================
   QUIZ CONTAINER (visible immediately)
   =================================== */

.quiz-container {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: 0 1px 24px rgba(0, 0, 0, 0.3);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===================================
   PROGRESS BAR
   =================================== */

.progress-container {
    margin-bottom: 24px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-motivation {
    font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--primary-light);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.progress-count {
    font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-light);
    letter-spacing: 0.05em;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(167, 139, 250, 0.12);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    box-shadow: 0 0 10px var(--primary-light);
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 2px;
}

/* ===================================
   QUESTIONS
   =================================== */

.question {
    display: none;
    animation: fadeIn 0.3s ease;
}

.question.active {
    display: flex;
    flex-direction: column;
}

.question-text {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.4;
}

.question-subtext {
    font-size: 13px;
    color: var(--text-medium);
    margin-top: -12px;
    margin-bottom: 16px;
}

/* ===================================
   OPTIONS
   =================================== */

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option {
    background: var(--bg-3);
    border: 1.5px solid var(--line);
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    text-align: left;
    line-height: 1.4;
}

.option:hover {
    border-color: var(--primary-light);
    background: var(--bg-surface);
    box-shadow: 0 0 0 1px rgba(196, 181, 253, 0.2);
}

.option:active {
    transform: scale(0.98);
}

.option.selected {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    color: #fff;
    border-color: var(--primary-light);
    box-shadow: 0 2px 14px rgba(167, 139, 250, 0.4);
}

/* ===================================
   APPEARANCE OPTIONS (image-card style)
   =================================== */

.options-appearance {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.option-appearance {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 16px 10px 14px;
    gap: 10px;
    min-height: 156px;
}

.option-appearance .swatch {
    display: block;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.18), inset 0 -2px 4px rgba(255, 255, 255, 0.25), 0 2px 6px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.option-appearance .option-label {
    display: block;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 600;
}

.option-appearance .option-sublabel {
    display: block;
    font-size: 11px;
    line-height: 1.3;
    font-weight: 400;
    color: var(--text-muted, #8B83A8);
    opacity: 0.7;
    margin-top: -2px;
}

.option-appearance.selected .option-sublabel {
    color: rgba(255, 255, 255, 0.92);
    opacity: 1;
}

/* Skin-tone swatches keyed off the option's data-value (gradient: light → deep) */
.option-appearance[data-value="light-european"] .swatch        { background: #FFDFC4; }
.option-appearance[data-value="light-mediterranean"] .swatch   { background: #F0D5BE; }
.option-appearance[data-value="medium-east-asian"] .swatch     { background: #E8C5A0; }
.option-appearance[data-value="medium-latino"] .swatch         { background: #D9A066; }
.option-appearance[data-value="medium-middle-eastern"] .swatch { background: #C68642; }
.option-appearance[data-value="dark-south-asian"] .swatch      { background: #A67C52; }
.option-appearance[data-value="dark-african"] .swatch          { background: #8D5524; }

/* Random option — uses the conic gradient swatch, otherwise styled like every other card */
.swatch-random {
    background: conic-gradient(
        from 0deg,
        #FFDFC4 0deg 51deg,
        #F0D5BE 51deg 103deg,
        #E8C5A0 103deg 154deg,
        #D9A066 154deg 206deg,
        #C68642 206deg 257deg,
        #A67C52 257deg 309deg,
        #8D5524 309deg 360deg
    );
}

/* When an appearance option is selected, keep the swatch visible (don't invert it) */
.option-appearance.selected {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    color: #fff;
}
.option-appearance.selected .swatch {
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25), 0 0 0 3px rgba(255, 255, 255, 0.4);
}

@media (min-width: 600px) {
    .options-appearance {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===================================
   BUTTONS
   =================================== */

.btn {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    color: #fff;
    border: none;
    padding: 16px 24px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    width: 100%;
    margin-top: 16px;
    transition: box-shadow 0.2s ease, transform 0.18s ease;
    box-shadow: 0 4px 18px rgba(167, 139, 250, 0.35);
    display: block;
}

.btn:hover {
    box-shadow: 0 6px 26px rgba(167, 139, 250, 0.5);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn-skip {
    background: transparent;
    color: var(--text-medium);
    box-shadow: none;
    font-weight: 500;
    font-size: 14px;
    margin-top: 8px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-skip:hover {
    color: var(--text-dark);
    box-shadow: none;
    transform: none;
}

.btn-reveal {
    font-size: 17px;
    padding: 18px 24px;
    margin-top: 24px;
    animation: pulseGlow 2s ease-in-out infinite;
}

/* ===================================
   INTERSTITIALS — DOPAMINE HITS
   Auto-advance, pulsing glow, no button
   =================================== */

.interstitial {
    text-align: center;
    padding: 50px 20px;
}

.question.interstitial {
    display: none;
}

.question.interstitial.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

.interstitial-pulse {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(196, 181, 253, 0.45) 0%, rgba(167, 139, 250, 0.18) 55%, transparent 75%);
    box-shadow: 0 0 60px rgba(167, 139, 250, 0.35);
    animation: pulseRing 1.5s ease-in-out infinite;
    margin-bottom: 24px;
}

.interstitial-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.3;
    animation: fadeInUp 0.6s ease;
}

.interstitial-subtext {
    font-size: 14px;
    color: var(--text-medium);
    margin-bottom: 24px;
    line-height: 1.5;
    animation: fadeInUp 0.8s ease;
}

/* Loading dots */
.interstitial-loader {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.loader-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-light);
    box-shadow: 0 0 10px rgba(196, 181, 253, 0.6);
    animation: loaderBounce 1.2s ease-in-out infinite;
}

.loader-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* ===================================
   INPUT CAPTURES
   =================================== */

.input-capture-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.input-capture-container .text-input {
    width: 100%;
    max-width: 300px;
    padding: 14px 20px;
    font-size: 16px;
    border: 1.5px solid var(--line-strong);
    border-radius: 12px;
    background: var(--bg-3);
    color: var(--text-dark);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    text-align: center;
    font-family: inherit;
}

.input-capture-container .text-input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}

.input-capture-container .text-input::placeholder {
    color: var(--text-light);
}

.birth-fields {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 300px;
}

.birth-select {
    flex: 1;
    padding: 14px 12px;
    font-size: 15px;
    border: 1.5px solid var(--line-strong);
    border-radius: 12px;
    background: var(--bg-3);
    color: var(--text-dark);
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C4B5FD' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 32px;
}

.birth-select:focus {
    outline: none;
    border-color: var(--primary-light);
    background-color: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}

.birth-select option {
    background: var(--bg-2);
    color: var(--text-dark);
}

.optional-tag {
    font-weight: 400;
    color: var(--text-light);
    font-size: 14px;
}

/* ===================================
   FINAL SCREEN
   =================================== */

.final-screen {
    text-align: center;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.final-glow {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(196, 181, 253, 0.4) 0%, rgba(167, 139, 250, 0.18) 50%, transparent 70%);
    box-shadow: 0 0 80px rgba(167, 139, 250, 0.4);
    animation: pulseRing 2s ease-in-out infinite;
    margin-bottom: 20px;
}

.final-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.3;
    animation: fadeInUp 0.5s ease;
}

.final-subtitle {
    font-size: 14px;
    color: var(--text-medium);
    margin-bottom: 20px;
    animation: fadeInUp 0.7s ease;
}

.final-bullets {
    list-style: none;
    padding: 0;
    margin: 0 0 8px 0;
    width: 100%;
    max-width: 340px;
}

.final-bullets li {
    font-size: 14px;
    color: var(--text-dark);
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
    line-height: 1.5;
    position: relative;
    padding-left: 24px;
}

.final-bullets li:last-child {
    border-bottom: none;
}

.final-bullets li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-light);
    font-weight: 700;
}

/* ===================================
   ANIMATIONS
   =================================== */

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

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

@keyframes pulseRing {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 4px 18px rgba(167, 139, 250, 0.35);
    }
    50% {
        box-shadow: 0 6px 28px rgba(167, 139, 250, 0.6), 0 0 50px rgba(196, 181, 253, 0.25);
    }
}

@keyframes loaderBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (min-width: 640px) {
    body {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 40px 20px;
    }

    .quiz-wrapper {
        max-width: 500px;
        padding: 0;
    }

    .quiz-container {
        padding: 32px 28px;
    }

    .question-text {
        font-size: 18px;
    }

    .option {
        font-size: 15px;
        padding: 15px 18px;
    }

    .header-logo {
        font-size: 20px;
    }

    .header-title {
        font-size: 24px;
    }

    .header-subtitle {
        font-size: 15px;
    }
}

/* ===================================
   LEGAL FOOTER
   =================================== */

.legal-footer {
    margin: 64px auto 0;
    padding: 28px 16px 36px;
    border-top: 1px solid var(--line);
    text-align: center;
    max-width: 480px;
}

.legal-disclaimer {
    font-size: 12px;
    color: var(--text-medium);
    line-height: 1.6;
    margin: 0 auto 14px;
    max-width: 420px;
}

.legal-links {
    font-size: 12px;
    color: var(--text-medium);
    margin-bottom: 10px;
}

.legal-links a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 200ms ease;
}

.legal-links a:hover {
    color: #fff;
}

.legal-sep {
    margin: 0 8px;
    color: var(--text-light);
    opacity: 0.6;
}

.legal-copy {
    font-size: 11px;
    color: var(--text-light);
    opacity: 0.75;
}
