:root {
  color-scheme: light;
  --blue: #b6202a;
  --deep-blue: #8f1720;
  --pale-blue: #f9e9e7;
  --line: #e1d8d4;
  --muted: #746b68;
  --text: #332d2b;
  --green: #2e9b64;
  --amber: #f0ad38;
  --danger: #d75353;
  --sidebar: #f7f3ee;
  --question-scale: 1;
  font-family: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 980px; background: #f4efe9; color: var(--text); }
button, input, textarea, select { font: inherit; }
button {
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, opacity .18s ease, transform .18s ease;
}
a { color: inherit; }
button:not(:disabled):active { transform: translateY(1px) scale(.985); }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; background: #fcfaf7; animation: fade-in .24s ease both; }
.top-strip, .portal-header {
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  color: var(--text); background: #fcfaf7;
  box-shadow: 0 2px 8px #4a2c2814; border-bottom: 3px solid var(--blue);
}
.top-strip { height: 68px; }
.portal-header { height: 72px; }
.brand, .session-meta, .candidate-card, .section-heading, .legend, .nav-buttons, .question-toolbar, .header-actions, .stepper, .exam-meta, .admin-nav {
  display: flex; align-items: center;
}
.brand { gap: 14px; }
.brand-identity { display: flex; align-items: center; gap: 8px; }
.brand-logo { width: 38px; height: 38px; border-radius: 50%; image-rendering: auto; transition: transform .25s ease, box-shadow .25s ease; }
.brand:hover .brand-logo { box-shadow: 0 4px 10px #8f17202e; transform: scale(1.045); }
.brand-name { color: #302928; font-size: 22px; font-weight: 750; letter-spacing: -.8px; }
.brand-copy { padding-left: 14px; border-left: 1px solid var(--line); }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: #8b7b76; font-size: 11px; letter-spacing: .08em; }
.header-actions, .session-meta { gap: 16px; font-size: 13px; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #68e69b; animation: status-pulse 2.4s ease-in-out infinite; }
.exit-button, .header-link { border: 1px solid #d8a5a5; border-radius: 5px; padding: 8px 12px; color: var(--deep-blue); background: #fff9f7; }
.portal-main { max-width: 1120px; margin: 0 auto; padding: 34px 24px 55px; animation: rise-in .3s ease both; }
.narrow { max-width: 820px; }
.page-intro { margin-bottom: 24px; }
.page-intro h1 { margin: 0 0 8px; font-size: 27px; }
.page-intro p { margin: 0; color: var(--muted); line-height: 1.55; }
.panel, .exam-card, .check-card, .admin-card {
  border: 1px solid var(--line); border-radius: 10px; background: #fffdfa; box-shadow: 0 4px 16px #4a2c280b;
  transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}
.panel { padding: 24px; }
.auth-layout { display: grid; grid-template-columns: 1fr 360px; gap: 22px; padding-top: 34px; }
.auth-copy { padding: 33px 10px 10px; }
.auth-copy h1 { max-width: 620px; margin: 0 0 13px; color: var(--deep-blue); font-size: 38px; line-height: 1.14; }
.auth-copy p { max-width: 620px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.feature-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-top: 25px; }
.feature-list span { padding: 15px; border-radius: 8px; color: #6b5d58; background: #fffdfa; box-shadow: 0 3px 14px #4a2c280d; font-size: 13px; animation: rise-in .35s ease both; }
.feature-list span:nth-child(2) { animation-delay: .05s; }
.feature-list span:nth-child(3) { animation-delay: .1s; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.auth-tabs button { border: 0; padding: 10px 12px; color: var(--muted); background: transparent; }
.auth-tabs button.active { border-bottom: 2px solid var(--blue); color: var(--blue); font-weight: 700; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { color: #526176; font-size: 12px; font-weight: 700; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid #d9cfca; border-radius: 5px; padding: 10px; color: var(--text); background: #fffefa;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: #ca6a70; background: #fff; box-shadow: 0 0 0 3px #b6202a18; outline: none; }
.field textarea { min-height: 78px; resize: vertical; }
.form-note, .muted { color: var(--muted); font-size: 12px; line-height: 1.55; }
.form-message { min-height: 17px; margin: 8px 0; color: var(--danger); font-size: 12px; }
.primary-button, .secondary-button, .ghost-button, .danger-button {
  border-radius: 5px; padding: 9px 14px; font-size: 13px;
}
.primary-button { border: 1px solid var(--blue); color: #fff; background: var(--blue); }
.secondary-button { border: 1px solid var(--blue); color: var(--blue); background: #fffdfa; }
.ghost-button { border: 1px solid var(--line); color: #6e615e; background: #fffdfa; }
.danger-button { border: 1px solid #e8b7b7; color: #b63d3d; background: #fff8f8; }
.primary-button:not(:disabled):hover, .nav-buttons button:not(:disabled):hover { background: var(--deep-blue); box-shadow: 0 5px 11px #8f172024; transform: translateY(-1px); }
.secondary-button:not(:disabled):hover, .ghost-button:not(:disabled):hover, .exit-button:hover, .header-link:hover { background: #fff4f1; box-shadow: 0 4px 9px #8f172015; transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: .45; }
.full-width { width: 100%; }
.admin-entry { margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; }
.admin-entry button { border: 0; color: var(--blue); background: transparent; font-size: 12px; }
.landing-main { max-width: 1180px; margin: 0 auto; padding: 44px 24px 62px; animation: rise-in .32s ease both; }
.landing-hero { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: stretch; }
.landing-copy { padding: 46px 36px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(135deg, #fffdfa 0%, #f7eee8 100%); box-shadow: 0 18px 42px #4a2c2810; }
.eyebrow { margin: 0 0 14px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.landing-copy h1 { max-width: 720px; margin: 0 0 16px; color: var(--deep-blue); font-size: 44px; line-height: 1.08; letter-spacing: -.04em; }
.landing-copy p { max-width: 720px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 13px; }
.download-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; text-decoration: none; }
.disabled-link { pointer-events: none; opacity: .52; filter: grayscale(.15); }
.download-panel { padding: 26px; border: 1px solid #e4c6c1; border-radius: 18px; background: #fffdfa; box-shadow: 0 12px 30px #4a2c280d; animation: rise-in .38s ease both; }
.download-logo { width: 62px; height: 62px; border-radius: 50%; box-shadow: 0 7px 18px #8f172026; }
.download-panel h2 { margin: 22px 0 12px; color: var(--deep-blue); font-size: 22px; }
.download-panel ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.download-panel li { position: relative; padding-left: 20px; color: #62534f; font-size: 14px; line-height: 1.45; }
.download-panel li::before { position: absolute; top: 7px; left: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); content: ""; }
.landing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.landing-grid article { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fffdfa; box-shadow: 0 7px 20px #4a2c280a; animation: rise-in .34s ease both; }
.landing-grid article:nth-child(2) { animation-delay: .04s; }
.landing-grid article:nth-child(3) { animation-delay: .08s; }
.landing-grid article:nth-child(4) { animation-delay: .12s; }
.landing-grid strong { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; background: var(--blue); font-size: 13px; }
.landing-grid h3 { margin: 13px 0 7px; font-size: 16px; }
.landing-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.verification-box { padding: 16px; border: 1px solid #e2b8b4; border-radius: 8px; background: #fff7f4; }
.demo-code { margin: 14px 0; color: var(--deep-blue); font-size: 25px; font-weight: 800; letter-spacing: .2em; text-align: center; }
.exam-list { display: grid; gap: 14px; }
.exam-card { display: flex; align-items: center; justify-content: space-between; padding: 20px; animation: rise-in .32s ease both; }
.exam-card:nth-child(2) { animation-delay: .06s; }
.exam-card:hover, .check-card:hover, .admin-card:hover { border-color: #e2b8b4; box-shadow: 0 9px 20px #4a2c2812; transform: translateY(-2px); }
.exam-card h2 { margin: 0 0 7px; font-size: 18px; }
.exam-card p { margin: 0; color: var(--muted); font-size: 13px; }
.exam-meta { gap: 14px; margin-top: 12px; color: #607086; font-size: 12px; }
.stepper { justify-content: center; gap: 8px; margin-bottom: 24px; }
.step { padding: 8px 12px; border-radius: 20px; color: #81736f; background: #eee8e2; font-size: 12px; transition: background-color .2s ease, color .2s ease, transform .2s ease; }
.step.active { color: #fff; background: var(--blue); }
.step.done { color: #237a4a; background: #def4e8; }
.check-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 17px 0; }
.check-card { min-height: 178px; padding: 16px; }
.check-card h3 { margin: 0 0 8px; font-size: 15px; }
.check-card p { min-height: 39px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.device-label { display: block; margin-bottom: 5px; color: #526176; font-size: 11px; font-weight: 800; }
.device-select { width: 100%; min-height: 35px; border: 1px solid #d9cfca; border-radius: 5px; padding: 7px 9px; color: var(--text); background: #fffefa; font-size: 12px; }
.device-select:focus { border-color: #ca6a70; box-shadow: 0 0 0 3px #b6202a18; outline: none; }
.device-scan-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; padding: 12px 14px; border: 1px solid #e2b8b4; border-radius: 8px; background: #fff7f4; animation: settle-in .25s ease both; }
.device-scan-bar strong { display: block; color: var(--deep-blue); font-size: 13px; }
.device-scan-bar p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.check-status { display: block; margin: 11px 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.check-status.pass { color: var(--green); animation: settle-in .25s ease both; }
.preflight-video { width: 100%; height: 130px; border-radius: 6px; background: #1f2c40; object-fit: cover; }
.button-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.qr-layout { display: grid; grid-template-columns: 230px 1fr; gap: 25px; align-items: center; }
.qr-box { width: 230px; height: 230px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.qr-box img { width: 100%; height: 100%; }
.pair-code { color: var(--deep-blue); font-size: 22px; font-weight: 800; letter-spacing: .12em; }
.success-banner { padding: 11px 13px; border-radius: 6px; color: #237a4a; background: #e4f7ec; font-size: 13px; animation: settle-in .25s ease both; }
.terms-card { display: grid; gap: 10px; margin: 14px 0; padding: 16px; border: 1px solid #e2b8b4; border-radius: 8px; background: #fff7f4; color: #5f5551; font-size: 13px; line-height: 1.55; }
.terms-card p { margin: 0; }
.terms-check { display: flex; align-items: flex-start; gap: 9px; padding: 12px 0; color: var(--deep-blue); font-size: 13px; font-weight: 700; }
.terms-check input { margin-top: 2px; accent-color: var(--red); }
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 72px); }
.admin-nav { flex-direction: column; align-items: stretch; gap: 5px; padding: 20px 14px; border-right: 1px solid var(--line); background: #f7f3ee; }
.admin-nav strong { margin: 0 8px 15px; color: var(--deep-blue); }
.admin-nav button { border: 0; border-radius: 5px; padding: 10px; color: #5c697b; background: transparent; text-align: left; }
.admin-nav button.active { color: var(--deep-blue); background: #f7e4e1; font-weight: 700; }
.admin-workspace { padding: 25px; animation: rise-in .28s ease both; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.admin-toolbar h1 { margin: 0; font-size: 23px; }
.admin-card { margin-bottom: 12px; padding: 17px; }
.admin-card h3 { margin: 0 0 7px; font-size: 16px; }
.admin-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.admin-card-actions { display: flex; gap: 8px; margin-top: 13px; }
.submission-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.submission-summary div { min-width: 0; padding: 10px; border-radius: 6px; background: #fff7f4; }
.submission-summary strong, .submission-summary span { display: block; overflow-wrap: anywhere; }
.submission-summary strong { margin-bottom: 4px; color: var(--deep-blue); font-size: 12px; }
.submission-summary span { color: var(--muted); font-size: 12px; }
.media-grid { display: grid; grid-template-columns: repeat(2, minmax(240px, 1fr)); gap: 12px; }
.media-card { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fffdfa; }
.media-card strong, .media-card span { display: block; }
.media-card strong { color: var(--deep-blue); text-transform: capitalize; }
.media-card span { margin: 4px 0 8px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.media-card video, .media-card audio { width: 100%; max-height: 220px; border-radius: 6px; background: #1f2c40; }
.answer-review { margin: 10px 0; padding: 13px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; background: #fffdfa; }
.answer-review.correct { border-left-color: var(--green); }
.answer-review.wrong { border-left-color: var(--red); }
.answer-review h3 { margin: 0 0 6px; font-size: 14px; }
.answer-review p { margin: 0 0 8px; color: var(--text); font-size: 13px; line-height: 1.5; }
.event-list { margin: 0; padding: 0; list-style: none; }
.event-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.event-list strong { color: var(--deep-blue); }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.editor-grid .wide { grid-column: 1 / -1; }
.question-preview-image { max-width: 220px; max-height: 120px; margin-top: 8px; border: 1px solid var(--line); border-radius: 4px; }
.exam-layout { display: grid; grid-template-columns: 286px 1fr; min-height: calc(100vh - 68px); }
.sidebar { padding: 17px; border-right: 1px solid var(--line); background: var(--sidebar); }
.candidate-card { gap: 11px; margin-bottom: 18px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #fff; background: var(--blue); }
.candidate-card p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.side-section { margin-top: 16px; }
.section-heading { justify-content: space-between; margin-bottom: 10px; }
.section-heading h2 { margin: 0; font-size: 15px; }
.section-heading span { color: var(--muted); font-size: 12px; }
.progress-track { overflow: hidden; height: 5px; margin-bottom: 12px; border-radius: 9px; background: #e2e7ef; }
#progress-fill { width: 0; height: 100%; background: var(--green); transition: width .3s ease; }
.question-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.question-cell { position: relative; height: 31px; border: 1px solid #ded5d1; border-radius: 3px; color: #71635f; background: #fffdfa; font-size: 12px; }
.question-cell:not(:disabled):hover { border-color: #d3918e; background: #fff4f1; transform: translateY(-1px); }
.question-cell.answered { border-color: #8dd2ad; color: #237a4a; background: #e4f7ec; }
.question-cell.current { border-color: var(--blue); color: #fff; background: var(--blue); }
.question-cell.flagged::after { position: absolute; top: -4px; right: -3px; width: 8px; height: 8px; border: 1px solid #fff; border-radius: 50%; background: var(--amber); content: ""; }
.legend { flex-wrap: wrap; gap: 8px 12px; margin-top: 13px; color: var(--muted); font-size: 11px; }
.legend-box { display: inline-block; width: 9px; height: 9px; margin-right: 4px; border: 1px solid #d7ceca; background: #fffdfa; }
.legend-box.answered { border-color: #8dd2ad; background: #e4f7ec; }.legend-box.current { border-color: var(--blue); background: var(--blue); }.legend-box.flagged { border-color: var(--amber); background: var(--amber); }
.camera-section { padding-top: 16px; border-top: 1px solid var(--line); }
.camera-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 9px; }
.camera-tile { position: relative; overflow: hidden; height: 70px; border-radius: 4px; background: #233048; }
.camera-tile video { width: 100%; height: 100%; object-fit: cover; }
.camera-tile span { position: absolute; right: 0; bottom: 0; left: 0; padding: 3px; color: #fff; background: #0008; font-size: 9px; text-align: center; }
.phone-camera-sim { display: grid; height: 100%; place-items: center; align-content: center; gap: 4px; color: #eaf7ee; background: radial-gradient(circle at 50% 35%, #355070, #202b40 70%); font-size: 11px; }
.phone-camera-sim .status-dot { width: 9px; height: 9px; margin: 0; }
.integrity-panel { margin-top: 16px; padding: 11px; border-left: 3px solid var(--blue); background: #faeae7; font-size: 12px; }
.integrity-panel p { margin: 5px 0 0; color: #705c58; line-height: 1.45; }
.integrity-panel ul { display: grid; gap: 5px; margin: 9px 0 0; padding: 0; list-style: none; }
.integrity-panel li { display: flex; justify-content: space-between; gap: 8px; color: #8f1720; font-size: 11px; text-transform: capitalize; }
.integrity-panel li span { color: #8b7b76; text-transform: none; }
.workspace { display: flex; min-width: 0; flex-direction: column; }
.question-toolbar { min-height: 59px; padding: 0 25px; border-bottom: 1px solid var(--line); background: #fffdfa; }
.flag-button { width: 120px; border: 0; color: #5e6c80; background: transparent; text-align: left; }
#flag-icon { color: var(--amber); font-size: 24px; vertical-align: -2px; }
.question-position { color: #69768a; font-size: 14px; }
.nav-buttons { gap: 7px; margin: auto; }
.nav-buttons button, .submit-button { border: 0; border-radius: 4px; padding: 9px 18px; color: #fff; background: var(--blue); box-shadow: 0 1px 2px #8f172044; font-size: 13px; }
.zoom-controls { display: flex; width: 120px; justify-content: flex-end; gap: 2px; }
.zoom-controls button { border: 0; padding: 6px 8px; color: var(--deep-blue); background: transparent; font-size: 19px; font-weight: 700; }
.instruction-bar { padding: 10px 26px; border-bottom: 1px solid #e5dcd7; color: #74645f; background: #faf6f1; font-size: calc(13px * var(--question-scale)); }
.question-card { flex: 1; padding: 24px 31px; font-size: calc(16px * var(--question-scale)); animation: fade-in .2s ease both; }
.question-type { color: var(--blue); font-size: .78em; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.question-card h1 { max-width: 1100px; margin: 13px 0 19px; font-size: 1.03em; font-weight: 500; line-height: 1.8; }
.answers { display: grid; grid-template-columns: repeat(2, minmax(270px, 1fr)); gap: 22px 45px; max-width: 1140px; margin-top: 26px; }
.answer-label { display: flex; gap: 9px; align-items: flex-start; padding: 12px 13px; border: 1px solid transparent; border-radius: 5px; line-height: 1.45; transition: .15s ease; }
.answer-label:hover { border-color: #e0b5b1; background: #fff8f5; }.answer-label:has(input:checked) { border-color: #d6928f; background: #fbece9; }.answer-label input { margin-top: 4px; accent-color: var(--blue); }
.diagram { width: 300px; height: 124px; margin: 9px 0 16px 38px; text-align: center; }
.disc { position: relative; width: 280px; height: 72px; border: 3px solid #637087; border-radius: 50%; background: #f7f9fc; }.axis { position: absolute; top: -18px; left: 136px; width: 7px; height: 119px; border-radius: 4px; background: #637087; }
.object { position: absolute; top: 22px; z-index: 1; font-weight: 700; }.object::after { display: inline-block; width: 17px; height: 17px; margin-left: 4px; border: 2px solid #637087; content: ""; vertical-align: -3px; }.object-b { left: 56px; }.object-a { right: 49px; }.omega { display: inline-block; margin-top: 8px; color: #596579; font-weight: 600; }
.workspace-footer { display: flex; align-items: center; justify-content: space-between; padding: 16px 25px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }.submit-button { background: var(--green); }
dialog { border: 0; border-radius: 9px; box-shadow: 0 18px 50px #1b2b4455; animation: dialog-in .22s ease both; } dialog::backdrop { background: #1d2a3c66; animation: fade-in .18s ease both; }.dialog-content { width: 340px; padding: 8px 12px 13px; text-align: center; }.dialog-content p { color: var(--muted); line-height: 1.6; }.dialog-actions { display: flex; justify-content: center; gap: 9px; margin-top: 14px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes settle-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(7px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes status-pulse { 0%, 100% { box-shadow: 0 0 0 0 #68e69b00; } 50% { box-shadow: 0 0 0 4px #68e69b30; } }
@media (max-width: 1180px) { .exam-layout { grid-template-columns: 255px 1fr; }.answers { grid-template-columns: 1fr; gap: 7px; }.landing-hero { grid-template-columns: 1fr; }.landing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
