/* ──────────────────────────────────────────────────────────────────────────
   QUIZ SELECT - MODERN DESIGN SYSTEM & STYLESHEET
   ────────────────────────────────────────────────────────────────────────── */

/* ─── RESET & DEFAULTS ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Color System (Dark Mode First) */
    --bg-main: #040407;
    --bg-card: rgba(15, 15, 23, 0.65);
    --bg-modal: #0a0a0f;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(99, 102, 241, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1; /* Increased contrast from #94a3b8 */
    --text-muted: #8e9cb0;      /* Increased contrast from #64748b */
    
    /* Brand Accents */
    --primary: #6366f1; /* Indigo */
    --primary-glow: rgba(99, 102, 241, 0.15);
    --secondary: #06b6d4; /* Cyan */
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #06b6d4 100%);
    
    /* Category Colors */
    --color-health: #10b981;     /* Emerald */
    --color-wealth: #f59e0b;     /* Amber */
    --color-relationship: #ec4899; /* Pink */
    --color-security: #3b82f6;     /* Blue */
    
    /* Fonts & Spacing */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── BACKGROUND EFFECTS ─── */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center top;
    pointer-events: none;
    z-index: 1;
}

.radial-glow {
    position: fixed;
    top: -15%;
    left: 50%;
    transform: translateX(-50%);
    width: 70vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, rgba(6, 182, 212, 0.03) 50%, transparent 100%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 2;
}

/* ─── HEADER & NAVIGATION ─── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 72px;
    backdrop-filter: blur(16px);
    background: rgba(4, 4, 7, 0.6);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-badge {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.btn-nav {
    background: var(--text-primary);
    color: var(--bg-main) !important;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.btn-nav:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ─── HERO SECTION ─── */
.hero {
    position: relative;
    padding-top: 160px;
    padding-bottom: 80px;
    z-index: 10;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.sparkle {
    font-size: 1rem;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -2px;
    margin-bottom: 24px;
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 680px;
    margin-bottom: 40px;
    font-weight: 400;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* ─── BUTTONS ─── */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

/* ─── SECTION STYLING ─── */
.quizzes-section, .about-section {
    padding: 80px 0;
    position: relative;
    z-index: 10;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 60px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 16px;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.5;
}

/* ─── QUIZZES GRID ─── */
.quizzes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.quiz-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow: hidden;
    backdrop-filter: blur(12px);
    transition: var(--transition-normal);
}

.quiz-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--x, 0px) var(--y, 0px), rgba(255, 255, 255, 0.04), transparent 40%);
    pointer-events: none;
    z-index: 1;
}

.quiz-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.card-glow {
    position: absolute;
    top: -20%;
    right: -20%;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.15;
    pointer-events: none;
}

.color-health { background-color: var(--color-health); }
.color-wealth { background-color: var(--color-wealth); }
.color-relationship { background-color: var(--color-relationship); }
.color-security { background-color: var(--color-security); }

.card-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 100px;
    margin-bottom: 24px;
}

.tag-health { background: rgba(16, 185, 129, 0.1); color: var(--color-health); border: 1px solid rgba(16, 185, 129, 0.2); }
.tag-wealth { background: rgba(245, 158, 11, 0.1); color: var(--color-wealth); border: 1px solid rgba(245, 158, 11, 0.2); }
.tag-relationship { background: rgba(236, 72, 153, 0.1); color: var(--color-relationship); border: 1px solid rgba(236, 72, 153, 0.2); }
.tag-security { background: rgba(59, 130, 246, 0.1); color: var(--color-security); border: 1px solid rgba(59, 130, 246, 0.2); }

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.quiz-card:hover .card-icon {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: var(--primary);
}

.card-icon svg {
    width: 24px;
    height: 24px;
    transition: var(--transition-fast);
}

.quiz-card h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.quiz-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 24px;
}

.btn-card {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.quiz-card:hover .btn-card {
    background: var(--text-primary);
    color: var(--bg-main);
    border-color: var(--text-primary);
}

/* ─── HOW IT WORKS STEPS ─── */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.step-item {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: var(--radius-md);
    position: relative;
}

.step-num {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 3rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: absolute;
    top: 20px;
    right: 30px;
}

.step-item h4 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.step-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ─── FOOTER ─── */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 60px 0 40px;
    background: rgba(4, 4, 7, 0.95);
    position: relative;
    z-index: 10;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 48px;
    margin-bottom: 40px;
}

.footer-brand {
    max-width: 400px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 16px;
    line-height: 1.5;
}

.footer-links-group {
    display: flex;
    gap: 80px;
    flex-wrap: wrap;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-col h5 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 700;
}

.footer-col a {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-col a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 24px;
    text-align: center;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ─── INTERACTIVE QUIZ MODAL ─── */
.quiz-modal {
    border: none;
    background: transparent;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    padding: 0;
    margin: 0;
    display: none; /* Controlled via showModal() API / CSS */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Active Dialog Styling */
.quiz-modal[open] {
    display: flex;
}

/* Backdrop */
.quiz-modal::backdrop {
    background: rgba(4, 4, 7, 0.85);
    backdrop-filter: blur(12px);
    animation: fade-in var(--transition-normal) forwards;
}

.quiz-modal-container {
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    color: var(--text-primary); /* Explicitly override default browser dialog text color */
    width: 100%;
    height: 100%;
    max-width: 480px; /* Mobile width */
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* Desktop sizing adjustments */
@media (min-width: 481px) {
    .quiz-modal-container {
        border-radius: var(--radius-lg);
        max-height: 85vh;
        height: 680px;
    }
}

/* Modal Header */
.quiz-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(10, 10, 15, 0.9);
}

.quiz-modal-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.quiz-btn-close, .quiz-btn-back {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.quiz-btn-close:hover, .quiz-btn-back:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.quiz-btn-close svg, .quiz-btn-back svg {
    width: 18px;
    height: 18px;
}

.quiz-btn-back {
    opacity: 0;
    pointer-events: none;
}

.quiz-btn-back.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Progress Tracker */
.quiz-progress-bar-container {
    height: 4px;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollable Content Wrapper */
.quiz-content-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 28px 24px;
}

/* Custom Scrollbar for Quiz Container */
.quiz-content-wrapper::-webkit-scrollbar {
    width: 6px;
}

.quiz-content-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.quiz-content-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.quiz-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

.quiz-step-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    animation: slide-step var(--transition-normal) forwards;
}

/* ─── DYNAMIC QUIZ ELEMENTS ─── */

/* Step Header */
.quiz-step-header {
    margin-bottom: 24px;
}

.quiz-step-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin-bottom: 8px;
}

.quiz-step-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-primary);
}

.quiz-step-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.4;
}

/* Answers Layouts */
.answers-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

/* Text Option Button */
.quiz-option-btn {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-option-btn:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--primary);
    transform: translateX(4px);
}

.quiz-option-btn.selected {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--primary);
    font-weight: 600;
}

/* Radio circle visual representation */
.option-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    position: relative;
    transition: var(--transition-fast);
}

.quiz-option-btn.selected .option-indicator {
    border-color: var(--primary);
}

.quiz-option-btn.selected .option-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
}

/* Checkbox visual representation */
.quiz-option-btn.checkbox .option-indicator {
    border-radius: 4px;
}

.quiz-option-btn.checkbox.selected .option-indicator::after {
    border-radius: 2px;
}

/* 2x2 Media/Icon Card Grid */
.answers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.quiz-media-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: center;
}

.quiz-media-card:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.quiz-media-card.selected {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--primary);
}

.quiz-media-card .card-icon-container {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.quiz-media-card.selected .card-icon-container {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: var(--primary);
}

.quiz-media-card .card-icon-container svg {
    width: 22px;
    height: 22px;
}

.quiz-media-card span {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Custom Measurement/Number Form Input Step */
.measurement-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.input-row {
    position: relative;
    display: flex;
}

.input-row input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: var(--transition-fast);
}

.input-row input::placeholder {
    color: var(--text-muted);
    opacity: 0.65;
}

.input-row input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.03);
}

.input-unit {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Navigation inside the step (e.g. Next step when multiselect or form is used) */
.quiz-step-actions {
    margin-top: auto;
    padding-top: 16px;
}

.quiz-btn-next {
    width: 100%;
    padding: 16px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
    transition: var(--transition-fast);
}

.quiz-btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.quiz-btn-next:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ─── LOADING SCREEN (CALCULATING) ─── */
.loading-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    text-align: center;
    padding: 40px 0;
}

.spinner-container {
    position: relative;
    width: 90px;
    height: 90px;
    margin-bottom: 32px;
}

.spinner-outer {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid rgba(99, 102, 241, 0.1);
    border-top-color: var(--primary);
    border-bottom-color: var(--secondary);
    animation: rotate 1.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-inner {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid rgba(6, 182, 212, 0.1);
    border-left-color: var(--secondary);
    border-right-color: var(--primary);
    animation: rotate-back 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-glow {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    filter: blur(5px);
}

.loading-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--text-primary); /* Explicitly set contrast color */
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 320px;
}

.loading-step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.loading-step-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.loading-step-item.done {
    color: var(--color-health);
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.loading-step-item.active .loading-dot {
    background: var(--primary);
    animation: pulse 1s infinite alternate;
}

.loading-step-item.done .loading-dot {
    background: var(--color-health);
}

.loading-check {
    color: var(--color-health);
    font-weight: 700;
    display: none;
}

.loading-step-item.done .loading-dot {
    display: none;
}

.loading-step-item.done .loading-check {
    display: block;
}

/* ─── EMAIL CAPTURE VIEW ─── */
.email-view {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.email-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.email-input-wrapper {
    position: relative;
}

.email-input-wrapper input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: var(--transition-fast);
}

.email-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.03);
}

.privacy-notice {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 8px;
}

.privacy-notice a {
    color: var(--text-secondary);
    text-decoration: underline;
}

/* ─── RESULTS VIEW ─── */
.results-view {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.results-outcome-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
}

.results-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.results-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 8px;
    color: var(--text-primary); /* Explicitly set contrast color */
}

.results-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.results-summary {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.results-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-primary);
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.results-bullets {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.bullet-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 0.92rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.bullet-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    flex-shrink: 0;
    font-weight: bold;
    font-size: 0.75rem;
}

.cta-box {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-cta {
    width: 100%;
    padding: 16px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
    text-align: center;
    text-decoration: none;
    transition: var(--transition-fast);
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-restart {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 12px;
    width: 100%;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-restart:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

/* ─── ANIMATIONS ─── */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rotate-back {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}

@keyframes pulse {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

/* Animations for hero elements load */
.animate-fade-in {
    animation: fade-in 1s ease-out forwards;
}

.animate-slide-up {
    opacity: 0;
    animation: slide-step 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.hero h1.animate-slide-up {
    animation-delay: 0.1s;
}
.hero p.animate-slide-up {
    animation-delay: 0.2s;
}
.hero-actions.animate-slide-up {
    animation-delay: 0.3s;
}

/* ─── RESPONSIVE ADJUSTMENTS ─── */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    .navbar {
        height: 64px;
    }
    .nav-links {
        display: none; /* simple burger menu representation or hide for focus */
    }
    .hero {
        padding-top: 120px;
        padding-bottom: 50px;
    }
    .hero h1 {
        font-size: 2.8rem;
        letter-spacing: -1px;
    }
    .section-title {
        font-size: 2.1rem;
    }
    .quizzes-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .steps-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}
