/* Assessment pages (loaded after student/assets/auth.css, uses its --ca-* colours) */
:root { --as-ok: #16a34a; --as-ok-bg: #dcfce7; --as-bad: #dc2626; --as-bad-bg: #fee2e2; --as-rev: #7c3aed; --as-rev-bg: #ede9fe; }

.as-auto { width: auto; padding-left: 18px; padding-right: 18px; }
.as-html { overflow-wrap: anywhere; }
.as-html img { max-width: 100%; height: auto; }
.as-html table { max-width: 100%; display: block; overflow-x: auto; }
.as-html p:last-child { margin-bottom: 0; }

/* step 1 */
.as-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: linear-gradient(120deg, #1c4c88, #0066ff); color: #fff; border-radius: 16px; padding: 22px 24px; margin-bottom: 20px; }
.as-hero .auth-title { color: #fff; }
.as-hero .auth-sub { color: rgba(255, 255, 255, .85); }
.as-hero-ico { font-size: 2.6rem; opacity: .35; }
.as-exams { display: grid; gap: 10px; }
.as-exam { display: flex; align-items: center; gap: 12px; background: #fff; border: 1.5px solid var(--ca-line); border-radius: 14px; padding: 12px 14px; cursor: pointer; margin: 0; }
.as-exam:hover { border-color: #93c5fd; }
.as-exam:has(input:checked) { border-color: var(--ca-blue-2); background: #f5f9ff; box-shadow: 0 0 0 3px rgba(0, 102, 255, .08); }
.as-exam input { position: absolute; opacity: 0; pointer-events: none; }
.as-exam-img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; }
.as-exam-letter { display: inline-flex; align-items: center; justify-content: center; background: #e0edff; color: var(--ca-blue-2); font-weight: 800; font-size: 1.2rem; }
.as-exam-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.as-exam-name { font-weight: 700; color: #0f172a; }
.as-exam-meta { color: var(--ca-muted); font-size: .82rem; }
.as-exam-tick { color: var(--ca-line); font-size: 1.2rem; }
.as-exam:has(input:checked) .as-exam-tick { color: var(--ca-blue-2); }
.as-instr { position: sticky; top: 76px; }
.as-exam-instr { background: #f8fafc; border: 1px solid var(--ca-line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: .92rem; }
.as-rules { padding-left: 1.2rem; font-size: .92rem; color: var(--ca-text); }
.as-rules li { margin-bottom: 8px; }

/* step 2 / 3 */
.as-paper h3 { font-size: 1.05rem; }
.as-paper-sub { color: var(--ca-muted); font-size: .85rem; }
.as-facts { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; font-size: .88rem; color: var(--ca-text); }
.as-facts i { color: var(--ca-blue-2); }
.as-neg { margin-top: 10px; font-size: .84rem; border-radius: 10px; padding: 7px 10px; background: var(--as-ok-bg); color: #166534; }
.as-neg.on { background: #fff7ed; color: #9a3412; }
.as-agree { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: .92rem; cursor: pointer; }
.as-agree input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ca-blue-2); flex: 0 0 auto; }

/* attempt */
.as-top { position: sticky; top: 60px; z-index: 9; display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--ca-line); border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; box-shadow: 0 6px 18px rgba(15, 23, 42, .06); }
.as-top-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.as-top-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #0f172a; }
.as-top-name span { color: var(--ca-muted); font-size: .8rem; }
.as-timer { font-weight: 800; font-variant-numeric: tabular-nums; background: #e0edff; color: var(--ca-blue); border-radius: 10px; padding: 7px 12px; white-space: nowrap; }
.as-timer.low { background: var(--as-bad-bg); color: var(--as-bad); animation: as-blink 1s steps(2) infinite; }
@keyframes as-blink { 50% { opacity: .65; } }
.as-submit-btn { width: auto; padding: 9px 18px; }
.as-palette-btn { border: 1.5px solid var(--ca-line); background: #fff; border-radius: 10px; width: 40px; height: 38px; color: var(--ca-text); }
.as-q { min-height: 300px; }
.as-q-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--ca-line); padding-bottom: 10px; margin-bottom: 14px; }
.as-q-no { font-weight: 800; color: var(--ca-blue); }
.as-q-marks { font-size: .8rem; color: var(--ca-muted); font-weight: 600; }
.as-q-text { margin-bottom: 10px; font-size: 1rem; color: #0f172a; }
.as-stmts { padding-left: 1.3rem; margin-bottom: 10px; }
.as-stmts li { margin-bottom: 4px; }
.as-opts { display: grid; gap: 10px; margin-top: 14px; }
.as-opt { display: flex; align-items: flex-start; gap: 12px; border: 1.5px solid var(--ca-line); border-radius: 12px; padding: 11px 14px; cursor: pointer; margin: 0; background: #fff; }
label.as-opt:hover { border-color: #93c5fd; }
.as-opt.on { border-color: var(--ca-blue-2); background: #f5f9ff; }
.as-opt input { position: absolute; opacity: 0; pointer-events: none; }
.as-opt-key { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--ca-line); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; color: var(--ca-muted); }
.as-opt.on .as-opt-key { background: var(--ca-blue-2); border-color: var(--ca-blue-2); color: #fff; }
.as-opt-text { flex: 1; min-width: 0; padding-top: 3px; overflow-wrap: anywhere; }
.as-opt-text img { max-width: 100%; }
.as-opt-text p { margin: 0; }
.as-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.as-nav .btn { width: auto; flex: 1 1 auto; padding: 10px 14px; }
.as-mark-btn { color: var(--as-rev); }
.as-pal { position: sticky; top: 136px; }
.as-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: .78rem; color: var(--ca-muted); margin-bottom: 12px; }
.as-legend b { color: var(--ca-text); }
.as-dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.as-dot.ans { background: var(--as-ok); } .as-dot.not { background: var(--as-bad); } .as-dot.rev { background: var(--as-rev); } .as-dot.new { background: #cbd5e1; }
.as-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 7px; max-height: 50vh; overflow-y: auto; overflow-x: hidden; padding: 6px; }
.as-cell { position: relative; height: 38px; border-radius: 9px; border: 0; font-weight: 700; font-size: .85rem; background: #e2e8f0; color: var(--ca-text); }
.as-cell.ans { background: var(--as-ok); color: #fff; }
.as-cell.not { background: var(--as-bad-bg); color: var(--as-bad); }
.as-cell.rev { box-shadow: inset 0 0 0 2px var(--as-rev); }
.as-cell.rev::after { content: ''; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--as-rev); border: 2px solid #fff; }
.as-cell.cur { outline: 2px solid var(--ca-blue-2); outline-offset: 2px; }
@media (max-width: 991.98px) {
    .as-top { top: 56px; }
    .as-pal { position: fixed; top: auto; left: 0; right: 0; bottom: 0; height: auto; max-height: 75vh; overflow-y: auto; margin: 0; z-index: 30; border-radius: 18px 18px 0 0; transform: translateY(105%); transition: transform .25s; box-shadow: 0 -10px 30px rgba(15, 23, 42, .2); }
    .as-pal.open { transform: none; }
    .as-instr { position: static; }
    .as-nav .btn { flex: 1 1 45%; }
}
.as-modal { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.as-modal[hidden] { display: none; }
.as-modal-box { background: #fff; border-radius: 16px; padding: 22px; width: 100%; max-width: 420px; }
.as-modal-box h3 { font-weight: 800; font-size: 1.2rem; }
.as-modal-box .btn { flex: 1; }
.as-modal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; text-align: center; }
.as-modal-stats span { background: #f8fafc; border: 1px solid var(--ca-line); border-radius: 10px; padding: 8px 4px; font-size: .78rem; color: var(--ca-muted); }
.as-modal-stats b { display: block; font-size: 1.25rem; color: #0f172a; }

/* result */
.as-done-ico { font-size: 3rem; color: var(--as-ok); margin-bottom: 10px; }
.as-score { text-align: center; height: 100%; }
.as-ring { --p: 0; width: 140px; height: 140px; margin: 4px auto 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
           background: radial-gradient(closest-side, #fff 78%, transparent 80% 100%), conic-gradient(var(--ca-blue-2) calc(var(--p) * 1%), #e2e8f0 0); }
.as-ring span { color: var(--ca-muted); font-size: .95rem; }
.as-ring b { font-size: 1.8rem; color: #0f172a; font-weight: 800; }
.as-grade { font-weight: 800; color: var(--ca-blue); }
.as-remark { color: var(--ca-muted); font-size: .88rem; }
.as-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; height: 100%; }
.as-stat { background: #fff; border: 1px solid var(--ca-line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; justify-content: center; }
.as-stat b { font-size: 1.35rem; font-weight: 800; color: #0f172a; }
.as-stat span { font-size: .85rem; font-weight: 600; color: var(--ca-text); }
.as-stat small { font-size: .75rem; color: var(--ca-muted); }
.as-stat.ok { background: #f0fdf4; border-color: #bbf7d0; } .as-stat.ok b { color: var(--as-ok); }
.as-stat.bad { background: #fef2f2; border-color: #fecaca; } .as-stat.bad b { color: var(--as-bad); }
@media (max-width: 575.98px) { .as-stats { grid-template-columns: repeat(2, 1fr); } }
.as-filter { display: flex; background: #e2e8f0; border-radius: 10px; padding: 3px; }
.as-filter button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: .82rem; color: var(--ca-muted); }
.as-filter button.on { background: #fff; color: var(--ca-blue); box-shadow: 0 2px 6px rgba(15, 23, 42, .08); }
.as-rv { margin-bottom: 12px; border-left: 4px solid #cbd5e1; }
.as-rv.correct { border-left-color: var(--as-ok); }
.as-rv.wrong { border-left-color: var(--as-bad); }
.as-rv[hidden] { display: none; }
.as-rv-tag { font-size: .78rem; font-weight: 700; border-radius: 20px; padding: 3px 10px; background: #f1f5f9; color: var(--ca-muted); white-space: nowrap; }
.as-rv-tag.correct { background: var(--as-ok-bg); color: #166534; }
.as-rv-tag.wrong { background: var(--as-bad-bg); color: #991b1b; }
.as-rv .as-opt { cursor: default; }
.as-opt.right { border-color: var(--as-ok); background: #f0fdf4; }
.as-opt.right .as-opt-key { background: var(--as-ok); border-color: var(--as-ok); color: #fff; }
.as-opt.wrong { border-color: var(--as-bad); background: #fef2f2; }
.as-opt.wrong .as-opt-key { background: var(--as-bad); border-color: var(--as-bad); color: #fff; }
.as-opt-you { font-size: .72rem; font-weight: 700; color: var(--ca-muted); white-space: nowrap; align-self: center; }
.as-expl { margin-top: 12px; background: #f8fafc; border: 1px solid var(--ca-line); border-radius: 10px; padding: 10px 14px; }
.as-expl summary { font-weight: 700; color: var(--ca-blue-2); cursor: pointer; }
.as-expl .as-html { margin-top: 8px; font-size: .92rem; }
.as-res-btn b { font-size: 1rem; }

/* result analysis (rank, subject-wise, difficulty-wise, attempts) */
.as-stats-4 { grid-template-columns: repeat(4, 1fr); height: auto; }
@media (max-width: 767.98px) { .as-stats-4 { grid-template-columns: repeat(2, 1fr); } }
.as-stat.rank { background: #eff6ff; border-color: #bfdbfe; } .as-stat.rank b { color: var(--ca-blue-2); }
.as-table { font-size: .88rem; }
.as-table th { font-size: .78rem; color: var(--ca-muted); font-weight: 600; white-space: nowrap; border-bottom-width: 1px; background: #f8fafc; }
.as-table td, .as-table th { padding: 9px 10px; vertical-align: middle; }
.as-table tr.as-me td { background: #f5f9ff; }
.as-pill { display: inline-block; min-width: 26px; text-align: center; font-size: .75rem; font-weight: 700; border-radius: 20px; padding: 2px 8px; background: #f1f5f9; color: var(--ca-muted); }
.as-pill.ok { background: var(--as-ok-bg); color: #166534; }
.as-pill.bad { background: var(--as-bad-bg); color: #991b1b; }
.as-bar { height: 6px; background: #e2e8f0; border-radius: 4px; overflow: hidden; margin-top: 4px; }
.as-bar i { display: block; height: 100%; background: var(--as-ok); }
.as-bar i.mid { background: #f59e0b; } .as-bar i.low { background: var(--as-bad); }
.as-q-sub { font-weight: 500; color: var(--ca-muted); font-size: .78rem; margin-left: 6px; }

/* start page (instructions) — long admin instructions stay readable */
.as-start { max-width: 900px; margin: 0 auto; }
.as-start-head { background: #fff; border: 1px solid var(--ca-line); border-radius: 16px; padding: 18px 20px; margin-bottom: 14px; }
.as-start-title { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.as-start-ico { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 12px; background: #e0edff; color: var(--ca-blue-2); display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.as-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.as-chip { display: inline-flex; align-items: center; gap: 6px; background: #f1f5f9; border-radius: 20px; padding: 6px 12px; font-size: .85rem; color: var(--ca-text); }
.as-chip i { color: var(--ca-blue-2); }
.as-chip b { color: #0f172a; }
.as-chip.warn { background: #fff7ed; color: #9a3412; } .as-chip.warn i { color: #ea580c; }
.as-chip.ok { background: var(--as-ok-bg); color: #166534; } .as-chip.ok i { color: var(--as-ok); }
.as-done-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 14px; padding: 14px 18px; margin-bottom: 14px; }
.as-done-box > i { font-size: 1.6rem; color: var(--as-ok); }
.as-done-box > div { flex: 1; min-width: 180px; } .as-done-box span { color: var(--ca-muted); font-size: .88rem; }
.as-instr-card { background: #fff; border: 1px solid var(--ca-line); border-radius: 16px; padding: 6px 20px 16px; margin-bottom: 14px; position: relative; }
.as-instr-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--ca-line); margin-bottom: 14px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.as-instr-tabs button { border: 0; background: none; padding: 12px 0 10px; font-weight: 700; font-size: .92rem; color: var(--ca-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.as-instr-tabs button.on { color: var(--ca-blue-2); border-bottom-color: var(--ca-blue-2); }
.as-instr-tabs button i { margin-right: 4px; }
.as-instr-pane { max-height: 52vh; overflow-y: auto; padding-right: 6px; font-size: .94rem; line-height: 1.65; color: var(--ca-text); }
.as-instr-card.open .as-instr-pane { max-height: none; overflow: visible; }
.as-instr-pane h1, .as-instr-pane h2, .as-instr-pane h3, .as-instr-pane h4 { font-size: 1rem; font-weight: 700; color: #0f172a; margin: 14px 0 6px; }
.as-instr-pane ul, .as-instr-pane ol { padding-left: 1.3rem; }
.as-instr-pane li { margin-bottom: 6px; }
.as-instr-pane table { width: 100%; font-size: .88rem; margin: 8px 0; border-collapse: collapse; }
.as-instr-pane td, .as-instr-pane th { border: 1px solid var(--ca-line); padding: 6px 8px; }
.as-instr-pane::-webkit-scrollbar { width: 6px; } .as-instr-pane::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
.as-instr-more { display: block; width: 100%; border: 0; background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 40%); margin-top: -36px; padding: 28px 0 0; position: relative; font-weight: 700; font-size: .88rem; color: var(--ca-blue-2); }
.as-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.as-steps li { display: flex; gap: 12px; align-items: flex-start; }
.as-steps li > i { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; background: #eff6ff; color: var(--ca-blue-2); display: inline-flex; align-items: center; justify-content: center; font-size: .9rem; margin-top: 2px; }
.as-steps li > div b { display: block; color: #0f172a; font-size: .92rem; }
.as-startbar { position: sticky; bottom: 0; z-index: 8; max-width: 900px; margin: 0 auto; background: rgba(255,255,255,.97); border: 1px solid var(--ca-line); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 24px rgba(15,23,42,.08); padding: 12px 18px; }
.as-startbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.as-startbar-row + .as-startbar-row { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--ca-line); }
.as-startbar-note { color: #9a3412; font-weight: 600; font-size: .9rem; }
@media (max-width: 575.98px) { .as-startbar-row .btn { width: 100%; } .as-instr-pane { max-height: 46vh; } }

/* exam picker: long exam instructions scroll inside the panel */
.as-exam-instr { max-height: 38vh; overflow-y: auto; }

/* test page: cards size to their content (auth.css gives .dash-tile height: 100%, which pushed the
   question buttons out of their column on phones so the footer covered them) */
.as-q, .as-pal, .as-rv, .as-instr, .as-paper, .as-sum { height: auto; }
@media (max-width: 991.98px) { .as-nav { position: relative; z-index: 2; margin-bottom: 8px; } }
