/* ============================================
   IMPORTERA FONTER – INTER + JETBRAINS MONO
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================
   CSS-VARIABLER – PREMIUM DESIGN SYSTEM
   ============================================ */
:root {
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --bg: #f0f4ff;
    --bg-gradient: linear-gradient(160deg, #EEF2FA 0%, #F0F9F4 50%, #FAFBFF 100%);

    --card: #ffffff;
    --card-hover: #ffffff;

    --text: #0f172a;
    --text2: #475569;
    --text3: #94a3b8;

    --border: #e2e8f0;
    --border-hover: #cbd5e1;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.07), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 20px 35px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 30px 60px -12px rgba(15, 23, 42, 0.15);
    --shadow-glow-blue: 0 0 25px rgba(43, 82, 168, 0.2);
    --shadow-glow-green: 0 0 20px rgba(46, 155, 63, 0.15);
    --shadow-glow-amber: 0 0 20px rgba(245, 158, 11, 0.15);
    --shadow-glow-red: 0 0 20px rgba(220, 38, 38, 0.15);

    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --blue: #2B52A8;
    --blue-light: #EBF0FA;
    --blue-dark: #1E3D8A;
    --blue-glow: rgba(43, 82, 168, 0.12);

    --green: #2E9B3F;
    --green-light: #EDFBF0;
    --green-dark: #1E7A2E;
    --green-glow: rgba(46, 155, 63, 0.12);

    --red: #dc2626;
    --red-light: #fef2f2;
    --red-dark: #b91c1c;
    --red-glow: rgba(220, 38, 38, 0.12);

    --amber: #f59e0b;
    --amber-light: #fffbeb;
    --amber-dark: #d97706;
    --amber-glow: rgba(245, 158, 11, 0.12);

    --purple: #8b5cf6;
    --purple-light: #f5f3ff;

    --gray-light: #f1f5f9;
    --surface: #f8fafc;

    --gradient-1: linear-gradient(135deg, #2B52A8 0%, #2E9B3F 100%);
    --gradient-2: linear-gradient(135deg, #2E9B3F 0%, #2B52A8 100%);
    --gradient-3: linear-gradient(135deg, #f59e0b 0%, #dc2626 100%);
    --gradient-blue: linear-gradient(135deg, #2B52A8 0%, #5B82D4 100%);
    --gradient-green: linear-gradient(135deg, #2E9B3F 0%, #4DC963 100%);
    --gradient-amber: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-red: linear-gradient(135deg, #dc2626 0%, #f87171 100%);
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #c084fc 100%);
    --gradient-hero: linear-gradient(135deg, #2B52A8 0%, #2E9B3F 100%);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    font-size: 1.05rem;
    min-height: 100vh;
}

/* ============================================
   HEADER – GLASSMORPHISM PREMIUM
   ============================================ */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 2rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border-bottom: 1px solid rgba(43, 82, 168, 0.15);
    box-shadow: 0 1px 0 rgba(255,255,255,0.5), var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.home-link {
    text-decoration: none;
    color: var(--text2);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.home-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--blue-light);
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: inherit;
}

.home-link:hover {
    color: var(--blue);
    transform: translateY(-1px);
}

.home-link:hover::before {
    opacity: 1;
}

.home-link span {
    position: relative;
    z-index: 1;
}

.header-left h1 {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.header-left small {
    font-size: 0.8rem;
    color: var(--text2);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.exam-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 99px;
    background: var(--blue-light);
    color: var(--blue);
    white-space: nowrap;
    border: 1px solid rgba(43, 82, 168, 0.2);
    box-shadow: 0 1px 2px rgba(43, 82, 168, 0.1);
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.exam-badge.green {
    background: var(--green-light);
    color: var(--green-dark);
    border-color: rgba(46, 155, 63, 0.2);
}

.exam-badge.red {
    background: var(--red-light);
    color: var(--red-dark);
    border-color: rgba(220, 38, 38, 0.2);
}

.header-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    font-weight: 700;
}

.best-streak {
    color: var(--amber);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.streak-badge {
    background: var(--amber-light);
    color: var(--amber-dark);
    padding: 0.35rem 0.85rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(245, 158, 11, 0.2);
    box-shadow: 0 1px 2px rgba(245, 158, 11, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.theme-toggle {
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1.3rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    background: var(--gray-light);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--blue-light);
    color: var(--blue);
    border-color: rgba(43, 82, 168, 0.25);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-glow-blue);
}

/* ============================================
   HEMSIDA – HERO + EXAM CARDS
   ============================================ */
.home-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

.hero-section {
    text-align: center;
    padding: 4.5rem 1rem 2.5rem;
    animation: fadeInUp 0.6s ease forwards;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--blue-light);
    color: var(--blue-dark);
    border: 1px solid rgba(43, 82, 168, 0.2);
    padding: 0.45rem 1.1rem;
    border-radius: 99px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(43, 82, 168, 0.1);
}

.hero-section h2 {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    margin-bottom: 1rem;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.05;
}

.hero-section p {
    font-size: 1.2rem;
    color: var(--text2);
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.7;
    font-weight: 500;
}

/* Exam Grid */
.exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
}

/* Exam Card – Premium */
.exam-card {
    background: var(--card);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-decoration: none;
    color: var(--text);
    border: 1.5px solid rgba(43, 82, 168, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeInUp 0.5s ease forwards;
    box-shadow: 0 4px 24px -4px rgba(43, 82, 168, 0.08), var(--shadow);
}

.exam-card:nth-child(1) { animation-delay: 0s; }
.exam-card:nth-child(2) { animation-delay: 0.1s; }
.exam-card:nth-child(3) { animation-delay: 0.2s; }

/* Shimmer-bakgrund */
.exam-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
    pointer-events: none;
}

.exam-card > * {
    position: relative;
    z-index: 1;
}

.exam-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    opacity: 0;
    transition: opacity 0.3s ease, height 0.3s ease;
    z-index: 2;
}

.exam-card:nth-child(1)::before { background: var(--gradient-blue); }
.exam-card:nth-child(2)::before { background: var(--gradient-purple); }
.exam-card:nth-child(3)::before { background: var(--gradient-amber); }

.exam-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl), 0 0 0 1.5px rgba(43, 82, 168, 0.15);
    border-color: transparent;
}

.exam-card:hover::before {
    opacity: 1;
    height: 5px;
}

.exam-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.exam-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.85rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.exam-card:hover .exam-icon {
    transform: scale(1.12) rotate(-4deg);
}

.exam-card:nth-child(1) .exam-icon {
    background: linear-gradient(135deg, #EBF0FA 0%, #B8CCF0 100%);
    box-shadow: 0 4px 16px rgba(43, 82, 168, 0.2);
}

.exam-card:nth-child(2) .exam-icon {
    background: linear-gradient(135deg, #f5f3ff 0%, #ddd6fe 100%);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.2);
}

.exam-card:nth-child(3) .exam-icon {
    background: linear-gradient(135deg, #fffbeb 0%, #fde68a 100%);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.2);
}

.exam-card-header h3 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.exam-subtitle {
    font-size: 0.85rem;
    color: var(--text2);
    font-weight: 500;
}

.exam-card-body {
    flex: 1;
}

.exam-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.4rem 0.9rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.tag-time {
    background: var(--blue-light);
    color: var(--blue-dark);
    border: 1px solid rgba(43, 82, 168, 0.2);
}

.tag-tools-off {
    background: var(--red-light);
    color: var(--red-dark);
    border: 1px solid rgba(220, 38, 38, 0.15);
}

.tag-tools-on {
    background: var(--green-light);
    color: var(--green-dark);
    border: 1px solid rgba(46, 155, 63, 0.15);
}

.exam-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.exam-arrow {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text2);
}

.exam-card:hover .exam-arrow {
    background: var(--gradient-1);
    color: white;
    transform: translateX(4px);
    box-shadow: 0 4px 14px rgba(43, 82, 168, 0.35);
}

/* Home Footer */
.home-footer {
    text-align: center;
    padding: 2.5rem 0 1.5rem;
    color: var(--text3);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ============================================
   HEMSKÄRM – QUIZ HOME (STATISTIK)
   ============================================ */
.home-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    text-align: center;
    border: 1.5px solid rgba(43, 82, 168, 0.07);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: fadeInUp 0.5s ease forwards;
    box-shadow: 0 4px 20px -4px rgba(43, 82, 168, 0.07);
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    opacity: 0;
    transition: opacity 0.3s ease, height 0.3s ease;
}

.stat-card.blue::before { background: var(--gradient-blue); }
.stat-card.green::before { background: var(--gradient-green); }
.stat-card.amber::before { background: var(--gradient-amber); }

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.stat-card:hover::before {
    opacity: 1;
    height: 5px;
}

.stat-card .val {
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 1;
    transition: transform 0.3s ease;
}

.stat-card:hover .val {
    transform: scale(1.1);
}

.stat-card.blue .val { 
    background: var(--gradient-blue);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-card.green .val { 
    background: var(--gradient-green);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-card.amber .val { 
    background: var(--gradient-amber);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .lbl {
    font-size: 0.8rem;
    color: var(--text2);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ============================================
   FRAMSTEG – QUESTION DOTS
   ============================================ */
.progress-section {
    margin: 2rem 0;
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    border: 1.5px solid rgba(43, 82, 168, 0.07);
    box-shadow: 0 4px 20px -4px rgba(43, 82, 168, 0.07);
    animation: fadeInUp 0.5s ease 0.3s forwards;
    opacity: 0;
}

.progress-section h3 {
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.question-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.q-dot {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: var(--card);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.q-dot:hover {
    border-color: var(--blue);
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 16px rgba(43, 82, 168, 0.2);
    color: var(--blue);
    z-index: 2;
}

.q-dot.correct { 
    background: var(--green-light); 
    border-color: var(--green); 
    color: var(--green-dark);
    box-shadow: 0 2px 8px var(--green-glow);
}
.q-dot.wrong { 
    background: var(--red-light); 
    border-color: var(--red); 
    color: var(--red-dark);
    box-shadow: 0 2px 8px var(--red-glow);
}
.q-dot.review { 
    background: var(--amber-light); 
    border-color: var(--amber); 
    color: var(--amber-dark);
    box-shadow: 0 2px 8px var(--amber-glow);
}

.q-dot.correct:hover, .q-dot.wrong:hover, .q-dot.review:hover {
    transform: translateY(-3px) scale(1.1);
}

/* Legend */
.dot-legend {
    display: flex;
    gap: 1.25rem;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text2);
    font-weight: 500;
    flex-wrap: wrap;
}

.dot-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.dot-legend .dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    border: 1.5px solid;
}

/* ============================================
   KNAPPAR – PREMIUM
   ============================================ */
.action-btns {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 2rem 0;
    animation: fadeInUp 0.5s ease 0.4s forwards;
    opacity: 0;
}

.btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem 1.5rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: var(--font);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 16px rgba(43, 82, 168, 0.4), 0 1px 3px rgba(43, 82, 168, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(43, 82, 168, 0.5);
    filter: brightness(1.07);
}

.btn-review {
    background: var(--amber-light);
    color: var(--amber-dark);
    border: 2px solid var(--amber);
    box-shadow: 0 2px 8px var(--amber-glow);
}

.btn-review:hover {
    background: var(--gradient-amber);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--amber-glow);
}

.btn-outline {
    background: var(--card);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--blue);
    background: var(--blue-light);
    color: var(--blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-blue);
}

.btn-cnt {
    background: rgba(255,255,255,0.25);
    padding: 0.2rem 0.65rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 800;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-outline .btn-cnt {
    background: var(--gray-light);
    border: 1px solid var(--border);
    color: var(--text2);
}

.btn-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.btn:hover .btn-icon {
    transform: translateX(3px);
}

/* ============================================
   QUIZ-SKÄRM
   ============================================ */
#quiz-container {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.quiz-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    min-height: calc(100vh - 60px);
}

/* Progress Bar */
.quiz-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.quiz-progress-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 99px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(43, 82, 168, 0.4);
}

.quiz-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Question Card */
.question-card {
    background: var(--card);
    border-radius: var(--radius-xl);
    padding: 2rem 2.5rem;
    margin: 0.75rem 0;
    border: 1.5px solid rgba(43, 82, 168, 0.08);
    box-shadow: 0 8px 32px -4px rgba(43, 82, 168, 0.1), var(--shadow);
    animation: fadeInUp 0.4s ease;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.question-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.q-badge {
    background: var(--gradient-1);
    color: white;
    font-size: 1.1rem;
    font-weight: 800;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: -0.02em;
    box-shadow: 0 4px 12px rgba(43, 82, 168, 0.3);
}

.q-topic {
    font-size: 0.85rem;
    color: var(--text2);
    font-weight: 600;
    flex: 1;
    letter-spacing: 0.01em;
}

.level-badge {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 99px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.lvl-E { background: var(--green-light); color: var(--green-dark); border: 1px solid rgba(46, 155, 63,0.2); }
.lvl-C { background: var(--amber-light); color: var(--amber-dark); border: 1px solid rgba(245,158,11,0.2); }
.lvl-A { background: var(--red-light); color: var(--red-dark); border: 1px solid rgba(220,38,38,0.2); }

.question-text {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.7;
    color: var(--text);
    letter-spacing: -0.01em;
}

/* Extra info (bilder, figurer) */
.question-extra {
    display: none;
    background: var(--gray-light);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1rem;
    overflow-y: auto;
    max-height: 45vh;
    font-size: 0.95rem;
    color: var(--text2);
}

.question-extra p {
    font-size: 0.95rem;
    color: var(--text2);
    line-height: 1.7;
}

/* ============================================
   SVARSALTERNATIV
   ============================================ */
.answer-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.answer-label {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text3);
    margin-bottom: -0.25rem;
}

/* Text-svar */
.text-answer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--gray-light);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 0.25rem 0.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.text-answer:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(43, 82, 168, 0.1);
    background: white;
}

.text-answer input[type="text"] {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    outline: none;
    padding: 0.75rem 0.25rem;
    letter-spacing: -0.01em;
}

.text-answer .prefix,
.text-answer .unit {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text2);
    white-space: nowrap;
}

/* Flervalssvar */
.choices {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.choice-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    cursor: pointer;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

.choice-btn:hover {
    border-color: var(--blue);
    background: var(--blue-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(43, 82, 168, 0.15);
}

.choice-letter {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--gray-light);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    flex-shrink: 0;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}

.choice-btn:hover .choice-letter {
    background: var(--blue-light);
    border-color: rgba(43, 82, 168, 0.3);
    color: var(--blue);
}

.choice-btn.selected {
    border-color: var(--blue);
    background: var(--blue-light);
    box-shadow: 0 0 0 3px rgba(43, 82, 168, 0.12);
}

.choice-btn.selected .choice-letter {
    background: var(--blue);
    border-color: var(--blue);
    color: white;
}

.choice-btn.correct-choice {
    border-color: var(--green);
    background: var(--green-light);
}

.choice-btn.correct-choice .choice-letter {
    background: var(--green);
    border-color: var(--green);
    color: white;
}

.choice-btn.wrong-choice {
    border-color: var(--red);
    background: var(--red-light);
}

.choice-btn.wrong-choice .choice-letter {
    background: var(--red);
    border-color: var(--red);
    color: white;
}

/* Multi-val */
.multi-choices {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.multi-choice {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--card);
}

.multi-choice:hover {
    border-color: var(--blue);
    background: var(--blue-light);
}

.multi-choice.selected {
    border-color: var(--blue);
    background: var(--blue-light);
}

.multi-choice.correct-multi {
    border-color: var(--green);
    background: var(--green-light);
}

.multi-choice.wrong-multi {
    border-color: var(--red);
    background: var(--red-light);
}

.multi-choice input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--blue);
    cursor: pointer;
    flex-shrink: 0;
}

/* Classify table */
.classify-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.classify-table th {
    background: var(--gray-light);
    padding: 0.75rem 1rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text2);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.classify-table th:first-child {
    text-align: left;
}

.classify-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
}

.radio-cell {
    text-align: center;
}

.classify-radio {
    width: 18px;
    height: 18px;
    accent-color: var(--blue);
    cursor: pointer;
}

/* Submit-rad */
.submit-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn-submit {
    flex: 1;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 800;
    border: none;
    border-radius: var(--radius);
    background: var(--gradient-1);
    color: white;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
    box-shadow: 0 4px 16px rgba(43, 82, 168, 0.4);
    min-width: 200px;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(43, 82, 168, 0.5);
    filter: brightness(1.07);
}

.btn-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.3);
    box-shadow: none;
}

.btn-skip {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text2);
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.25s ease;
}

.btn-skip:hover {
    border-color: var(--text3);
    color: var(--text);
    background: var(--gray-light);
}

/* ============================================
   FEEDBACK-SKÄRM
   ============================================ */
.feedback-card {
    background: var(--card);
    border-radius: var(--radius-xl);
    padding: 2rem 2.5rem;
    margin: 0.75rem 0;
    border: 1.5px solid rgba(43, 82, 168, 0.08);
    box-shadow: 0 8px 32px -4px rgba(43, 82, 168, 0.1), var(--shadow);
    animation: fadeInUp 0.4s ease;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.feedback-header.correct {
    background: var(--green-light);
    color: var(--green-dark);
    border: 1.5px solid rgba(46, 155, 63, 0.2);
}

.feedback-header.wrong {
    background: var(--red-light);
    color: var(--red-dark);
    border: 1.5px solid rgba(220, 38, 38, 0.2);
}

.feedback-icon {
    font-size: 1.5rem;
}

.correct-answer-box {
    background: var(--gray-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1.5px solid var(--border);
}

.ca-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text3);
    margin-bottom: 0.5rem;
}

.ca-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    font-family: var(--font-mono);
    letter-spacing: -0.01em;
}

.explanation-box {
    background: var(--blue-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1.5px solid rgba(43, 82, 168, 0.15);
}

.ex-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--blue-dark);
    margin-bottom: 0.5rem;
}

.explanation-box p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.7;
}

.feedback-next-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn-next {
    flex: 1;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 800;
    border: none;
    border-radius: var(--radius);
    background: var(--gradient-1);
    color: white;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.01em;
    box-shadow: 0 4px 16px rgba(43, 82, 168, 0.4);
    min-width: 200px;
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(43, 82, 168, 0.5);
    filter: brightness(1.07);
}

.btn-flag {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text2);
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-flag:hover {
    background: var(--amber-light);
    border-color: var(--amber);
    color: var(--amber-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--amber-glow);
}

.btn-flag.flagged {
    background: var(--amber-light);
    border-color: var(--amber);
    color: var(--amber-dark);
    box-shadow: 0 2px 8px var(--amber-glow);
}

/* ============================================
   RESULTAT-SKÄRM – HERO
   ============================================ */
.results-wrap {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem;
    min-height: calc(100vh - 60px);
    overflow-y: auto;
}

.results-hero {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--card);
    border-radius: var(--radius-xl);
    border: 1.5px solid rgba(43, 82, 168, 0.1);
    box-shadow: 0 8px 40px -4px rgba(43, 82, 168, 0.12);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease forwards;
}

.results-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--gradient-1);
}

.results-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 0%, rgba(43, 82, 168, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.results-emoji {
    font-size: 5rem;
    margin-bottom: 0.75rem;
    display: inline-block;
    animation: bounce 1.5s ease infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
    position: relative;
    z-index: 1;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.results-hero h2 {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
}

.results-hero p {
    font-size: 1.15rem;
    color: var(--text2);
    margin-top: 0.5rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.results-score {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    margin: 1.5rem 0;
    line-height: 1;
    position: relative;
    z-index: 1;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.results-score small {
    font-size: 1.4rem;
    font-weight: 600;
    -webkit-text-fill-color: var(--text3);
}

.grade-badge {
    display: inline-block;
    padding: 0.6rem 2rem;
    border-radius: 99px;
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    border: 2px solid transparent;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
    animation: scaleIn 0.5s ease 0.3s both;
}

.grade-A { 
    background: var(--green-light); 
    color: var(--green-dark); 
    border-color: rgba(46, 155, 63, 0.3);
    box-shadow: 0 4px 14px var(--green-glow);
}
.grade-C { 
    background: var(--amber-light); 
    color: #b45309; 
    border-color: rgba(217, 119, 6, 0.3);
    box-shadow: 0 4px 14px var(--amber-glow);
}
.grade-E { 
    background: #ffedd5; 
    color: #c2410c; 
    border-color: rgba(234, 88, 12, 0.3);
}
.grade-F { 
    background: var(--red-light); 
    color: var(--red-dark); 
    border-color: rgba(220, 38, 38, 0.3);
    box-shadow: 0 4px 14px var(--red-glow);
}

.results-breakdown {
    margin: 2rem 0;
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    border: 1.5px solid rgba(43, 82, 168, 0.07);
    box-shadow: 0 4px 20px -4px rgba(43, 82, 168, 0.07);
    animation: fadeInUp 0.5s ease 0.2s both;
}

.results-breakdown h3 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text2);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 1.05rem;
    font-weight: 600;
}

.breakdown-item:last-child {
    border-bottom: none;
}

.bi-val.ok { 
    color: var(--green-dark); 
    font-weight: 800; 
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.bi-val.fail { 
    color: var(--red-dark); 
    font-weight: 800; 
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.bi-val.skip { 
    color: var(--text3); 
    font-weight: 600; 
}

.wrong-list {
    margin: 2rem 0;
    animation: fadeInUp 0.5s ease 0.3s both;
}

.wrong-list h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--red-dark);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wrong-item {
    background: var(--red-light);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--red-dark);
    border: 1px solid rgba(239, 68, 68, 0.15);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.wrong-item:hover {
    transform: translateX(6px);
    box-shadow: var(--shadow-md);
}

.wi-q {
    font-weight: 700;
    font-size: 0.95rem;
}

.wi-a {
    font-size: 0.9rem;
    color: var(--text2);
    font-weight: 500;
}

.btn-retry-wrong {
    display: block;
    width: 100%;
    padding: 1.1rem;
    font-size: 1.1rem;
    font-weight: 800;
    border: none;
    border-radius: var(--radius);
    background: var(--gradient-amber);
    color: white;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px var(--amber-glow);
    letter-spacing: -0.01em;
    margin-top: 1.5rem;
}

.btn-retry-wrong:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--amber-glow);
    filter: brightness(1.05);
}

.btn-retry-wrong:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.btn-home {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.75rem;
    font-size: 1.05rem;
    font-weight: 700;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 1.5rem;
    text-decoration: none;
}

.btn-home:hover {
    background: var(--blue-light);
    border-color: var(--blue);
    color: var(--blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-blue);
}

/* ============================================
   TIMER
   ============================================ */
.timer-settings {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    border: 1.5px solid rgba(43, 82, 168, 0.07);
    box-shadow: 0 4px 20px -4px rgba(43, 82, 168, 0.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    animation: fadeInUp 0.5s ease forwards;
}

.timer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.timer-badge {
    background: var(--blue-light);
    color: var(--blue-dark);
    padding: 0.4rem 0.9rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(43, 82, 168, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.timer-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text2);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    transition: 0.3s;
    border-radius: 28px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
    background: var(--gradient-1);
    box-shadow: 0 0 10px rgba(43, 82, 168, 0.35);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.timer-display {
    background: var(--blue-light);
    color: var(--blue-dark);
    padding: 0.3rem 0.75rem;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid rgba(43, 82, 168, 0.2);
}

.timer-display.warning {
    background: var(--red-light);
    color: var(--red-dark);
    border-color: rgba(220, 38, 38, 0.2);
    animation: pulse 1s ease infinite;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
    position: fixed;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    color: var(--bg);
    padding: 1rem 2rem;
    border-radius: 99px;
    font-size: 0.95rem;
    font-weight: 700;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255,255,255,0.1);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   SCREENS
   ============================================ */
.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeInUp 0.4s ease;
}

/* ============================================
   DARK MODE
   ============================================ */
body.dark-mode {
    --bg: #080c16;
    --bg-gradient: linear-gradient(160deg, #0d1117 0%, #0f1720 50%, #12101e 100%);

    --card: #161b27;
    --card-hover: #1a2030;

    --text: #f1f5f9;
    --text2: #94a3b8;
    --text3: #475569;

    --border: #1e293b;
    --border-hover: #334155;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 30px 60px -12px rgba(0, 0, 0, 0.8);
    --shadow-glow-blue: 0 0 25px rgba(91, 130, 212, 0.25);
    --shadow-glow-green: 0 0 20px rgba(68, 200, 100, 0.2);
    --shadow-glow-amber: 0 0 20px rgba(251, 191, 36, 0.2);
    --shadow-glow-red: 0 0 20px rgba(248, 113, 113, 0.2);

    --gray-light: #1e293b;
    --surface: #0f172a;

    --blue-light: #0D1B38;
    --green-light: #0c2515;
    --red-light: #2d0f0f;
    --amber-light: #2d1f0f;
    --purple-light: #1e1040;

    --blue-glow: rgba(91, 130, 212, 0.15);
    --green-glow: rgba(68, 200, 100, 0.15);
    --red-glow: rgba(248, 113, 113, 0.15);
    --amber-glow: rgba(251, 191, 36, 0.15);
}

body.dark-mode .app-header {
    background: rgba(8, 12, 22, 0.85);
    border-color: rgba(43, 82, 168, 0.15);
}

body.dark-mode .exam-card {
    border-color: rgba(43, 82, 168, 0.06);
}

body.dark-mode .exam-card:nth-child(1) .exam-icon {
    background: linear-gradient(135deg, #0D1E42 0%, #1E3D8A 100%);
    box-shadow: 0 4px 12px rgba(43, 82, 168, 0.25);
}

body.dark-mode .exam-card:nth-child(2) .exam-icon {
    background: linear-gradient(135deg, #0C2515 0%, #1E7A2E 100%);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

body.dark-mode .exam-card:nth-child(3) .exam-icon {
    background: linear-gradient(135deg, #2d1f0f 0%, #78350f 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

body.dark-mode .text-answer input[type="text"] {
    background: var(--card);
    color: var(--text);
    border-color: #1e293b;
}

body.dark-mode .choice-btn {
    background: var(--card);
    color: var(--text);
    border-color: #1e293b;
}

body.dark-mode .timer-display {
    background: #152035;
    color: #8AAAE8;
    border-color: rgba(43, 82, 168, 0.2);
}

body.dark-mode .question-extra {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .question-extra p {
    color: #cbd5e1;
}

body.dark-mode .toggle-slider {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
}

body.dark-mode .toast {
    background: #e2e8f0;
    color: #0f172a;
}

body.dark-mode .exam-arrow {
    background: #1e293b;
    color: #64748b;
}

body.dark-mode .exam-card:hover .exam-arrow {
    background: var(--gradient-1);
    color: white;
}

body.dark-mode .home-link:hover {
    background: #1e293b;
    color: #5B82D4;
}

body.dark-mode .correct-answer-box {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .explanation-box {
    background: #0D1B38;
    border-color: rgba(43, 82, 168, 0.15);
}

body.dark-mode .text-answer {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .text-answer:focus-within {
    border-color: #5B82D4;
    background: #152035;
}

/* ============================================
   RESPONSIVT
   ============================================ */
@media (max-width: 768px) {
    body { font-size: 1rem; }

    .hero-section { padding: 2.5rem 0.5rem 1.5rem; }
    .hero-section h2 { font-size: 2rem; }
    .hero-badge { font-size: 0.75rem; }

    .exam-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .exam-card { padding: 1.5rem; }

    .quiz-wrap { padding: 1rem 1.25rem; min-height: calc(100vh - 50px); }
    .question-card { padding: 1.25rem 1.5rem; margin: 0.75rem 0; border-radius: var(--radius); }
    .feedback-card { padding: 1.25rem 1.5rem; border-radius: var(--radius); }
    .question-text { font-size: 1.05rem; }
    .question-extra { max-height: 40vh; padding: 1rem; font-size: 0.9rem; }
    .choices { grid-template-columns: 1fr; }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .stat-card { padding: 1.25rem 0.75rem; }
    .stat-card .val { font-size: 1.6rem; }

    .results-wrap,
    .home-wrap,
    .home-container { padding: 1.25rem; }

    .app-header { padding: 0.5rem 1rem; }
    .header-left h1 { font-size: 1.05rem; }

    .feedback-card,
    .results-breakdown,
    .timer-settings,
    .progress-section { padding: 1.25rem 1.5rem; }
}

@media (max-width: 480px) {
    .hero-section h2 { font-size: 1.8rem; }
    .quiz-meta { font-size: 0.85rem; }
    .q-badge { font-size: 0.95rem; padding: 0.3rem 0.65rem; min-width: 45px; }
    .btn-submit, .btn-skip, .btn-next { width: 100%; }
    .question-extra { max-height: 35vh; }
    .question-text { font-size: 1rem; }
    .stat-card .val { font-size: 1.4rem; }
    .exam-card-header h3 { font-size: 1.05rem; }
    .exam-icon { width: 52px; height: 52px; font-size: 1.6rem; }
}

@media (min-width: 1400px) {
    .quiz-wrap { max-width: 1400px; }
    .question-card, .feedback-card { max-width: 1200px; margin: 1.25rem auto; width: 100%; }
    .home-wrap, .home-container { max-width: 1200px; }
}

/* ============================================
   ANIMATIONER
   ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Mesh-bakgrund */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(43, 82, 168, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(46, 155, 63, 0.06) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(43, 82, 168, 0.04) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

body.dark-mode::before {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(43, 82, 168, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(43, 82, 168, 0.04) 0%, transparent 40%);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text2); }


/* ============================================
   HEADER LOGO
   ============================================ */
.header-logo {
    height: 40px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.home-link:hover .header-logo {
    transform: scale(1.05);
}

@media (min-width: 768px) {
    .header-logo {
        height: 48px;
    }
}