﻿/* ==========================================================================
   SGF Nizamabad quiz - student site
   Sits on top of Bootstrap 5; everything custom is namespaced by purpose.
   ========================================================================== */
@import url(../css/clash-display.css);

:root {
    --c-dark: #14162b;
    --c-ink: #1d2036;
    --c-body: #5a607a;
    --c-muted: #8a90a8;
    --c-brand: #4f46e5;
    --c-brand-dark: #3b32c9;
    --c-brand-light: #6d66f0;
    --c-brand-rgb: 79, 70, 229;
    --c-brand-soft: #eef0ff;
    --c-accent: #f59e0b;
    --c-good: #0f8a3c;
    --c-good-soft: #e3f6ea;
    --c-bad: #d4322c;
    --c-bad-soft: #fdecea;
    --c-warn-soft: #fff4d6;
    --c-line: #e8eaf3;
    --c-surface: #ffffff;
    --c-bg: #f5f6fb;
    --font-base: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "ClashDisplay", var(--font-base);
    --radius: 18px;
    --radius-sm: 12px;
    --box-shadow: 0 1px 2px rgba(20, 22, 43, .04), 0 14px 34px -16px rgba(20, 22, 43, .16);
    --transition: all .2s ease;
}

/* ---------- base ---------- */
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-base);
    line-height: 1.65;
    color: var(--c-body);
    background: var(--c-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}
main.site-main { flex: 1 0 auto; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--c-dark);
    letter-spacing: -.01em;
}
a { text-decoration: none; color: var(--c-brand); transition: var(--transition); }
a:hover { color: var(--c-brand-dark); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid rgba(var(--c-brand-rgb), .45); outline-offset: 2px; }
.section-padding { padding-top: 56px; padding-bottom: 72px; }
.theme-shadow { box-shadow: var(--box-shadow); }

/* ---------- navbar ---------- */
.site-nav {
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(1.4) blur(14px);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--c-line);
    padding: 10px 0;
}
.site-nav .navbar-brand { display: flex; align-items: center; gap: 12px; margin: 0; padding: 0; }
.site-nav .navbar-brand img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; box-shadow: 0 0 0 1px var(--c-line); }
.brand-text { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--c-dark); letter-spacing: -.02em; line-height: 1.1; }
.brand-text small { display: block; font-family: var(--font-base); font-weight: 500; font-size: 11.5px; letter-spacing: .02em; color: var(--c-muted); }
.site-nav .nav-link { font-weight: 500; color: var(--c-ink); padding: 8px 14px !important; border-radius: 999px; }
.site-nav .nav-link:hover { background: var(--c-brand-soft); color: var(--c-brand); }
.site-nav .nav-link.active { background: var(--c-brand-soft); color: var(--c-brand); font-weight: 600; }
.site-nav .navbar-toggler { border: 1px solid var(--c-line); border-radius: 12px; padding: 7px 10px; }
.site-nav .navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(var(--c-brand-rgb), .25); }

/* ---------- announcement banner ---------- */
.site-banner { padding: 10px 0; font-size: 14.5px; font-weight: 500; border-bottom: 1px solid transparent; }
.site-banner[hidden] { display: none; }
.site-banner i { font-size: 18px; }
.banner-info { background: #e8f1fd; color: #123f7a; border-color: #cfe1f8; }
.banner-success { background: var(--c-good-soft); color: #0b5c28; border-color: #c4e8d1; }
.banner-warning { background: var(--c-warn-soft); color: #7a4a00; border-color: #f4dfa2; }
.banner-close { border: 0; background: transparent; color: inherit; font-size: 20px; line-height: 1; padding: 2px 4px; border-radius: 8px; opacity: .7; cursor: pointer; }
.banner-close:hover { opacity: 1; background: rgba(0, 0, 0, .06); }

/* ---------- announcements marquee (home page) ---------- */
.ticker { background: #fff; border-bottom: 1px solid var(--c-line); }
.ticker-inner { display: flex; align-items: center; gap: 14px; padding-top: 10px; padding-bottom: 10px; }
.ticker-label { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; background: var(--c-brand-soft); color: var(--c-brand-dark); font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.ticker-label i { font-size: 16px; }
.marquee { flex: 1 1 auto; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(to right, transparent, #000 22px, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(to right, transparent, #000 22px, #000 calc(100% - 22px), transparent); }
/* two identical lists side by side; sliding left by exactly one list's width, then starting over, looks endless */
.marquee-track { display: flex; width: max-content; animation: marquee-scroll var(--marquee-seconds, 30s) linear infinite; }
.marquee-group { display: flex; flex: none; align-items: center; min-width: 100vw; margin: 0; padding: 0; list-style: none; }
.marquee-group li { flex: none; white-space: nowrap; color: var(--c-ink); font-size: 15px; font-weight: 500; padding-right: 3rem; }
.marquee-group li::before { content: "\2022"; color: var(--c-accent); font-size: 1.15em; margin-right: 1rem; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track, .marquee.is-paused .marquee-track { animation-play-state: paused; }
.ticker-pause { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--c-line); border-radius: 50%; background: #fff; color: var(--c-body); cursor: pointer; }
.ticker-pause:hover { background: var(--c-brand-soft); color: var(--c-brand-dark); }
@keyframes marquee-scroll { to { transform: translateX(-50%); } }
/* the site banner scrolls too: same marquee, but in the banner's own colours */
.banner-marquee { flex: 1 1 auto; }
.banner-marquee .marquee-group li { color: inherit; font-size: inherit; font-weight: inherit; }
.banner-marquee .marquee-group li::before { color: currentColor; opacity: .55; font-size: 1em; }
.banner-pause { flex: none; border: 0; background: transparent; color: inherit; font-size: 18px; line-height: 1; padding: 2px 4px; border-radius: 8px; opacity: .7; cursor: pointer; }
.banner-pause:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
@media (max-width: 575px) { .ticker-label span { display: none; } .ticker-inner { gap: 10px; } }
/* Anyone who asked their device for less motion gets the announcements standing still, all of them visible. */
@media (prefers-reduced-motion: reduce) {
    .marquee { overflow: visible; -webkit-mask-image: none; mask-image: none; }
    .marquee-track { width: auto; }
    .marquee-group { min-width: 0; flex-wrap: wrap; row-gap: 4px; }
    .marquee-group li { white-space: normal; }
    .marquee-group[aria-hidden="true"], .ticker-pause, .banner-pause { display: none; }
}

/* ---------- buttons ---------- */
.btn {
    font-weight: 600;
    font-size: 15px;
    border-radius: 12px;
    padding: 10px 20px;
    transition: var(--transition);
}
.btn-lg { padding: 13px 26px; font-size: 16px; border-radius: 14px; }
.btn-sm { padding: 6px 14px; font-size: 13.5px; border-radius: 10px; }
.btn-primary, .btn-brand {
    background: var(--c-brand);
    border-color: var(--c-brand);
    color: #fff;
    box-shadow: 0 6px 16px -8px rgba(var(--c-brand-rgb), .7);
}
.btn-primary:hover, .btn-primary:focus, .btn-brand:hover, .btn-brand:focus {
    background: var(--c-brand-dark);
    border-color: var(--c-brand-dark);
    color: #fff;
    transform: translateY(-1px);
}
.btn-primary:disabled, .btn-primary.disabled { background: var(--c-muted); border-color: var(--c-muted); box-shadow: none; opacity: .55; }
.btn-soft { background: var(--c-brand-soft); border-color: transparent; color: var(--c-brand); }
.btn-soft:hover { background: #e0e3ff; color: var(--c-brand-dark); }
.btn-outline-light-2 { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .45); color: #fff; }
.btn-outline-light-2:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.btn-white { background: #fff; color: var(--c-brand-dark); border-color: #fff; }
.btn-white:hover { background: #f0f1ff; color: var(--c-brand-dark); transform: translateY(-1px); }

/* ---------- hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(700px 360px at 85% -10%, rgba(245, 158, 11, .35), transparent 60%),
        radial-gradient(600px 400px at 0% 100%, rgba(109, 102, 240, .55), transparent 60%),
        linear-gradient(135deg, #2b2a8f 0%, #4f46e5 55%, #6d66f0 100%);
    padding: 88px 0 96px;
}
.hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
    background-image: radial-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: linear-gradient(to bottom, #000, transparent 75%);
            mask-image: linear-gradient(to bottom, #000, transparent 75%);
}
.hero .container { position: relative; z-index: 1; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); font-size: 13.5px; font-weight: 600; letter-spacing: .02em; }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 5.2vw, 3.9rem); line-height: 1.08; margin: 20px 0 18px; font-weight: 700; }
.hero p.lead { color: rgba(255, 255, 255, .86); max-width: 640px; font-size: 1.12rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 44px; }
.hero-stats div { min-width: 90px; }
.hero-stats b { display: block; font-family: var(--font-display); font-size: 1.9rem; line-height: 1.1; }
.hero-stats span { font-size: 13.5px; color: rgba(255, 255, 255, .78); }

/* ---------- generic surfaces ---------- */
.surface {
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    box-shadow: var(--box-shadow);
    padding: 28px;
}
.page-head { margin-bottom: 28px; }
.page-head h1, .page-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 6px; }
.page-head p { margin: 0; color: var(--c-body); }
.eyebrow { text-transform: uppercase; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; color: var(--c-brand); margin-bottom: 8px; }
.section-title { margin-bottom: 28px; }
.section-title h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }

/* ---------- team ---------- */
.team-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 26px 20px; text-align: center; height: 100%; transition: var(--transition); }
.team-card:hover { transform: translateY(-4px); box-shadow: var(--box-shadow); }
.team-card img { width: 96px; height: 96px; object-fit: cover; border-radius: 50%; margin-bottom: 14px; box-shadow: 0 0 0 4px var(--c-brand-soft); }
.team-card h3 { font-size: 1.05rem; margin: 0; }
.team-card .role { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-brand); }
.team-card .meta { font-size: 13.5px; color: var(--c-body); margin-top: 10px; }
.avatar-fallback { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; background: var(--c-brand-soft); color: var(--c-brand); font: 600 2rem var(--font-display); box-shadow: 0 0 0 4px var(--c-brand-soft); }

.notice { border-radius: var(--radius); background: #fff; border: 1px solid var(--c-line); padding: 6px 22px; }
.notice summary { cursor: pointer; font-weight: 600; color: var(--c-dark); padding: 14px 0; }
.notice p { font-size: 14px; }

/* ---------- forms / auth ---------- */
.auth-wrap { max-width: 460px; margin: 0 auto; }
.auth-card h1 { font-size: 1.7rem; }
.form-label { font-weight: 600; font-size: 14px; color: var(--c-ink); margin-bottom: 6px; }
.form-control, .form-select {
    border-radius: 12px; border: 1px solid #d6d9e6; padding: 11px 14px; background-color: #fff; color: var(--c-ink);
}
.form-control:focus, .form-select:focus { border-color: var(--c-brand); box-shadow: 0 0 0 4px rgba(var(--c-brand-rgb), .14); }
.alert-soft-danger { background: var(--c-bad-soft); color: var(--c-bad); border-radius: 12px; padding: 12px 16px; font-weight: 500; font-size: 14.5px; }

/* ---------- dashboard / topics ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { border: 1px solid var(--c-line); background: #fff; color: var(--c-ink); font-weight: 600; font-size: 14px; padding: 7px 16px; border-radius: 999px; cursor: pointer; transition: var(--transition); }
.chip:hover { border-color: var(--c-brand); color: var(--c-brand); }
.chip.is-active { background: var(--c-brand); border-color: var(--c-brand); color: #fff; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.topic-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); padding: 22px; box-shadow: var(--box-shadow); transition: var(--transition); }
.topic-card:hover { transform: translateY(-3px); }
.topic-card h3 { font-size: 1.15rem; margin: 10px 0 4px; }
.topic-course { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted); }
.topic-meta { display: grid; gap: 6px; margin: 14px 0 20px; font-size: 14px; }
.topic-meta div { display: flex; align-items: center; gap: 8px; }
.topic-meta i { color: var(--c-brand); font-size: 16px; }
.topic-card .btn { margin-top: auto; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 4px 11px; border-radius: 999px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-live { background: var(--c-good-soft); color: var(--c-good); }
.status-live::before { animation: pulse 1.6s infinite; }
.status-upcoming { background: #e8f1fd; color: #1757ac; }
.status-ended { background: #eef0f6; color: var(--c-body); }
@keyframes pulse { 50% { opacity: .35; } }
.empty-state { text-align: center; padding: 56px 20px; color: var(--c-body); }
.empty-state i { font-size: 40px; color: var(--c-muted); }

/* ---------- status pages (not started, attempts used, ...) ---------- */
.state-card { max-width: 560px; margin: 0 auto; text-align: center; padding: 44px 32px; }
.state-icon { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; margin: 0 auto 20px; font-size: 32px; background: var(--c-brand-soft); color: var(--c-brand); }
.state-icon.warn { background: var(--c-warn-soft); color: #b36b00; }
.state-icon.bad { background: var(--c-bad-soft); color: var(--c-bad); }
.state-card h1 { font-size: 1.75rem; }
.countdown { display: flex; gap: 10px; justify-content: center; margin: 26px 0 8px; flex-wrap: wrap; }
.countdown .unit { min-width: 76px; padding: 14px 10px; border-radius: 16px; background: var(--c-brand-soft); }
.countdown .unit b { display: block; font: 700 2rem/1.1 var(--font-display); color: var(--c-brand-dark); font-variant-numeric: tabular-nums; }
.countdown .unit span { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); }

/* ---------- quiz ---------- */
.quiz-wrap { max-width: 780px; margin: 0 auto; }
.quiz-top { position: sticky; top: 76px; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 12px 16px; margin-bottom: 18px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border: 1px solid var(--c-line); border-radius: 16px; box-shadow: var(--box-shadow); }
.quiz-top .grow { flex: 1; min-width: 0; }
.quiz-top small { color: var(--c-muted); font-weight: 600; display: block; }
.quiz-top b { color: var(--c-dark); font-size: 15px; }
.progress-track { height: 8px; border-radius: 999px; background: var(--c-brand-soft); overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--c-brand), var(--c-brand-light)); border-radius: 999px; transition: width .4s ease; }
.timer-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--c-brand-soft); color: var(--c-brand-dark); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.timer-pill.is-urgent { background: var(--c-bad-soft); color: var(--c-bad); animation: pulse 1s infinite; }
.question-card { padding: 30px; }
.question-card .q-num { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-brand); }
.question-text { font-size: clamp(1.15rem, 2.4vw, 1.4rem); font-weight: 600; color: var(--c-dark); margin: 6px 0 18px; line-height: 1.4; font-family: var(--font-display); }
.q-image-btn { display: block; width: 100%; padding: 0; border: 1px solid var(--c-line); border-radius: 16px; overflow: hidden; background: #f3f4fa; margin: 0 0 22px; cursor: zoom-in; position: relative; }
.q-image-btn img { display: block; width: 100%; max-height: 360px; object-fit: contain; margin: 0 auto; }
.q-image-btn .zoom-tag { position: absolute; right: 10px; bottom: 10px; background: rgba(20, 22, 43, .72); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.choices { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.choice-input { position: absolute; opacity: 0; pointer-events: none; }
.choice-label {
    display: flex; align-items: center; gap: 14px; width: 100%; margin: 0; padding: 14px 16px;
    border: 1.5px solid var(--c-line); border-radius: 14px; background: #fff; color: var(--c-ink); font-weight: 500; cursor: pointer; transition: var(--transition);
}
.choice-label:hover { border-color: var(--c-brand-light); background: #fafaff; }
.choice-key { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #f0f1f8; color: var(--c-body); font-weight: 700; transition: var(--transition); }
.choice-input:checked + .choice-label { border-color: var(--c-brand); background: var(--c-brand-soft); box-shadow: 0 0 0 3px rgba(var(--c-brand-rgb), .12); }
.choice-input:checked + .choice-label .choice-key { background: var(--c-brand); color: #fff; }
.choice-input:focus-visible + .choice-label { outline: 3px solid rgba(var(--c-brand-rgb), .45); outline-offset: 2px; }
.quiz-actions { display: flex; justify-content: flex-end; margin-top: 24px; }

/* image lightbox */
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 94vh; overflow: visible; }
dialog.lightbox::backdrop { background: rgba(10, 12, 24, .82); backdrop-filter: blur(4px); }
dialog.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 14px; background: #fff; display: block; }
dialog.lightbox button { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #fff; color: var(--c-dark); font-size: 18px; line-height: 1; cursor: pointer; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); }

/* ---------- results ---------- */
.score-card { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 28px; }
.score-ring { --p: 0; width: 132px; height: 132px; flex: none; border-radius: 50%; display: grid; place-items: center; position: relative; background: conic-gradient(var(--ring, var(--c-brand)) calc(var(--p) * 1%), var(--c-brand-soft) 0); }
.score-ring::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: #fff; }
.score-ring b { position: relative; font: 700 2rem var(--font-display); color: var(--c-dark); }
.score-ring.good { --ring: var(--c-good); }
.score-ring.low { --ring: var(--c-bad); }
.score-ring.mid { --ring: var(--c-accent); }
.score-meta h1 { font-size: 1.6rem; margin-bottom: 4px; }
.score-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pill { padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: #eef0f6; color: var(--c-body); }
.pill.good { background: var(--c-good-soft); color: var(--c-good); }
.pill.bad { background: var(--c-bad-soft); color: var(--c-bad); }
.review { display: grid; gap: 14px; margin-top: 22px; }
.review-item { display: grid; grid-template-columns: 38px 1fr; gap: 14px; padding: 18px 20px; background: #fff; border: 1px solid var(--c-line); border-left-width: 4px; border-radius: 16px; }
.review-item.ok { border-left-color: var(--c-good); }
.review-item.no { border-left-color: var(--c-bad); }
.review-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; }
.ok .review-mark { background: var(--c-good-soft); color: var(--c-good); }
.no .review-mark { background: var(--c-bad-soft); color: var(--c-bad); }
.review-q { font-weight: 600; color: var(--c-dark); margin-bottom: 8px; }
.review-img { display: block; max-width: 320px; max-height: 210px; border-radius: 12px; border: 1px solid var(--c-line); margin: 4px 0 12px; object-fit: contain; background: #f3f4fa; cursor: zoom-in; }
.review-ans { display: grid; gap: 4px; font-size: 14.5px; }
.review-ans span.k { display: inline-block; min-width: 118px; color: var(--c-muted); }
.review-ans .right { color: var(--c-good); font-weight: 600; }
.review-ans .wrong { color: var(--c-bad); font-weight: 600; }

/* ---------- tables ---------- */
.table-card { background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); box-shadow: var(--box-shadow); overflow: hidden; }
.table { margin: 0; --bs-table-bg: transparent; color: var(--c-body); }
.table > :not(caption) > * > * { padding: 14px 18px; border-bottom-color: var(--c-line); vertical-align: middle; }
.table thead th { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted); background: #fafbff; border-bottom: 1px solid var(--c-line); white-space: nowrap; }
.table tbody tr:hover > * { background: #fafbff; }
.page-link { border-radius: 10px !important; margin: 0 3px; border: 1px solid var(--c-line); color: var(--c-ink); font-weight: 600; }
.pagination-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin-top: 22px; }
.pagination-bar .current-page { display: inline-grid; place-items: center; min-width: 38px; height: 38px; border-radius: 10px; background: var(--c-brand); color: #fff; font-weight: 700; }

/* ---------- profile ---------- */
.profile-avatar { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; background: linear-gradient(135deg, var(--c-brand), var(--c-brand-light)); color: #fff; font: 700 2.2rem var(--font-display); text-transform: uppercase; flex: none; }
.def-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px 28px; margin: 24px 0 0; }
.def-list dt { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); }
.def-list dd { margin: 2px 0 0; font-weight: 600; color: var(--c-dark); }

/* ---------- e-certificate card on the result page ---------- */
.cert-offer { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 20px 24px; border-color: #f4dfa2; background: linear-gradient(135deg, #fffaf0, #fff); }
.cert-offer form { margin: 0; }
.cert-offer-icon { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 28px; color: #b45309; background: var(--c-warn-soft); }
.cert-offer-text { flex: 1 1 240px; min-width: 0; }
.cert-valid { border-color: #c4e8d1; }
.cert-valid dt { color: var(--c-muted); font-weight: 600; }
.cert-valid dd { margin-bottom: .5rem; }

/* ---------- footer ---------- */
.site-footer { margin-top: auto; background: var(--c-dark); color: rgba(255, 255, 255, .7); padding: 36px 0; font-size: 14.5px; }
.site-footer a { color: rgba(255, 255, 255, .78); }
.site-footer a:hover { color: #fff; }
.site-footer .brand-text { color: #fff; font-size: 18px; }
.site-footer .brand-text small { color: rgba(255, 255, 255, .55); }
.site-footer img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-contact { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 0; margin: 22px 0 0; }
.footer-contact i { color: var(--c-brand-light); margin-right: 4px; }

@media (max-width: 575px) {
    .hero { padding: 56px 0 64px; }
    .surface, .question-card { padding: 20px; }
    .quiz-top { top: 68px; flex-wrap: wrap; }
    .score-card { gap: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }


/* ---------- quiz code (sign-up result and login) ---------- */
.state-icon.good { background: var(--c-good-soft); color: var(--c-good); }
.code-display { display: flex; justify-content: center; gap: 8px; margin-top: 4px; user-select: all; }
.code-display span {
    width: 50px; height: 66px; display: grid; place-items: center; border-radius: 14px;
    background: var(--c-brand-soft); color: var(--c-brand-dark); font: 700 2.1rem var(--font-display);
    font-variant-numeric: tabular-nums;
}
.code-display span:nth-child(3) { margin-right: 10px; }  /* 123 456 grouping */
.code-input { text-align: center; font: 700 1.75rem var(--font-display); letter-spacing: .28em; padding-left: .28em; }
.code-input::placeholder { letter-spacing: .28em; font-weight: 500; opacity: .35; }
.code-inline { font: 700 1.25rem var(--font-display); letter-spacing: .18em; }
.login-alt { border-top: 1px solid var(--c-line); padding-top: 18px; }
.login-alt summary { cursor: pointer; font-weight: 600; font-size: 14.5px; color: var(--c-muted); }
.login-alt summary:hover { color: var(--c-brand); }
@media (max-width: 400px) { .code-display span { width: 42px; height: 58px; font-size: 1.8rem; } }


/* ---------- quiz page: the question, all four options and the button fit on one screen ---------- */
body.quiz-page .site-footer, body.quiz-page .site-banner { display: none; }  /* no distractions mid-quiz */
body.quiz-page .site-nav { padding: 6px 0; }
body.quiz-page .site-nav .navbar-brand img { width: 36px; height: 36px; }
.section-quiz { padding: 14px 0; }
.section-quiz .quiz-top { position: static; margin-bottom: 12px; padding: 10px 14px; gap: 12px; }
.section-quiz .quiz-top b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; line-height: 1.3; }
.section-quiz .quiz-top small { line-height: 1.2; font-size: 12.5px; }
.section-quiz .progress-track { margin-top: 6px; height: 6px; }
.section-quiz .timer-pill { padding: 6px 12px; font-size: 14px; }
.section-quiz .question-card { padding: 18px 24px 20px; }
/* --fit is set by the page script (1 = normal) and shrinks the text a little when a screen is too short */
.section-quiz .question-text { margin: 4px 0 14px; line-height: 1.35; font-size: calc(clamp(1.15rem, 2.4vw, 1.4rem) * var(--fit, 1)); }
.section-quiz .q-image-btn { margin-bottom: 14px; }
/* a picture takes whatever height is left on this screen, but never less than a thumbnail */
.section-quiz .q-image-btn img { max-height: clamp(90px, calc(100vh - 470px), 280px); }
.section-quiz .q-image-btn img { max-height: clamp(90px, calc(100dvh - 470px), 280px); }
.section-quiz .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.section-quiz .choice-label { padding: 10px 14px; gap: 12px; height: 100%; line-height: 1.35; font-size: calc(1rem * var(--fit, 1)); }
.section-quiz .choice-key { width: 30px; height: 30px; }
.section-quiz .quiz-actions { margin-top: 16px; }
@media (max-width: 639px) {
    .section-quiz { padding: 10px 0; }
    .section-quiz .quiz-top { flex-wrap: nowrap; margin-bottom: 8px; padding: 8px 12px; }
    .section-quiz .quiz-top small { display: none; }  /* the topic name stays; the course name can wait */
    .section-quiz .progress-track { margin-top: 5px; }
    .section-quiz .question-card { padding: 12px 12px 14px; }
    .section-quiz .question-card .q-num { line-height: 1.2; }
    .section-quiz .question-text { font-size: calc(1.08rem * var(--fit, 1)); margin: 3px 0 10px; }
    /* a picture takes whatever height is left on this screen, but never less than a thumbnail */
    .section-quiz .q-image-btn { margin-bottom: 10px; }
    .section-quiz .q-image-btn img { max-height: clamp(80px, calc(100vh - 484px), 260px); }
    .section-quiz .q-image-btn img { max-height: clamp(80px, calc(100dvh - 484px), 260px); }
    .section-quiz .choices { grid-template-columns: 1fr; gap: 6px; }
    .section-quiz .choice-label { padding: 7px 12px; gap: 10px; }
    .section-quiz .choice-key { width: 28px; height: 28px; font-size: 14px; }
    /* the button stays on screen even if an unusually long question still needs a little scrolling */
    .section-quiz .quiz-actions { position: sticky; bottom: 0; margin-top: 0; padding-top: 10px; background: linear-gradient(rgba(255, 255, 255, 0), #fff 30%); }
    .section-quiz .quiz-actions .btn { width: 100%; padding-top: 9px; padding-bottom: 9px; }
}

/* ---------- "going back is turned off" notice (shown by js/disable-back-button.js) ---------- */
.back-toast {
  position: fixed; left: 50%; top: 14px; z-index: 1080;
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 460px); padding: 10px 16px; border-radius: 12px;
  background: #1e1b4b; color: #fff; font-size: 14px; line-height: 1.4; text-align: center;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .28);
  transition: opacity .2s ease, transform .2s ease;
}
.back-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .back-toast { transition: none; } }