:root {
  --bb-blue: #073763;
  --bb-blue-2: #1e5d94;
  --bb-orange: #f3a51b;
  --bb-bg: #eef1f4;
  --bb-surface: #ffffff;
  --bb-surface-2: #f8fafc;
  --bb-line: #c6cbd1;
  --bb-soft: #f7f8f9;
  --bb-text: #222222;
  --bb-muted: #666666;
  --bb-green: #2f7d32;
  --bb-red: #a12618;
  --bb-yellow: #fff8df;
  --shadow: 0 8px 25px rgba(0,0,0,.18);
}

body.theme-dark {
  --bb-blue: #081f35;
  --bb-blue-2: #123b5e;
  --bb-orange: #f0a91c;
  --bb-bg: #111820;
  --bb-surface: #1b2530;
  --bb-surface-2: #202c38;
  --bb-line: #354656;
  --bb-soft: #263341;
  --bb-text: #edf2f7;
  --bb-muted: #b7c1cc;
  --bb-yellow: #332a12;
  --shadow: 0 10px 28px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bb-bg);
  color: var(--bb-text);
  font-size: 13px;
}
button, input, select, textarea { font-family: Arial, Helvetica, sans-serif; }
button { color: inherit; }
a { color: inherit; }
code { background: var(--bb-soft); border: 1px solid var(--bb-line); padding: 2px 5px; }

[hidden] { display: none !important; }

.code-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bb-bg);
  padding: 24px;
}
.access-card {
  width: 860px;
  max-width: 100%;
  background: var(--bb-surface);
  border: 1px solid var(--bb-line);
  box-shadow: var(--shadow);
}
.access-top {
  min-height: 54px;
  background: var(--bb-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 4px solid var(--bb-orange);
}
.access-top strong { font-size: 18px; }
.access-top span { font-size: 12px; opacity: .88; }
.access-body { display: grid; grid-template-columns: 1.1fr 340px; }
.access-info {
  padding: 28px 30px;
  border-right: 1px solid var(--bb-line);
  background: var(--bb-surface-2);
}
.access-info h1 { font-size: 24px; margin: 0 0 12px; color: var(--bb-blue-2); font-weight: 600; }
.access-info p { line-height: 1.55; margin: 0 0 14px; color: var(--bb-text); }
.access-note {
  border-left: 5px solid var(--bb-orange);
  background: var(--bb-surface);
  padding: 12px 14px;
  line-height: 1.45;
  color: var(--bb-text);
  margin-bottom: 16px;
}
.available-box {
  border: 1px solid var(--bb-line);
  background: var(--bb-surface);
  padding: 12px 14px;
}
.available-box ul { margin: 8px 0 0 18px; padding: 0; line-height: 1.7; }
.access-form { padding: 28px 26px; background: var(--bb-surface); }
.access-form h2 { font-size: 18px; margin: 0 0 6px; color: var(--bb-blue-2); }
.access-form p { margin: 0 0 18px; color: var(--bb-muted); }
label { display: block; font-weight: bold; margin: 0 0 6px; color: var(--bb-text); }
select, input, textarea {
  width: 100%;
  border: 1px solid #aeb7c2;
  border-radius: 0;
  padding: 9px;
  background: var(--bb-surface);
  font-size: 13px;
  color: var(--bb-text);
  outline: none;
}
body.theme-dark select,
body.theme-dark input,
body.theme-dark textarea { border-color: var(--bb-line); }
textarea { min-height: 140px; line-height: 1.45; resize: vertical; }
select:focus, input:focus, textarea:focus { border-color: var(--bb-blue-2); box-shadow: 0 0 0 2px rgba(46,109,164,.15); }
.field { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--bb-muted); margin-top: 5px; }
.error { display:none; margin-top: 10px; background: #fff0ed; border:1px solid #efb6ad; color: var(--bb-red); padding:9px; }
body.theme-dark .error { background: #3b1d19; border-color: #7c352d; }

.btn {
  border: 1px solid #8f98a3;
  background: var(--bb-soft);
  color: var(--bb-text);
  padding: 7px 13px;
  min-height: 31px;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:hover { filter: brightness(.96); }
.btn-primary { background: var(--bb-blue-2); border-color: var(--bb-blue-2); color: white; }
.btn-submit { background: var(--bb-orange); border-color: #d68900; color: #222; }
.btn-submit:hover { background: #df8f00; color: white; }
.btn-danger { background: #b3261e; border-color: #8d1d17; color: white; }
.btn-ghost { background: transparent; border-color: var(--bb-line); color: var(--bb-blue-2); margin-top: 8px; }
.full { width: 100%; }

.bb-app { min-height: 100vh; }
.bb-header { background: var(--bb-blue); color: white; border-bottom: 4px solid var(--bb-orange); }
.bb-header-inner { max-width: 1280px; margin: 0 auto; padding: 10px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.bb-brand { font-size: 18px; font-weight: bold; }
.bb-brand small { display: block; font-size: 11px; font-weight: normal; opacity: .82; margin-top: 2px; }
.bb-user { font-size: 12px; text-align: right; line-height: 1.35; }
.tabs { background: var(--bb-blue-2); border-bottom: 1px solid #123b5e; }
.tabs-inner { max-width: 1280px; margin: 0 auto; display: flex; gap: 1px; padding: 0 18px; }
.tab { color: white; text-decoration: none; padding: 10px 15px; background: rgba(0,0,0,.12); font-size: 12px; }
.tab.active { background: var(--bb-surface); color: var(--bb-blue-2); font-weight: bold; }
.page { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 235px 1fr; gap: 14px; padding: 14px 18px 82px; }
.course-menu { background: var(--bb-surface); border: 1px solid var(--bb-line); height: max-content; }
.course-title { background: var(--bb-soft); border-bottom:1px solid var(--bb-line); padding:12px; color: var(--bb-blue-2); font-weight:bold; line-height:1.35; }
.course-list { list-style:none; margin:0; padding:0; }
.course-list li { border-bottom:1px solid var(--bb-line); padding:9px 12px; color: var(--bb-text); background: var(--bb-surface); }
.course-list li.active { background: var(--bb-surface-2); border-left:5px solid var(--bb-orange); padding-left:7px; color:var(--bb-blue-2); font-weight:bold; }
.course-list li.muted { color:var(--bb-muted); background:var(--bb-soft); }
.help-box { padding:12px; line-height:1.45; color: var(--bb-muted); font-size:12px; background: var(--bb-surface-2); }
.content { min-width:0; }
.breadcrumbs { font-size:12px; color:var(--bb-muted); margin:0 0 10px; }
.breadcrumbs span { color: var(--bb-blue-2); }
.test-wrap { display:grid; grid-template-columns:minmax(0,1fr) 245px; gap:14px; align-items:start; }
.test-main { background: var(--bb-surface); border:1px solid var(--bb-line); }
.page-title { padding:14px 16px; border-bottom:1px solid var(--bb-line); background: var(--bb-surface); }
.page-title h1 { margin:0; color:var(--bb-text); font-size:21px; font-weight:normal; }
.page-title p { margin:6px 0 0; color:var(--bb-muted); font-size:12px; }
.info-section { border-bottom:1px solid var(--bb-line); background:var(--bb-soft); }
.section-head { padding:10px 14px; border-bottom:1px solid var(--bb-line); font-weight:bold; color:var(--bb-text); background: var(--bb-soft); }
.section-body { padding:12px 14px; line-height:1.5; background: var(--bb-surface); }
.section-body ol { margin:6px 0 0 20px; padding:0; }
.status-row { display:grid; grid-template-columns:180px 1fr; border-top:1px solid var(--bb-line); }
.status-row div { padding:8px 10px; }
.status-row div:first-child { background:var(--bb-soft); font-weight:bold; color:var(--bb-text); border-right:1px solid var(--bb-line); }
.question-card { border-top:1px solid var(--bb-line); background:var(--bb-surface); }
.question-head { display:flex; justify-content:space-between; align-items:center; gap:12px; background:var(--bb-soft); border-bottom:1px solid var(--bb-line); padding:9px 12px; }
.question-head strong { font-size:14px; }
.points { font-size:12px; color:var(--bb-muted); }
.question-body { padding:14px; }
.statement { line-height:1.55; margin:0 0 14px; font-size:13px; white-space: pre-wrap; }
.choice { display:grid; grid-template-columns:22px 24px 1fr; gap:6px; align-items:start; margin:8px 0; padding:6px; border:1px solid transparent; cursor:pointer; }
.choice:hover { border-color:var(--bb-line); background:var(--bb-surface-2); }
.choice.selected { border-color:#92b4d6; background:#eef6fc; color:#222; }
body.theme-dark .choice.selected { background:#183553; color:#edf2f7; }
.radio { width:14px; height:14px; border:1px solid #888; border-radius:50%; background:white; margin-top:1px; position:relative; }
.choice.selected .radio:after { content:""; position:absolute; width:6px; height:6px; background:#333; border-radius:50%; top:3px; left:3px; }
.letter { font-weight:bold; color:var(--bb-text); text-transform: uppercase; }
.essay-label { font-weight:bold; margin-bottom:6px; color:var(--bb-text); }
.save-note { margin-top:10px; background:var(--bb-soft); border:1px solid var(--bb-line); padding:9px; color:var(--bb-muted); font-size:12px; }
.bottom-actions { position:fixed; left:0; right:0; bottom:0; background:var(--bb-surface); border-top:1px solid var(--bb-line); box-shadow:0 -2px 9px rgba(0,0,0,.12); z-index:30; }
.bottom-inner { max-width:1280px; margin:0 auto; padding:11px 18px; display:flex; justify-content:space-between; gap:12px; align-items:center; }
.save-status { font-size:12px; color:var(--bb-muted); line-height:1.35; }
.save-status strong { color:var(--bb-text); }
.buttons { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.side-panel { background:var(--bb-surface); border:1px solid var(--bb-line); height:max-content; }
.side-title { padding:10px 12px; background:var(--bb-soft); border-bottom:1px solid var(--bb-line); font-weight:bold; }
.completion { padding:12px; }
.completion p { margin:0 0 10px; color:var(--bb-muted); line-height:1.4; }
.timer-box { border:1px solid var(--bb-line); background:var(--bb-soft); padding:8px; margin-bottom:10px; color:var(--bb-text); }
.qstatus { display:grid; grid-template-columns:repeat(5,1fr); gap:6px; }
.qbox { height:30px; border:1px solid #aeb7c2; background:var(--bb-surface); color:var(--bb-text); cursor:pointer; font-size:12px; }
.qbox.current { background:var(--bb-blue-2); color:white; border-color:var(--bb-blue-2); }
.qbox.done:not(.current) { background:#dff0d8; border-color:#9ac18d; color:#245b22; font-weight:bold; }
body.theme-dark .qbox.done:not(.current) { background:#1d3e25; color:#cdf7d1; border-color:#3b7342; }
.legend { margin-top:12px; font-size:12px; color:var(--bb-muted); line-height:1.6; }
.legend span { display:flex; gap:6px; align-items:center; }
.mini { width:12px; height:12px; border:1px solid #aeb7c2; background:var(--bb-surface); display:inline-block; }
.mini.done { background:#dff0d8; }
.mini.current { background:var(--bb-blue-2); }
.modal { position:fixed; inset:0; background:rgba(0,0,0,.48); z-index:80; display:flex; align-items:center; justify-content:center; padding:18px; }
.modal-card { width:560px; max-width:100%; background:var(--bb-surface); border:1px solid #9fa8b2; box-shadow:0 16px 35px rgba(0,0,0,.35); }
.modal-head { background:var(--bb-blue); color:white; padding:12px 16px; border-bottom:4px solid var(--bb-orange); }
.modal-head h2 { margin:0; font-size:18px; }
.modal-body { padding:16px; line-height:1.5; }
.modal-list { border:1px solid var(--bb-line); margin:12px 0 0; }
.modal-line { display:flex; justify-content:space-between; gap:12px; padding:8px 10px; border-bottom:1px solid var(--bb-line); }
.modal-line:last-child { border-bottom:0; }
.modal-actions { display:flex; justify-content:flex-end; gap:8px; padding:0 16px 16px; }
.result-screen { min-height:100vh; background:var(--bb-bg); padding:22px; }
.result-card { max-width:1000px; margin:0 auto; background:var(--bb-surface); border:1px solid var(--bb-line); }
.result-head { background:var(--bb-blue); color:white; border-bottom:4px solid var(--bb-orange); padding:16px 18px; }
.result-head h1 { margin:0; font-size:20px; }
.result-body { padding:16px 18px; }
.review-meta { border:1px solid var(--bb-line); margin-bottom:16px; }
.review-meta .status-row { border-top:0; border-bottom:1px solid var(--bb-line); }
.review-meta .status-row:last-child { border-bottom:0; }
.result-question { border:1px solid var(--bb-line); margin-top:12px; }
.result-question h3 { margin:0; background:var(--bb-soft); border-bottom:1px solid var(--bb-line); padding:9px 11px; font-size:14px; }
.result-question div { padding:10px 11px; line-height:1.5; }
.ok { color:var(--bb-green); font-weight:bold; }
.wrong { color:var(--bb-red); font-weight:bold; }
.pending { color:#7a5300; font-weight:bold; }
.right-actions { margin-top:16px; text-align:right; }

/* Admin */
.admin-page { min-height:100vh; }
.admin-header .admin-links a { color:white; font-size:12px; }
.admin-shell { max-width:1280px; margin:0 auto; padding:18px; }
.card { background:var(--bb-surface); border:1px solid var(--bb-line); box-shadow:0 2px 7px rgba(0,0,0,.04); }
.admin-intro { padding:18px; display:flex; justify-content:space-between; gap:18px; align-items:center; margin-bottom:14px; }
.admin-intro h1 { margin:0 0 6px; font-size:24px; color:var(--bb-blue-2); }
.admin-intro p { margin:0; max-width:760px; line-height:1.5; color:var(--bb-muted); }
.admin-badges { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
.admin-badges span { border:1px solid var(--bb-line); background:var(--bb-soft); padding:7px 9px; font-weight:bold; font-size:12px; }
.admin-grid { display:grid; grid-template-columns:230px 1fr; gap:14px; align-items:start; }
.admin-menu { padding:8px; display:grid; gap:6px; }
.admin-tab { text-align:left; border:1px solid var(--bb-line); background:var(--bb-soft); color:var(--bb-text); padding:10px; cursor:pointer; font-weight:bold; }
.admin-tab.active { background:var(--bb-blue-2); border-color:var(--bb-blue-2); color:white; }
.admin-content { min-width:0; }
.admin-panel { padding:18px; }
.admin-panel h2 { margin:0 0 14px; font-size:20px; color:var(--bb-blue-2); }
.admin-panel h3 { margin:22px 0 8px; font-size:16px; color:var(--bb-text); }
.dashboard-cards { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-bottom:16px; }
.metric { border:1px solid var(--bb-line); background:var(--bb-soft); padding:14px; }
.metric small { display:block; color:var(--bb-muted); margin-bottom:5px; }
.metric strong { font-size:24px; color:var(--bb-blue-2); }
.form-grid { display:grid; gap:12px; }
.form-grid.two { grid-template-columns:repeat(2,minmax(0,1fr)); }
.inline-form { display:grid; grid-template-columns:1fr auto; gap:8px; margin-bottom:14px; }
.list-block { display:grid; gap:8px; }
.list-item { border:1px solid var(--bb-line); background:var(--bb-soft); padding:10px; display:flex; justify-content:space-between; gap:12px; align-items:center; }
.list-item strong { color:var(--bb-text); }
.item-actions { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.toggle-row { margin:6px 0 16px; }
.toggle-row label { display:flex; gap:8px; align-items:center; font-weight:bold; }
.toggle-row input { width:auto; }
.question-builder { border:1px solid var(--bb-line); background:var(--bb-surface-2); padding:12px; margin-bottom:12px; }
.question-builder h4 { margin:0 0 10px; color:var(--bb-blue-2); font-size:14px; }
.options-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:8px; }
.form-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:14px; }
.table-wrap { overflow:auto; }
.admin-table { width:100%; border-collapse:collapse; font-size:13px; }
.admin-table th, .admin-table td { border:1px solid var(--bb-line); padding:9px; text-align:left; vertical-align:top; }
.admin-table th { background:var(--bb-soft); color:var(--bb-blue-2); }
.badge { display:inline-block; border:1px solid var(--bb-line); background:var(--bb-soft); padding:4px 6px; font-weight:bold; font-size:11px; }
.badge.ok-badge { background:#dff0d8; color:#245b22; border-color:#9ac18d; }
.badge.off-badge { background:#f7d7d4; color:#8d1d17; border-color:#efb6ad; }
.muted-text { color:var(--bb-muted); line-height:1.45; }
.data-actions { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.file-label input { display:none; }
.notice-block { border-left:5px solid var(--bb-orange); background:var(--bb-surface-2); padding:12px 14px; line-height:1.5; margin-bottom:12px; }
#dataPreview { min-height:300px; font-family:Consolas, Monaco, monospace; font-size:12px; }

@media (max-width: 950px) {
  .access-body { grid-template-columns:1fr; }
  .access-info { border-right:0; border-bottom:1px solid var(--bb-line); }
  .page { grid-template-columns:1fr; }
  .test-wrap { grid-template-columns:1fr; }
  .bottom-inner { flex-direction:column; align-items:stretch; }
  .buttons .btn { flex:1; }
  .tabs-inner { overflow:auto; }
  .tab { white-space:nowrap; }
  .admin-intro { flex-direction:column; align-items:flex-start; }
  .admin-grid { grid-template-columns:1fr; }
  .admin-menu { grid-template-columns:repeat(2,1fr); }
  .dashboard-cards, .form-grid.two, .options-grid { grid-template-columns:1fr; }
  .inline-form { grid-template-columns:1fr; }
  .status-row { grid-template-columns:1fr; }
  .status-row div:first-child { border-right:0; border-bottom:1px solid var(--bb-line); }
}

/* Production login and admin refinements */
.admin-header .admin-links { display:flex; align-items:center; gap:12px; }
.admin-header .admin-links a { color:white; font-size:12px; text-decoration:none; border:1px solid rgba(255,255,255,.3); padding:7px 10px; border-radius:6px; }
.admin-header .admin-links a:hover { background:rgba(255,255,255,.12); }

.login-page {
  min-height:100vh;
  background:
    radial-gradient(circle at top left, rgba(0, 92, 171, .18), transparent 34rem),
    linear-gradient(135deg, #edf4fb 0%, #f7fafc 48%, #eef2f6 100%);
  color:var(--bb-text);
}
.login-shell {
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
}
.login-panel {
  width:min(100%, 480px);
}
.login-brand {
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:22px;
}
.login-brand strong { display:block; color:var(--bb-blue-2); font-size:18px; }
.login-brand small { display:block; color:var(--bb-muted); margin-top:2px; }
.brand-mark {
  width:52px;
  height:52px;
  border-radius:16px;
  display:grid;
  place-items:center;
  background:var(--bb-blue-2);
  color:#fff;
  font-weight:800;
  box-shadow:0 12px 28px rgba(0, 92, 171, .22);
}
.login-copy { margin-bottom:16px; }
.login-copy .eyebrow {
  margin:0 0 8px;
  color:var(--bb-orange);
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
  font-size:12px;
}
.login-copy h1 {
  margin:0 0 8px;
  color:var(--bb-blue-2);
  font-size:30px;
  line-height:1.1;
}
.login-copy p { margin:0; color:var(--bb-muted); line-height:1.55; }
.login-form {
  padding:22px;
  border-radius:18px;
  box-shadow:0 18px 50px rgba(21, 35, 50, .12);
}
.login-form .field { margin-bottom:14px; }
.login-form input {
  height:44px;
  border-radius:10px;
  border:1px solid var(--bb-line);
  padding:0 12px;
  background:#fff;
}
.login-form input:focus {
  outline:3px solid rgba(0, 92, 171, .16);
  border-color:var(--bb-blue-2);
}
.login-alert {
  border:1px solid rgba(180, 35, 24, .26);
  background:#fff1f0;
  color:#9b1c13;
  padding:10px 12px;
  border-radius:10px;
  margin-bottom:14px;
  font-weight:700;
  line-height:1.4;
}
.login-alert.success {
  border-color:rgba(37, 125, 84, .28);
  background:#effaf3;
  color:#1f7a4d;
}
.login-footnote {
  margin:14px 0 0;
  text-align:center;
  color:var(--bb-muted);
  font-size:12px;
}
.btn:disabled {
  opacity:.65;
  cursor:not-allowed;
}

@media (max-width:700px) {
  .login-shell { padding:18px; align-items:start; padding-top:42px; }
  .login-copy h1 { font-size:25px; }
  .admin-header .admin-links { flex-wrap:wrap; justify-content:flex-end; }
}

/* Production exam list and custom code modal */
.access-body-single {
  display: block;
}

.access-info.wide {
  width: 100%;
}

.exam-list-card {
  max-width: 1120px;
}

.exam-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 12px;
  flex-wrap: wrap;
}

.exam-list-toolbar span {
  color: var(--muted, #64748b);
  font-weight: 700;
}

.exam-table {
  display: grid;
  gap: 12px;
}

.exam-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(250px, auto) 58px;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.theme-dark .exam-row {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(148, 163, 184, 0.22);
}

.exam-row-main {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.exam-row-main strong,
.exam-row-main span {
  display: block;
}

.exam-row-main strong {
  color: var(--text, #0f172a);
  font-size: 1rem;
}

.exam-row-main span {
  margin-top: 4px;
  color: var(--muted, #64748b);
  font-size: 0.9rem;
}

.exam-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.10);
  flex: 0 0 auto;
}

.exam-row-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.exam-row-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--muted, #64748b);
  font-size: 0.82rem;
  font-weight: 700;
}

.theme-dark .exam-row-meta span {
  background: rgba(255, 255, 255, 0.08);
}

.play-btn {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
  transition: transform 160ms ease, filter 160ms ease;
}

.play-btn:hover {
  transform: translateY(-1px) scale(1.02);
  filter: brightness(1.04);
}

.play-btn span {
  transform: translateX(1px);
  font-size: 1.05rem;
}

.empty-state {
  padding: 20px;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted, #64748b);
}

.code-modal-card {
  max-width: 520px;
}

.error.visible-soft {
  display: block;
  margin-top: 10px;
}

.error[hidden] {
  display: none !important;
}

.choice.correct-choice {
  border-color: rgba(22, 163, 74, 0.8);
  background: rgba(22, 163, 74, 0.12);
}

.choice.wrong-choice {
  border-color: rgba(220, 38, 38, 0.8);
  background: rgba(220, 38, 38, 0.10);
}

.choice.disabled-choice {
  cursor: default;
}

.feedback-box {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 0.94rem;
}

.feedback-box.ok-feedback {
  border-color: rgba(22, 163, 74, 0.45);
  background: rgba(22, 163, 74, 0.10);
}

.feedback-box.wrong-feedback {
  border-color: rgba(220, 38, 38, 0.45);
  background: rgba(220, 38, 38, 0.10);
}

.hint {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--muted, #64748b);
}

@media (max-width: 820px) {
  .exam-row {
    grid-template-columns: 1fr 54px;
  }

  .exam-row-meta {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .exam-row {
    grid-template-columns: 1fr;
  }

  .play-btn {
    width: 100%;
    border-radius: 14px;
  }
}

/* Production v3: stable no-redirect auth and ProvaFácil-style original SaaS polish */
:root {
  --brand-blue:#0b5cab;
  --brand-blue-dark:#073b73;
  --brand-green:#16a36a;
  --brand-bg:#f4f7fb;
  --brand-card:#ffffff;
  --brand-border:#d9e2ec;
  --brand-text:#102033;
  --brand-muted:#63758b;
}
body { background: var(--brand-bg); }
.student-portal {
  min-height:100vh;
  padding:24px;
  background:
    radial-gradient(circle at 10% 0%, rgba(11,92,171,.18), transparent 32rem),
    linear-gradient(145deg, #f7fbff 0%, #eff5fb 50%, #f8fafc 100%);
}
.portal-topbar {
  width:min(1180px, 100%);
  margin:0 auto 18px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.portal-brand { display:flex; align-items:center; gap:10px; color:var(--brand-blue-dark); }
.portal-brand strong { font-size:19px; }
.brand-mark.small { width:38px; height:38px; border-radius:12px; font-size:13px; }
.pro-student-card {
  width:min(1180px, 100%);
  margin:auto;
  border:1px solid rgba(150,165,185,.35);
  box-shadow:0 24px 80px rgba(15,35,65,.12);
  border-radius:24px;
  overflow:hidden;
}
.pro-student-card .access-info { padding:36px; }
.pro-student-card h1 { font-size:clamp(28px, 4vw, 46px); color:var(--brand-blue-dark); margin-bottom:10px; }
.portal-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:24px 0; }
.portal-stats div { background:#f7fbff; border:1px solid var(--brand-border); padding:14px; border-radius:16px; }
.portal-stats strong { display:block; color:var(--brand-blue-dark); font-size:18px; }
.portal-stats span { display:block; color:var(--brand-muted); margin-top:4px; font-size:13px; }
.pro-exam-table { margin-top:18px; }
.exam-row { border-radius:18px; background:#fff; border:1px solid #dbe5ef; }
.exam-row:hover { transform:translateY(-1px); box-shadow:0 18px 40px rgba(15,35,65,.10); }
.exam-icon { background:linear-gradient(135deg, rgba(11,92,171,.12), rgba(22,163,106,.10)); color:var(--brand-blue-dark); }
.play-btn { background:linear-gradient(135deg, var(--brand-green), #0d8d5a); box-shadow:0 12px 26px rgba(22,163,106,.28); }
.play-btn:hover { filter:brightness(.98); transform:scale(1.03); }

.admin-login-shell {
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
  background:
    radial-gradient(circle at top left, rgba(11,92,171,.18), transparent 30rem),
    linear-gradient(135deg, #eef6ff, #f8fafc 55%, #eef5f0);
}
.admin-login-card {
  width:min(100%, 520px);
  padding:30px;
  border-radius:24px;
  box-shadow:0 25px 80px rgba(15,35,65,.16);
}
.pro-topbar { background:linear-gradient(90deg, var(--brand-blue-dark), var(--brand-blue)); }
.logout-link {
  color:white;
  background:transparent;
  border:1px solid rgba(255,255,255,.35);
  padding:7px 10px;
  border-radius:6px;
  font-size:12px;
  cursor:pointer;
}
.logout-link:hover { background:rgba(255,255,255,.12); }
.pro-admin-shell { max-width:1280px; }
.hero-admin-card {
  border:0;
  background:linear-gradient(135deg, #fff, #f4f9ff);
  border-left:6px solid var(--brand-green);
}
.hero-admin-card h1 { color:var(--brand-blue-dark); margin-bottom:8px; }
.pro-admin-grid { grid-template-columns:240px minmax(0,1fr); }
.pro-sidebar {
  padding:14px;
  background:#fff;
  position:sticky;
  top:18px;
  align-self:start;
}
.sidebar-section-title {
  font-weight:800;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--brand-muted);
  margin:4px 4px 10px;
}
.pro-sidebar .admin-tab {
  border-radius:12px;
  border:0;
  background:transparent;
  color:var(--brand-text);
  padding:12px;
}
.pro-sidebar .admin-tab.active {
  background:linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
  color:#fff;
}
.admin-panel.card { border-radius:18px; box-shadow:0 14px 40px rgba(15,35,65,.07); }
.metric { border-radius:16px; background:#f8fbff; }
.metric strong { color:var(--brand-blue); }
.admin-table th { background:#f2f7fc; color:var(--brand-blue-dark); }
.login-form { background:#fff; }
.login-form.full, .btn.full { width:100%; justify-content:center; margin-top:8px; }

@media (max-width: 800px) {
  .student-portal { padding:14px; }
  .pro-student-card .access-info { padding:22px; }
  .portal-stats { grid-template-columns:1fr; }
  .exam-row { grid-template-columns:1fr; align-items:start; }
  .exam-row-meta { justify-content:flex-start; }
  .play-btn { width:100%; height:46px; }
  .pro-admin-grid { grid-template-columns:1fr; }
  .pro-sidebar { position:static; }
}

/* =========================================================
   V4 - Student portal layout inspired by the provided HTML
   ========================================================= */
body.student-home-page {
  background: #f3f6fb;
  min-height: 100vh;
  font-family: 'Nunito', 'Montserrat', Arial, sans-serif;
}
.student-shell {
  min-height: 100vh;
  background: #f4f7fb;
  color: #243246;
}
.pf-top-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: #ffffff;
  border-bottom: 1px solid #dbe5ef;
  display: flex;
  align-items: center;
  z-index: 60;
  box-shadow: 0 2px 8px rgba(30, 50, 80, .06);
}
.pf-menu-button {
  width: 52px;
  height: 50px;
  border: 0;
  background: #ffffff;
  color: #2f6b96;
  font-size: 22px;
  border-right: 1px solid #e6edf5;
  cursor: pointer;
}
.pf-top-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  height: 100%;
  color: #2f6b96;
  font-weight: 800;
  letter-spacing: .2px;
  padding: 0 18px;
}
.pf-profile-button {
  margin-left: auto;
  margin-right: 16px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: linear-gradient(135deg, #316181, #62a6cb);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(49, 97, 129, .25);
}
.pf-side-menu {
  position: fixed;
  top: 50px;
  left: 0;
  bottom: 0;
  width: 250px;
  background: #ffffff;
  border-right: 1px solid #d7e2ee;
  z-index: 50;
  box-shadow: 4px 0 22px rgba(30, 50, 80, .08);
}
.pf-side-logo {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-decoration: none;
  color: #2f6b96;
  border-bottom: 1px solid #e6edf5;
}
.pf-logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #316181, #4497bc);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  letter-spacing: -.5px;
}
.pf-side-profile {
  padding: 22px 16px;
  text-align: center;
  border-bottom: 1px solid #e6edf5;
  color: #33445c;
  font-weight: 800;
}
.pf-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: #e8f2f8;
  border: 4px solid #fff;
  box-shadow: 0 10px 30px rgba(31, 78, 110, .16);
  color: #316181;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 22px;
}
.pf-side-options {
  padding: 14px 0;
}
.pf-menu-option {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 48px;
  padding: 0 20px;
  color: #526174;
  text-decoration: none;
  border-left: 5px solid transparent;
  transition: .15s ease;
}
.pf-menu-option:hover,
.pf-menu-option.active {
  background: #f2f7fb;
  color: #316181;
  border-left-color: #316181;
}
.pf-menu-option span {
  width: 24px;
  text-align: center;
}
.pf-wrapper {
  padding: 88px 30px 38px 280px;
  min-height: 100vh;
}
.pf-clock-bar {
  position: fixed;
  top: 61px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  background: #ffffff;
  border: 1px solid #d9e4ee;
  color: #526174;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(30, 50, 80, .08);
}
.pf-welcome-card {
  background: #ffffff;
  border: 1px solid #dbe5ef;
  border-radius: 4px;
  box-shadow: 0 12px 30px rgba(30, 50, 80, .08);
  padding: 28px 32px;
  margin-bottom: 22px;
}
.pf-welcome-card h1 {
  margin: 0 0 8px;
  color: #316181;
  font-size: 30px;
  font-weight: 800;
}
.pf-welcome-card p {
  margin: 0;
  max-width: 820px;
  color: #5e6b7b;
  line-height: 1.65;
}
.pf-panel {
  background: #ffffff;
  border: 1px solid #dbe5ef;
  box-shadow: 0 12px 30px rgba(30, 50, 80, .08);
}
.pf-panel-title {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  border-bottom: 4px solid #316181;
  padding: 22px 26px;
  background: linear-gradient(180deg, #ffffff, #f9fbfd);
}
.pf-panel-title h2 {
  margin: 0 0 4px;
  color: #243246;
  font-size: 23px;
}
.pf-panel-title p:not(.eyebrow) {
  margin: 0;
  color: #6c7788;
}
.pf-count-card {
  min-width: 175px;
  border: 1px solid #dbe5ef;
  background: #f4f8fc;
  padding: 13px 16px;
  text-align: center;
}
.pf-count-card strong {
  display: block;
  color: #316181;
  font-size: 18px;
}
.pf-count-card span {
  color: #6c7788;
  font-size: 12px;
}
.pf-exam-list-head {
  display: grid;
  grid-template-columns: minmax(250px, 1.4fr) minmax(300px, 1fr) 86px;
  gap: 16px;
  padding: 12px 22px;
  background: #eef4f8;
  color: #526174;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  border-bottom: 1px solid #dbe5ef;
}
.pf-exam-list {
  padding: 0;
}
.pf-exam-list .exam-row {
  display: grid;
  grid-template-columns: minmax(250px, 1.4fr) minmax(300px, 1fr) 86px;
  gap: 16px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid #e4ebf2;
  border-radius: 0;
  box-shadow: none;
  padding: 15px 22px;
  background: #fff;
  transform: none;
}
.pf-exam-list .exam-row:hover {
  background: #f8fbfd;
  transform: none;
  box-shadow: none;
}
.pf-exam-list .exam-row-main {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pf-exam-list .exam-icon {
  width: 42px;
  height: 42px;
  background: #e8f2f8;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pf-exam-list .exam-row-main strong {
  display: block;
  color: #26384f;
  font-size: 15px;
}
.pf-exam-list .exam-row-main span {
  color: #6e7a8d;
  font-size: 12px;
}
.pf-exam-list .exam-row-meta {
  justify-content: flex-start;
  gap: 7px;
}
.pf-exam-list .exam-row-meta span {
  background: #eef5fb;
  color: #466075;
  border: 1px solid #d8e6ef;
}
.pf-exam-list .play-btn {
  width: 48px;
  height: 48px;
  justify-self: end;
  border-radius: 50%;
  background: linear-gradient(135deg, #316181, #3e95be);
  border: 0;
  color: #fff;
  box-shadow: 0 12px 26px rgba(49, 97, 129, .28);
}
.pf-exam-list .play-btn:hover {
  transform: scale(1.04);
  filter: brightness(.98);
}
.pf-warning-note {
  margin: 16px 22px 22px;
}
.pf-accessibility {
  position: fixed;
  z-index: 70;
  top: 40%;
  right: 6px;
  display: grid;
  gap: 6px;
}
.pf-accessibility button {
  width: 45px;
  max-width: 45px;
  overflow: hidden;
  min-height: 45px;
  border: 0;
  border-radius: 5px;
  background: #316181;
  color: #fff;
  white-space: nowrap;
  cursor: pointer;
  transition: max-width .5s ease;
  text-align: left;
  padding: 0 12px;
}
.pf-accessibility button:hover {
  max-width: 170px;
  width: max-content;
}

/* V4 - Admin login is fully static: no Cloudflare redirects/functions. */
.admin-login-shell {
  background: linear-gradient(135deg, #eef5fb 0%, #f8fbfd 45%, #ffffff 100%);
}
.admin-login-card {
  border-top: 5px solid #316181;
}
.login-alert {
  background: #fff3f3;
  border: 1px solid #edb5b5;
  color: #9b1c1c;
  padding: 10px 12px;
  margin: 10px 0 14px;
  font-weight: 700;
}
.logout-link {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: 800;
}
.pro-topbar {
  background: #316181;
  border-bottom-color: #f2a900;
}

@media (max-width: 920px) {
  .pf-side-menu {
    position: static;
    width: auto;
    margin-top: 50px;
    border-right: 0;
  }
  .pf-side-logo,
  .pf-side-profile {
    display: none;
  }
  .pf-side-options {
    display: flex;
    overflow-x: auto;
    padding: 8px;
    gap: 8px;
  }
  .pf-menu-option {
    min-width: max-content;
    border-left: 0;
    border-radius: 10px;
    border: 1px solid #dbe5ef;
    padding: 10px 14px;
  }
  .pf-wrapper {
    padding: 24px 14px 28px;
  }
  .pf-clock-bar {
    position: static;
    transform: none;
    margin: 10px 0 16px;
    text-align: center;
  }
  .pf-panel-title {
    display: block;
  }
  .pf-count-card {
    margin-top: 14px;
  }
  .pf-exam-list-head {
    display: none;
  }
  .pf-exam-list .exam-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .pf-exam-list .play-btn {
    width: 100%;
    border-radius: 10px;
  }
  .pf-accessibility {
    display: none;
  }
}
