/* ============================================================
   BeeSkilled Quiz Portal — Sunset Blaze Dark Theme
   Fully redesigned to match BeeSkilled LMS design system
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=Nunito:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ── 1. Design Tokens ──────────────────────────────────────── */
/* ============================================================
   BeeSkilled Quiz Portal — Premium White Glassmorphism Theme
   Matches index.html design system
   All functionality preserved, only UI styling changed
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ── 1. Design Tokens ──────────────────────────────────────── */
:root {
    --primary:         #7c3aed;
    --primary-dark:    #5b21b6;
    --primary-light:   #a78bfa;
    --primary-soft:    rgba(124, 58, 237, 0.12);

    --secondary:       #4f7ef8;
    --secondary-dark:  #3b82f6;
    --secondary-light: #60a5fa;

    --accent:          #0ea5e9;
    --accent-dark:     #0284c7;
    --accent-soft:     rgba(14, 165, 233, 0.10);

    --bg:              #f8f6ff;
    --surface:         #f0eeff;
    --card:            rgba(255, 255, 255, 0.55);
    --card-soft:       rgba(255, 255, 255, 0.48);
    --elevated:        rgba(255, 255, 255, 0.75);

    --border:          rgba(255, 255, 255, 0.70);
    --border-strong:   rgba(124, 58, 237, 0.20);

    --text:            #0f0e17;
    --text-muted:      #5a5870;
    --text-faint:      #8b8aa0;

    --success:         #059669;
    --success-soft:    rgba(5, 150, 105, 0.10);
    --warning:         #f59e0b;
    --danger:          #ef4444;
    --danger-soft:     rgba(239, 68, 68, 0.10);

    --r-sm:   10px;
    --r-md:   16px;
    --r-lg:   22px;
    --r-xl:   28px;

    --t-fast: 140ms cubic-bezier(0.4, 0, 0.2, 1);
    --t:      240ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow: 380ms cubic-bezier(0.4, 0, 0.2, 1);

    --shadow-sm:   0 8px 32px rgba(100, 80, 200, 0.08);
    --shadow-md:   0 12px 40px rgba(100, 80, 200, 0.10);
    --shadow-lg:   0 20px 60px rgba(100, 80, 200, 0.12);
    --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.12);

    --glass:       blur(28px) saturate(180%);
    --glass-sm:    blur(16px) saturate(160%);

    --nav-height: 68px;
}

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

html, body {
    font-family: 'Inter', system-ui, sans-serif;
    background: linear-gradient(150deg, #fdfcff 0%, #f0ebff 30%, #e8f4fd 60%, #fff9f5 100%);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated mesh background */
body::before {
    content: '';
    position: fixed;
    inset: -30%;
    z-index: -2;
    background: 
        radial-gradient(ellipse 80% 60% at 0%   0%,   #ede9fe 0%,  transparent 55%),
        radial-gradient(ellipse 60% 50% at 100% 0%,   #dbeafe 0%,  transparent 50%),
        radial-gradient(ellipse 70% 60% at 50% 100%,  #fce7f3 0%,  transparent 55%),
        radial-gradient(ellipse 55% 50% at 100% 100%, #fed7aa 0%,  transparent 50%);
    animation: meshShift 20s ease-in-out infinite alternate;
}

body::after {
    content: '';
    position: fixed;
    inset: -30%;
    z-index: -2;
    background: 
        radial-gradient(ellipse 55% 55% at 20% 25%, rgba(167, 139, 250, 0.22) 0%, transparent 60%),
        radial-gradient(ellipse 45% 50% at 80% 15%, rgba(96, 165, 250, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 60% 45% at 55% 85%, rgba(249, 115, 22, 0.12) 0%, transparent 55%);
    animation: meshShift 28s ease-in-out infinite alternate-reverse;
}

@keyframes meshShift {
    0%   { transform: scale(1)    rotate(0deg);  opacity: 0.8; }
    50%  { transform: scale(1.06) rotate(3deg);  opacity: 1;   }
    100% { transform: scale(0.96) rotate(-2deg); opacity: 0.75; }
}

/* Animated background orbs */
body {
    background-image: none;
}

@keyframes orb-drift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(50px, 30px) scale(1.08); }
    100% { transform: translate(-25px, 50px) scale(0.95); }
}

/* ── 3. App Shell Layout ───────────────────────────────────── */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.main-content {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 3rem;
    position: relative;
    z-index: 1;
}

/* ── 4. Top Bar / Navbar (Glass) ───────────────────────────── */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    background: rgba(255, 255, 255, 0.72);
    border-bottom: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 1px 0 rgba(200, 190, 255, 0.25), 0 4px 24px rgba(120, 100, 200, 0.08);
    gap: 1.5rem;
}

/* Top accent line on navbar */
.top-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.30), rgba(79, 126, 248, 0.30), transparent);
    pointer-events: none;
}

/* ── Brand ─────────────────────────────────────────────────── */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
    box-shadow: 0 6px 24px rgba(249, 115, 22, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.80) inset;
    flex-shrink: 0;
    transition: transform var(--t), box-shadow var(--t);
}

.brand-logo:hover {
    transform: rotate(-8deg) scale(1.1);
    box-shadow: 0 10px 36px rgba(249, 115, 22, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.90) inset;
}

.brand-logo img {
    width: 65%;
    height: 65%;
    object-fit: cover;
}

.brand-text h1 {
    font-family: 'Syne', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #7c3aed 0%, #4f7ef8 60%, #0ea5e9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0;
    line-height: 1.2;
}

.brand-text p {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

/* ── User Indicator (Glass) ────────────────────────────────── */
.user-indicator {
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.50);
    backdrop-filter: var(--glass-sm);
    -webkit-backdrop-filter: var(--glass-sm);
    border: 1px solid rgba(255, 255, 255, 0.70);
    color: var(--text-muted);
    white-space: nowrap;
    transition: all var(--t-fast);
}

.user-indicator:hover {
    border-color: rgba(124, 58, 237, 0.30);
    color: var(--primary);
}

/* ── 5. Footer (Glass) ─────────────────────────────────────── */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0.9rem 1rem;
    font-size: 0.78rem;
    color: var(--text-faint);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.70);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
}

/* ── 6. View System ────────────────────────────────────────── */
.view {
    display: none;
    animation: fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.view.active {
    display: block;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── 7. Card (Glass) ───────────────────────────────────────── */
.card {
    position: relative;
    background: rgba(255, 255, 255, 0.52);
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    border-radius: var(--r-xl);
    padding: 2.2rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 24px 60px rgba(120, 80, 220, 0.12), 0 8px 20px rgba(120, 80, 220, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.90);
    overflow: hidden;
}

/* Diagonal shine overlay */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 60%;
    height: 45%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, transparent 70%);
    border-radius: 28px 0 0 0;
    pointer-events: none;
}

/* Top accent line */
.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.40), transparent);
    pointer-events: none;
}

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

/* ── 8. Typography ─────────────────────────────────────────── */
h2 {
    font-family: 'Syne', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    background: linear-gradient(135deg, #1a0a3d 0%, #6d28d9 40%, #2563eb 75%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    margin-top: 0.4rem;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ── 9. Buttons (Gradient) ─────────────────────────────────── */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.78rem 1.4rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-decoration: none;
    transition: all var(--t);
    letter-spacing: 0.01em;
    outline: none;
}

/* Sheen sweep animation */
.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.32) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 500ms ease;
    pointer-events: none;
}

.btn:hover:not(:disabled)::before {
    transform: translateX(100%);
}

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

/* Primary button */
.primary-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #4f7ef8 55%, #0ea5e9 100%);
    background-size: 200% 200%;
    border-color: rgba(255, 255, 255, 0.20);
    color: #fff;
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.20);
    animation: gradientPulse 5s ease infinite;
}

@keyframes gradientPulse {
    0%   { background-position: 0%   50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0%   50%; }
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 32px rgba(124, 58, 237, 0.40), 0 0 0 4px rgba(124, 58, 237, 0.10);
}

/* Full width */
.full-width {
    width: 100%;
    margin-top: 0.4rem;
}

/* Ghost button */
.ghost-btn {
    background: rgba(255, 255, 255, 0.50);
    backdrop-filter: var(--glass-sm);
    -webkit-backdrop-filter: var(--glass-sm);
    border: 1.5px solid rgba(124, 58, 237, 0.18);
    color: var(--text-muted);
}

.ghost-btn:hover:not(:disabled) {
    border-color: rgba(124, 58, 237, 0.40);
    color: var(--primary);
    transform: translateY(-2px);
    background: rgba(124, 58, 237, 0.08);
    box-shadow: 0 6px 22px rgba(124, 58, 237, 0.12);
}

/* Subtle button */
.subtle-btn {
    background: rgba(255, 255, 255, 0.50);
    backdrop-filter: var(--glass-sm);
    -webkit-backdrop-filter: var(--glass-sm);
    border: 1.5px solid rgba(124, 58, 237, 0.18);
    color: var(--text-muted);
    font-size: 0.83rem;
}

.subtle-btn:hover:not(:disabled) {
    border-color: rgba(124, 58, 237, 0.40);
    color: var(--primary);
    transform: translateY(-2px);
    background: rgba(124, 58, 237, 0.08);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.12);
}

/* Start quiz button on card */
.btn.start-btn {
    font-size: 0.83rem;
    padding: 0.55rem 1.15rem;
}

/* ── 10. Forms (Glass) ─────────────────────────────────────── */
.form {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

input:not([type="radio"]):not([type="checkbox"]),
select {
    width: 100%;
    padding: 0.84rem 1rem;
    border-radius: var(--r-md);
    border: 1.5px solid rgba(0, 0, 0, 0.09);
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: all var(--t-fast);
    box-shadow: 0 2px 8px rgba(100, 80, 200, 0.05);
    appearance: none;
    -webkit-appearance: none;
}

/* Select arrow override */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a5870' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

select option {
    background: #fff;
    color: var(--text);
}

input::placeholder {
    color: var(--text-faint);
}

input:not([type="radio"]):not([type="checkbox"]):focus,
select:focus {
    border-color: rgba(124, 58, 237, 0.40);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.10), 0 8px 30px rgba(100, 80, 200, 0.12);
    transform: translateY(-1px);
}

/* ── 11. Entry Card ────────────────────────────────────────── */
.entry-card {
    max-width: 480px;
    margin: 3rem auto;
    animation: fade-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── 12. Section Header ────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.75rem 0 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ── 13. Course Grid ───────────────────────────────────────── */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.5rem;
}

/* Course Card (Glass) */
.course-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--r-lg);
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 8px 32px rgba(100, 80, 200, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.90);
    display: flex;
    flex-direction: column;
    transition: transform var(--t), box-shadow var(--t), border-color var(--t);
    backdrop-filter: var(--glass-sm);
    -webkit-backdrop-filter: var(--glass-sm);
}

/* Diagonal shine */
.course-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 65%;
    height: 45%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, transparent 70%);
    border-radius: 22px 0 0 0;
    pointer-events: none;
    z-index: 2;
}

/* Bottom accent bar on hover */
.course-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), var(--accent), transparent);
    opacity: 0;
    transition: opacity var(--t);
    border-radius: 0 0 22px 22px;
    pointer-events: none;
}

.course-card:hover {
    transform: translateY(-6px);
    border-color: rgba(124, 58, 237, 0.30);
    box-shadow: 0 22px 55px rgba(124, 58, 237, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.course-card:hover::after {
    opacity: 1;
}

.course-card-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Course Image */
.course-image-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.course-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.02);
    transition: transform 0.38s ease;
}

.course-card:hover .course-image {
    transform: scale(1.09);
}

.course-content {
    padding: 1.1rem 1.1rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.course-title {
    font-family: 'Syne', sans-serif;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.01em;
}

.course-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.attempt-info {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.course-footer {
    padding: 0 1.1rem 1.1rem;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.20);
    color: var(--primary);
    letter-spacing: 0.04em;
}

/* Disabled card */
.course-card.disabled {
    opacity: 0.42;
    pointer-events: none;
}

/* ── 14. Quiz Screen ───────────────────────────────────────── */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 1.75rem 0 1.25rem;
    gap: 1rem;
}

/* Timer Pill (Glass) */
.timer-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.52rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.50);
    backdrop-filter: var(--glass-sm);
    -webkit-backdrop-filter: var(--glass-sm);
    border: 1px solid rgba(124, 58, 237, 0.20);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary);
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.90);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
}

.quiz-card {
    margin-bottom: 1.75rem;
}

/* Questions container */
.questions-container {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

/* Individual question block (Glass) */
.question-block {
    border-radius: var(--r-md);
    padding: 1.1rem;
    background: rgba(255, 255, 255, 0.48);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.70);
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.question-block:hover {
    border-color: rgba(124, 58, 237, 0.25);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.08);
}

.question-text {
    margin: 0 0 0.65rem;
    font-size: 0.93rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.55;
}

.options-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.options-list li {
    display: block;
    width: 100%;
}

/* Hide the native radio */
.options-list input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* The full-width option row */
.option-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.78rem 1.1rem;
    border-radius: var(--r-sm);
    cursor: pointer;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.30);
    border: 1px solid rgba(124, 58, 237, 0.12);
    transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), color var(--t-fast);
    user-select: none;
}

/* Custom radio circle */
.option-label::before {
    content: '';
    display: block;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 50%;
    border: 2px solid rgba(124, 58, 237, 0.35);
    background: rgba(255, 255, 255, 0.60);
    transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

/* Text span */
.option-label span {
    display: block;
    flex: 1;
    min-width: 0;
    word-break: break-word;
    white-space: normal;
    line-height: 1.55;
}

/* Hover state */
.option-label:hover {
    background: rgba(124, 58, 237, 0.06);
    border-color: rgba(124, 58, 237, 0.30);
    color: var(--text);
}

.option-label:hover::before {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.10);
}

/* Selected state */
.option-label:has(input[type="radio"]:checked) {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12) 0%, rgba(79, 126, 248, 0.08) 100%);
    border-color: var(--primary);
    color: var(--text);
    box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.20) inset, 0 6px 24px rgba(124, 58, 237, 0.12);
}

/* Custom radio dot when selected */
.option-label:has(input[type="radio"]:checked)::before {
    background: radial-gradient(circle, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

.option-label:has(input[type="radio"]:checked) span {
    color: var(--primary);
    font-weight: 600;
}

/* Quiz actions row */
.quiz-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* ── 15. Loading Spinner ───────────────────────────────────── */
.loading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 1rem;
    gap: 0;
}

.loading-text {
    margin-top: 1.1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid rgba(124, 58, 237, 0.12);
    border-top-color: var(--primary);
    animation: spin 0.85s linear infinite;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.15);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── 16. Note / Caption ────────────────────────────────────── */
.note {
    margin-top: 0.6rem;
    font-size: 0.78rem;
    color: var(--text-faint);
    line-height: 1.6;
}

.note.small {
    font-size: 0.73rem;
}

/* ── 17. Result Card (Glass) ───────────────────────────────── */
.result-card {
    max-width: 520px;
    margin: 2.5rem auto 0;
    text-align: center;
}

.result-card h2 {
    font-size: 1.85rem;
    margin-bottom: 0.75rem;
}

#result-name,
#result-course {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin: 0.15rem 0;
}

.result-score {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    margin: 0.8rem 0 0.25rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-message {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0.2rem 0 0.1rem;
    letter-spacing: 0.02em;
}

.result-message.pass {
    color: var(--success);
}

.result-message.fail {
    color: var(--danger);
}

.result-attempt {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.result-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    align-items: center;
}

/* Certificate download button */
#download-cert-btn {
    background: linear-gradient(135deg, #1e3a8a, #2563eb) !important;
    border-color: rgba(37, 99, 235, 0.30) !important;
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.30) !important;
}

#download-cert-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 32px rgba(37, 99, 235, 0.40) !important;
}

/* ── 18. Utilities ─────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── 19. Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: #f0eeff; border-radius: 10px; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #a78bfa, #60a5fa);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #7c3aed, #3b82f6);
}

/* ── 20. Text Selection ────────────────────────────────────── */
::selection {
    background: rgba(124, 58, 237, 0.20);
    color: #5b21b6;
}

/* ── 21. Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    .top-bar {
        padding-inline: 1rem;
    }

    .main-content {
        padding-inline: 0.9rem;
    }

    .card {
        padding: 1.5rem 1.2rem;
        border-radius: var(--r-lg);
    }

    .quiz-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .quiz-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .quiz-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .course-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    h2 {
        font-size: 1.3rem;
    }

    .result-score {
        font-size: 1.65rem;
    }

    .entry-card {
        margin: 1.5rem auto;
    }
}

@media (max-width: 480px) {
    .brand-text p {
        display: none;
    }

    .timer-pill {
        font-size: 0.82rem;
        padding: 0.45rem 0.8rem;
    }
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    padding: 6px;
    background: #fff;
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}