/*!
 * AAA Exams - student exam panel & parent alerts page
 * Everything is scoped to .aaa-app / .aaa-layer so it does not leak into the theme.
 */
.aaa-app,
.aaa-layer,
.aaa-toasts {
	--aaa-primary: #2f3fb5;
	--aaa-primary-dark: #222f8f;
	--aaa-primary-soft: #eceefc;
	--aaa-accent: #0e9f8e;
	--aaa-ok: #1f9d55;
	--aaa-ok-soft: #e4f6ec;
	--aaa-warn: #d98a06;
	--aaa-warn-soft: #fff4dc;
	--aaa-bad: #d23a3a;
	--aaa-bad-soft: #fdeaea;
	--aaa-ink: #1b2236;
	--aaa-muted: #66728a;
	--aaa-line: #dde3ef;
	--aaa-bg: #f3f5fb;
	--aaa-card: #ffffff;
	--aaa-radius: 14px;
	--aaa-shadow: 0 1px 2px rgba(20, 30, 70, .06), 0 8px 24px rgba(20, 30, 70, .07);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Mangal", Arial, sans-serif;
	color: var(--aaa-ink);
	line-height: 1.5;
	font-size: 16px;
	box-sizing: border-box;
}
.aaa-app *,
.aaa-app *::before,
.aaa-app *::after,
.aaa-layer *,
.aaa-layer *::before,
.aaa-layer *::after { box-sizing: border-box; }

.aaa-app { max-width: 1080px; margin: 24px auto; padding: 0 16px; container-type: inline-size; container-name: aaa; }
.aaa-app [hidden], .aaa-layer [hidden] { display: none !important; }
.aaa-boot { text-align: center; color: var(--aaa-muted); padding: 40px 0; }

/* Exam mode: the app becomes a full-screen kiosk above the theme. */
html.aaa-lock, html.aaa-lock body { overflow: hidden !important; }
.aaa-app.aaa-kiosk {
	position: fixed; inset: 0; z-index: 99990; max-width: none; margin: 0; padding: 0;
	background: var(--aaa-bg); overflow: auto; -webkit-overflow-scrolling: touch;
}

/* ------------------------------------------------------------------ Buttons */
.aaa-btn {
	appearance: none; border: 1px solid transparent; cursor: pointer; font: inherit; font-weight: 600;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 11px 20px; border-radius: 10px; background: var(--aaa-primary); color: #fff;
	text-decoration: none; line-height: 1.2; transition: background .15s, box-shadow .15s, transform .05s;
}
.aaa-btn:hover { background: var(--aaa-primary-dark); color: #fff; }
.aaa-btn:active { transform: translateY(1px); }
.aaa-btn:focus-visible, .aaa-opt:focus-within, .aaa-qn:focus-visible, .aaa-input:focus-visible {
	outline: 3px solid rgba(47, 63, 181, .35); outline-offset: 2px;
}
.aaa-btn[disabled], .aaa-btn.is-disabled { opacity: .5; cursor: not-allowed; transform: none; }
.aaa-btn.sec { background: #fff; color: var(--aaa-primary); border-color: var(--aaa-line); }
.aaa-btn.sec:hover { background: var(--aaa-primary-soft); color: var(--aaa-primary-dark); }
.aaa-btn.ghost { background: transparent; color: var(--aaa-muted); border-color: transparent; padding: 8px 12px; }
.aaa-btn.ghost:hover { background: rgba(0, 0, 0, .05); color: var(--aaa-ink); }
.aaa-btn.ok { background: var(--aaa-ok); }
.aaa-btn.ok:hover { background: #17803f; }
.aaa-btn.bad { background: var(--aaa-bad); }
.aaa-btn.bad:hover { background: #b32b2b; }
.aaa-btn.lg { padding: 14px 26px; font-size: 17px; border-radius: 12px; }
.aaa-btn.block { width: 100%; }
.aaa-btn .aaa-spin { width: 16px; height: 16px; }

.aaa-spin {
	display: inline-block; border: 2px solid currentColor; border-right-color: transparent;
	border-radius: 50%; animation: aaa-rot .7s linear infinite; vertical-align: -3px;
}
@keyframes aaa-rot { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------------- Cards */
.aaa-card {
	background: var(--aaa-card); border: 1px solid var(--aaa-line); border-radius: var(--aaa-radius);
	box-shadow: var(--aaa-shadow); padding: 24px;
}
.aaa-h1 { font-size: 26px; line-height: 1.25; margin: 0 0 6px; font-weight: 750; letter-spacing: -.01em; color: var(--aaa-ink); }
.aaa-h2 { font-size: 19px; line-height: 1.3; margin: 0 0 10px; font-weight: 700; color: var(--aaa-ink); }
.aaa-sub { color: var(--aaa-muted); margin: 0 0 18px; }
.aaa-muted { color: var(--aaa-muted); }
.aaa-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.aaa-row.between { justify-content: space-between; }
.aaa-stack > * + * { margin-top: 14px; }

/* -------------------------------------------------------------------- Forms */
.aaa-field { display: block; margin: 0 0 16px; }
.aaa-field > span.aaa-lbl { display: block; font-weight: 650; margin-bottom: 6px; font-size: 14.5px; }
.aaa-field small { display: block; color: var(--aaa-muted); margin-top: 5px; font-size: 13px; }
.aaa-input {
	width: 100%; font: inherit; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--aaa-line);
	background: #fff; color: var(--aaa-ink); min-height: 48px;
}
.aaa-input:focus { border-color: var(--aaa-primary); }
.aaa-pw { position: relative; }
.aaa-pw .aaa-input { padding-right: 70px; }
.aaa-pw button {
	position: absolute; right: 6px; top: 6px; bottom: 6px; border: 0; background: transparent; cursor: pointer;
	color: var(--aaa-primary); font-weight: 600; font-size: 13.5px; padding: 0 10px; border-radius: 8px;
}
.aaa-pw button:hover { background: var(--aaa-primary-soft); }

.aaa-alert {
	padding: 12px 14px; border-radius: 10px; font-size: 14.5px; border: 1px solid transparent; margin: 0 0 14px;
}
.aaa-alert.bad { background: var(--aaa-bad-soft); color: #8d1f1f; border-color: #f4c4c4; }
.aaa-alert.ok { background: var(--aaa-ok-soft); color: #14613a; border-color: #b9e4cb; }
.aaa-alert.warn { background: var(--aaa-warn-soft); color: #7a4d00; border-color: #f2d9a1; }
.aaa-alert.info { background: var(--aaa-primary-soft); color: #222f8f; border-color: #cfd5f6; }

/* -------------------------------------------------------------------- Login */
.aaa-login { max-width: 460px; margin: 28px auto; }
.aaa-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.aaa-brand img { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; }
.aaa-brand .mark {
	width: 46px; height: 46px; border-radius: 12px; background: var(--aaa-primary); color: #fff;
	display: grid; place-items: center; font-weight: 800; font-size: 20px;
}
.aaa-brand b { display: block; font-size: 17px; line-height: 1.2; }
.aaa-brand span { color: var(--aaa-muted); font-size: 13.5px; }
.aaa-foot { text-align: center; margin-top: 16px; font-size: 14px; color: var(--aaa-muted); }
.aaa-foot a { color: var(--aaa-primary); font-weight: 600; }

/* ---------------------------------------------------------------- Dashboard */
.aaa-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.aaa-hello { display: flex; align-items: center; gap: 14px; }
.aaa-avatar {
	width: 48px; height: 48px; border-radius: 50%; background: var(--aaa-primary-soft); color: var(--aaa-primary);
	display: grid; place-items: center; font-weight: 800; font-size: 20px; flex: none;
}
.aaa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.aaa-exam { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.aaa-exam h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.aaa-exam p { margin: 0; color: var(--aaa-muted); font-size: 14.5px; }
.aaa-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.aaa-chip {
	display: inline-flex; align-items: center; gap: 5px; background: #f0f2f8; color: #3b455d; border-radius: 999px;
	padding: 4px 11px; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.aaa-chip.ok { background: var(--aaa-ok-soft); color: #14613a; }
.aaa-chip.warn { background: var(--aaa-warn-soft); color: #7a4d00; }
.aaa-chip.bad { background: var(--aaa-bad-soft); color: #8d1f1f; }
.aaa-chip.pri { background: var(--aaa-primary-soft); color: var(--aaa-primary-dark); }
.aaa-exam .aaa-btn { margin-top: auto; }
.aaa-empty { text-align: center; padding: 44px 20px; color: var(--aaa-muted); }
.aaa-resume {
	display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
	background: var(--aaa-warn-soft); border: 1px solid #f2d9a1; color: #6b4300; padding: 14px 18px;
	border-radius: var(--aaa-radius); margin-bottom: 18px;
}

/* -------------------------------------------------------- Instructions page */
.aaa-split { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; }
.aaa-instr { white-space: pre-wrap; background: #f8f9fd; border: 1px solid var(--aaa-line); border-radius: 10px; padding: 14px 16px; font-size: 15px; }
.aaa-check { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; cursor: pointer; font-weight: 600; }
.aaa-check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--aaa-primary); }
.aaa-cam {
	position: relative; border-radius: 12px; overflow: hidden; background: #0d1224; aspect-ratio: 4 / 3; width: 100%;
	border: 1px solid var(--aaa-line);
}
.aaa-cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.aaa-cam .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #9aa6c7; text-align: center; padding: 16px; font-size: 14px; }
.aaa-steps { list-style: none; margin: 14px 0 0; padding: 0; }
.aaa-steps li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14.5px; }
.aaa-steps .dot {
	width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center;
	background: #e7eaf4; color: #66728a; font-size: 13px; font-weight: 800;
}
.aaa-steps li.ok .dot { background: var(--aaa-ok); color: #fff; }
.aaa-steps li.bad .dot { background: var(--aaa-bad); color: #fff; }
.aaa-steps li.wait .dot { background: var(--aaa-primary-soft); color: var(--aaa-primary); }
.aaa-steps li.bad { color: #8d1f1f; }

/* --------------------------------------------------------------------- Exam */
.aaa-bar {
	position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 18px;
	background: #fff; border-bottom: 1px solid var(--aaa-line); box-shadow: 0 2px 10px rgba(20, 30, 70, .06);
}
.aaa-bar .t { font-weight: 750; font-size: 17px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aaa-timer {
	font-variant-numeric: tabular-nums; font-weight: 800; font-size: 20px; letter-spacing: .02em; padding: 6px 14px;
	border-radius: 10px; background: var(--aaa-primary-soft); color: var(--aaa-primary-dark); min-width: 108px; text-align: center;
}
.aaa-timer.warn { background: var(--aaa-warn-soft); color: #7a4d00; }
.aaa-timer.bad { background: var(--aaa-bad-soft); color: #8d1f1f; animation: aaa-pulse 1s ease-in-out infinite; }
@keyframes aaa-pulse { 50% { opacity: .55; } }
.aaa-viol { font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 10px; background: #f0f2f8; color: #3b455d; white-space: nowrap; }
.aaa-viol.hot { background: var(--aaa-bad-soft); color: #8d1f1f; }
.aaa-save { font-size: 12.5px; color: var(--aaa-muted); white-space: nowrap; }
.aaa-save.err { color: var(--aaa-bad); font-weight: 700; }

.aaa-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; padding: 20px 18px 110px; max-width: 1240px; margin: 0 auto; }
.aaa-q { padding: 26px 28px; min-height: 340px; display: flex; flex-direction: column; }
.aaa-qhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.aaa-qno { font-weight: 800; color: var(--aaa-primary); font-size: 15px; letter-spacing: .02em; }
.aaa-qtext { font-size: 20px; line-height: 1.55; font-weight: 600; white-space: pre-wrap; word-break: break-word; margin: 0 0 22px; user-select: none; -webkit-user-select: none; }
.aaa-opts { display: grid; gap: 12px; }
.aaa-opt {
	display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border: 2px solid var(--aaa-line);
	border-radius: 12px; cursor: pointer; background: #fff; transition: border-color .12s, background .12s; user-select: none; -webkit-user-select: none;
}
.aaa-opt:hover { border-color: #b8c1e8; background: #fafbff; }
.aaa-opt input { position: absolute; opacity: 0; pointer-events: none; }
.aaa-opt .k {
	width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
	background: #eef0f8; color: #3b455d; font-size: 14px;
}
.aaa-opt .tx { padding-top: 3px; font-size: 17px; white-space: pre-wrap; word-break: break-word; }
.aaa-opt.sel { border-color: var(--aaa-primary); background: var(--aaa-primary-soft); }
.aaa-opt.sel .k { background: var(--aaa-primary); color: #fff; }
.aaa-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 24px; }
.aaa-nav .grow { flex: 1; }

.aaa-side { display: flex; flex-direction: column; gap: 16px; align-self: start; position: sticky; top: 76px; }
.aaa-pal { padding: 18px; }
.aaa-pal h4 { margin: 0 0 12px; font-size: 15px; }
.aaa-qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 8px; max-height: 46vh; overflow: auto; padding: 2px; }
.aaa-qn {
	appearance: none; border: 2px solid var(--aaa-line); background: #fff; border-radius: 9px; height: 40px; cursor: pointer;
	font: inherit; font-weight: 700; font-size: 14px; color: #3b455d; position: relative;
}
.aaa-qn.ans { background: var(--aaa-ok); border-color: var(--aaa-ok); color: #fff; }
.aaa-qn.mark { border-color: #8b5cf6; }
.aaa-qn.mark::after { content: ""; position: absolute; top: -5px; right: -5px; width: 12px; height: 12px; border-radius: 50%; background: #8b5cf6; border: 2px solid #fff; }
.aaa-qn.cur { box-shadow: 0 0 0 3px rgba(47, 63, 181, .4); border-color: var(--aaa-primary); }
.aaa-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 12.5px; color: var(--aaa-muted); }
.aaa-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -1px; border: 2px solid var(--aaa-line); }
.aaa-legend i.a { background: var(--aaa-ok); border-color: var(--aaa-ok); }
.aaa-legend i.m { border-color: #8b5cf6; }
.aaa-sumrow { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; }

/* Camera picture-in-picture */
.aaa-pip {
	position: fixed; right: 16px; bottom: 16px; width: 188px; z-index: 99995; border-radius: 14px; overflow: hidden;
	background: #0d1224; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); border: 2px solid #fff;
}
.aaa-pip video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transform: scaleX(-1); background: #0d1224; }
.aaa-pip .st {
	display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; padding: 6px 10px; color: #fff; background: #1f9d55;
}
.aaa-pip .st::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #fff; flex: none; }
.aaa-pip[data-s="loading"] .st { background: #66728a; }
.aaa-pip[data-s="noface"] .st, .aaa-pip[data-s="away"] .st, .aaa-pip[data-s="dark"] .st { background: var(--aaa-warn); }
.aaa-pip[data-s="multi"] .st, .aaa-pip[data-s="off"] .st { background: var(--aaa-bad); }

/* ------------------------------------------------------------------- Layers */
.aaa-layer { position: fixed; inset: 0; z-index: 99999; background: rgba(15, 20, 40, .62); display: grid; place-items: center; padding: 16px; overflow: auto; }
.aaa-modal { width: 100%; max-width: 460px; background: #fff; border-radius: 16px; padding: 26px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); animation: aaa-pop .18s ease-out; }
@keyframes aaa-pop { from { transform: scale(.96); opacity: 0; } }
.aaa-modal h3 { margin: 0 0 8px; font-size: 20px; }
.aaa-modal p { margin: 0 0 14px; color: #3b455d; }
.aaa-modal .acts { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.aaa-modal.danger h3 { color: var(--aaa-bad); }
.aaa-toasts { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 100000; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 520px); pointer-events: none; }
.aaa-toast {
	background: #1b2236; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
	font-size: 14.5px; font-weight: 600; animation: aaa-pop .18s ease-out; pointer-events: auto;
}
.aaa-toast.bad { background: var(--aaa-bad); }
.aaa-toast.warn { background: #b67300; }
.aaa-toast.ok { background: var(--aaa-ok); }

/* ------------------------------------------------------------------- Result */
.aaa-result { max-width: 760px; margin: 28px auto; text-align: center; }
.aaa-badge { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; font-size: 40px; margin-bottom: 10px; }
.aaa-badge.pass { background: var(--aaa-ok-soft); color: var(--aaa-ok); }
.aaa-badge.fail { background: var(--aaa-bad-soft); color: var(--aaa-bad); }
.aaa-badge.neutral { background: var(--aaa-primary-soft); color: var(--aaa-primary); }
.aaa-score { font-size: 46px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 4px 0; }
.aaa-score small { font-size: 22px; color: var(--aaa-muted); font-weight: 700; }
.aaa-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0; }
.aaa-stat { background: #f8f9fd; border: 1px solid var(--aaa-line); border-radius: 12px; padding: 14px 8px; }
.aaa-stat b { display: block; font-size: 24px; }
.aaa-stat span { font-size: 13px; color: var(--aaa-muted); }
.aaa-review { text-align: left; margin-top: 26px; }
.aaa-rq { border: 1px solid var(--aaa-line); border-radius: 12px; padding: 14px 16px; margin: 0 0 12px; background: #fff; }
.aaa-rq.right { border-left: 5px solid var(--aaa-ok); }
.aaa-rq.wrong { border-left: 5px solid var(--aaa-bad); }
.aaa-rq.skip { border-left: 5px solid #aab3c8; }
.aaa-rq b.q { display: block; margin-bottom: 8px; white-space: pre-wrap; }
.aaa-rq .ln { font-size: 14.5px; margin: 3px 0; }
.aaa-rq .ln.good { color: #14613a; font-weight: 650; }
.aaa-rq .ln.badc { color: #8d1f1f; font-weight: 650; }

/* ------------------------------------------------------------ Parent alerts */
.aaa-parent { max-width: 520px; margin: 28px auto; }
.aaa-parent .acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* Narrow theme containers (sidebar / boxed layouts): stack the two-column screens. */
@container aaa (max-width: 760px) {
	.aaa-split { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ Mobile */
@media (max-width: 900px) {
	.aaa-split { grid-template-columns: 1fr; }
	.aaa-main { grid-template-columns: 1fr; padding-bottom: 130px; }
	.aaa-side { position: static; }
	.aaa-qgrid { max-height: none; }
}
@media (max-width: 600px) {
	.aaa-app { margin: 12px auto; padding: 0 12px; }
	.aaa-card { padding: 18px; }
	.aaa-q { padding: 18px; }
	.aaa-qtext { font-size: 18px; }
	.aaa-opt .tx { font-size: 16px; }
	.aaa-bar { padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
	.aaa-bar .t { flex-basis: 100%; order: -1; font-size: 15px; }
	.aaa-timer { font-size: 17px; min-width: 92px; }
	.aaa-save { display: none; }
	.aaa-pip { width: 118px; right: 10px; bottom: 10px; }
	.aaa-pip .st { font-size: 11px; padding: 4px 7px; }
	.aaa-h1 { font-size: 22px; }
	.aaa-score { font-size: 38px; }
	.aaa-grid { grid-template-columns: 1fr; }
	.aaa-nav .aaa-btn { padding: 11px 14px; }
}
@media (prefers-reduced-motion: reduce) {
	.aaa-spin, .aaa-timer.bad, .aaa-modal { animation: none; }
}
