/* ===================================
   LUMIRA QUIZ V2 — AGGRESSIVE
   No start screen. Header fades.
   Interstitials pulse + auto-advance.
   =================================== */

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

:root {
    --primary: #8B5CF6;
    --primary-dark: #7C3AED;
    --accent: #EC4899;
    --text-dark: #1F2937;
    --text-medium: #6B7280;
    --text-light: #9CA3AF;
    --white: #FFFFFF;
    --bg-gradient-start: #FFFFFF;
    --bg-gradient-end: #FCE7F3;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    padding: 0;
    overflow-x: hidden;
}

/* ===================================
   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(--white);
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    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-size: 12px;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.3px;
}

.progress-count {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-light);
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #F3F4F6;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    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: #FAFAFA;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 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);
    background: #FAF5FF;
}

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

.option.selected {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

/* ===================================
   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.85);
    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) 0%, var(--accent) 100%);
    color: var(--white);
}
.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) 0%, var(--accent) 100%);
    color: var(--white);
    border: none;
    padding: 16px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    margin-top: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
    display: block;
}

.btn:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    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: 600;
    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(139, 92, 246, 0.3) 0%, rgba(236, 72, 153, 0.1) 60%, transparent 70%);
    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);
    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: 2px solid #e9d5ff;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
    text-align: center;
    font-family: inherit;
}

.input-capture-container .text-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.input-capture-container .text-input::placeholder {
    color: #c4b5fd;
}

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

.birth-select {
    flex: 1;
    padding: 14px 12px;
    font-size: 15px;
    border: 2px solid #e9d5ff;
    border-radius: 12px;
    background: white;
    color: var(--text-dark);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s 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='%238B5CF6' 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: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.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(139, 92, 246, 0.25) 0%, rgba(236, 72, 153, 0.1) 50%, transparent 70%);
    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 #F3F4F6;
    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);
    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 2px 8px rgba(139, 92, 246, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(139, 92, 246, 0.6), 0 0 40px rgba(236, 72, 153, 0.2);
    }
}

@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;
    }
}
