/* ============================================================
   British School Group – Level Test  |  Single Stylesheet
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --navy:      #041E42;
  --navy-light:#0a3060;
  --red:       #C8102E;
  --red-dark:  #a00d25;
  --gold:      #D4AC0D;
  --white:     #ffffff;
  --off-white: #f7f8fa;
  --gray-100:  #f0f2f5;
  --gray-200:  #e4e6eb;
  --gray-400:  #9ca3af;
  --gray-600:  #6b7280;
  --gray-800:  #1f2937;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.10);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.16);
  --radius:    10px;
  --radius-lg: 16px;
  --transition:.2s ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); }
button { cursor: pointer; font-family: inherit; }

/* ── Layout ─────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.container--wide { max-width: 1100px; }

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  background: var(--navy);
  padding: .9rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-header .logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}
.site-header .logo img { height: 40px; width: auto; }
.site-header .logo-text {
  color: var(--white);
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.3;
  opacity: .9;
}
.header-step {
  color: rgba(255,255,255,.7);
  font-size: .8rem;
  font-weight: 500;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  padding: 3.5rem 0 3rem;
  text-align: center;
}
.hero__eyebrow {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .3rem .9rem;
  border-radius: 20px;
  margin-bottom: 1.25rem;
}
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: .75rem;
}
.hero p {
  font-size: 1.05rem;
  opacity: .85;
  max-width: 500px;
  margin: 0 auto;
}

/* ── Card ───────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}
.card__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.card__title .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem; height: 2rem;
  background: var(--navy);
  color: var(--white);
  border-radius: 50%;
  font-size: .85rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Form ───────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.form-group--full { grid-column: 1 / -1; }
.form-group label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.form-group label .req { color: var(--red); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .95rem;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  padding-right: 2.5rem;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(4,30,66,.1);
}
.form-group input.error,
.form-group select.error { border-color: var(--red); }
.form-group input[readonly] {
  background: var(--gray-100);
  color: var(--gray-600);
  cursor: not-allowed;
}

/* ── Autocomplete (comune / CAP) ───────────────────────────────── */
.ac-wrap { position: relative; }
.ac-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
  background: #fff; border: 1.5px solid #cbd5e0; border-top: none;
  border-radius: 0 0 8px 8px; box-shadow: 0 6px 16px rgba(0,0,0,.1);
  max-height: 220px; overflow-y: auto; display: none;
}
.ac-list.open { display: block; }
.ac-item {
  padding: 9px 14px; cursor: pointer; font-size: 14px; color: #2d3748;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid #f0f2f5;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.active { background: #f0f4ff; color: #1a2744; }
.ac-item small { color: #a0aec0; font-size: 12px; }
.error-msg {
  font-size: .78rem;
  color: var(--red);
  display: none;
}
.error-msg.visible { display: block; }
.form-group textarea { resize: vertical; min-height: 130px; }

/* ── Course type radio ───────────────────────────────────────── */
.course-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: .25rem;
}
.course-option {
  position: relative;
}
.course-option input[type=radio] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.course-option label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  padding: 1.25rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  text-align: center;
  text-transform: none;
  letter-spacing: normal;
  font-size: .92rem;
  font-weight: 600;
  color: var(--gray-600);
}
.course-option label .course-icon { font-size: 2rem; }
.course-option input[type=radio]:checked + label {
  border-color: var(--navy);
  background: rgba(4,30,66,.04);
  color: var(--navy);
  box-shadow: 0 0 0 3px rgba(4,30,66,.1);
}
.course-option label:hover {
  border-color: var(--navy);
  background: rgba(4,30,66,.02);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.8rem;
  border: none;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn--primary {
  background: var(--red);
  color: var(--white);
}
.btn--primary:hover { background: var(--red-dark); box-shadow: var(--shadow-sm); }
.btn--primary:active { transform: translateY(1px); }
.btn--primary:disabled {
  background: var(--gray-400);
  cursor: not-allowed;
  transform: none;
}
.btn--secondary {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn--secondary:hover { background: var(--off-white); }
.btn--navy {
  background: var(--navy);
  color: var(--white);
}
.btn--navy:hover { background: var(--navy-light); }
.btn--sm { padding: .45rem 1rem; font-size: .82rem; }
.btn--block { width: 100%; }
.btn--lg { padding: 1rem 2.5rem; font-size: 1.05rem; }

/* ── Progress ────────────────────────────────────────────────── */
.progress-wrap {
  padding: 1rem 0 .5rem;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .4rem;
}
.progress-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-600);
}
.progress-counter {
  font-size: .8rem;
  color: var(--gray-600);
  font-weight: 500;
}
.progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: var(--red);
  border-radius: 3px;
  transition: width .4s ease;
}

/* ── Timer ───────────────────────────────────────────────────── */
.timer-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .4rem 0 .75rem;
}
.timer-track {
  flex: 1;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}
.timer-fill {
  height: 100%;
  background: var(--navy);
  border-radius: 4px;
  transition: width 1s linear, background .3s ease;
  width: 100%;
}
.timer-fill.waiting { background: var(--gray-300, #d1d5db); transition: none; }
.options-list.locked { pointer-events: none; opacity: .45; }
.timer-fill.warning { background: #f59e0b; }
.timer-fill.urgent  { background: var(--red); }
.timer-count {
  font-size: .85rem;
  font-weight: 700;
  color: var(--gray-600);
  min-width: 2rem;
  text-align: right;
  transition: color .3s ease;
}
.timer-count.urgent { color: var(--red); }

/* Block tabs */
.block-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.block-tab {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .35rem .75rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  background: var(--gray-200);
  color: var(--gray-600);
  transition: background var(--transition), color var(--transition);
}
.block-tab--active {
  background: var(--navy);
  color: var(--white);
}
.block-tab--done {
  background: #dcfce7;
  color: #16a34a;
}
.block-tab .check { font-size: .75rem; }

/* ── Question card ───────────────────────────────────────────── */
#question-card {
  opacity: 1;
  transition: opacity .25s ease;
}
#question-card.fading { opacity: 0; }

.question-type-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(4,30,66,.07);
  color: var(--navy);
  padding: .25rem .7rem;
  border-radius: 20px;
  margin-bottom: .9rem;
}
.question-type-badge.placeholder-badge {
  background: rgba(253,186,20,.2);
  color: #b45309;
}
.question-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  white-space: pre-wrap;
}
.options-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.option-item {
  position: relative;
}
.option-item input[type=radio] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.option-item label {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .8rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  font-size: .95rem;
  color: var(--gray-800);
  line-height: 1.4;
}
.option-item label .letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem; height: 1.8rem;
  border: 1.5px solid var(--gray-400);
  border-radius: 50%;
  font-size: .78rem;
  font-weight: 700;
  color: var(--gray-600);
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.option-item input[type=radio]:checked + label {
  border-color: var(--navy);
  background: rgba(4,30,66,.05);
}
.option-item input[type=radio]:checked + label .letter {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}
@media (hover: hover) and (pointer: fine) {
  .option-item label:hover {
    border-color: var(--navy);
    background: rgba(4,30,66,.03);
  }
}
.options-list.submitted .option-item label { cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .options-list.submitted .option-item label:hover { border-color: var(--gray-200); background: none; }
}
.options-list.submitted .option-item input[type=radio]:checked + label { border-color: var(--navy); background: rgba(4,30,66,.05); }

/* ── Audio player placeholder ────────────────────────────────── */
.audio-placeholder {
  background: rgba(4,30,66,.05);
  border: 1.5px dashed var(--navy);
  border-radius: var(--radius);
  padding: .85rem 1rem 1rem;
  margin-bottom: 1.25rem;
  font-size: .88rem;
  color: var(--navy);
  font-weight: 500;
  text-align: center;
}
.audio-msg-text { margin: 0 0 .65rem; }
.btn-listen {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.4rem;
  border: none;
  border-radius: 8px;
  background: var(--blue, #1a56db);
  color: #fff;
  font-size: .92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.btn-listen:hover:not(:disabled) { opacity: .85; }
.btn-listen:active:not(:disabled) { transform: scale(.97); }
.btn-listen:disabled { opacity: .45; cursor: not-allowed; }
.btn-listen--secondary { background: #4b6cb7; }
.audio-progress-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: .65rem auto 0;
  width: 100%;
  max-width: 280px;
}
.audio-progress-track {
  flex: 1;
  height: 5px;
  background: rgba(4,30,66,.15);
  border-radius: 3px;
  overflow: hidden;
}
.audio-progress-fill {
  height: 100%;
  background: var(--blue, #1a56db);
  border-radius: 3px;
  width: 0%;
  transition: width .25s linear;
}
.audio-time-display {
  font-size: .8rem;
  font-weight: 700;
  color: var(--navy);
  min-width: 2.6rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Overlay (block transition / loading) ────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4,30,66,.85);
  z-index: 200;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
  padding: 2rem;
}
.overlay.visible { display: flex; }
.overlay__icon {
  font-size: 3rem;
  animation: pulse 1s ease infinite alternate;
}
.overlay__title {
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 800;
}
.overlay__sub {
  color: rgba(255,255,255,.75);
  font-size: 1rem;
}
.spinner {
  width: 42px; height: 42px;
  border: 4px solid rgba(255,255,255,.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.12); } }

/* ── Speaking task ───────────────────────────────────────────── */
.speaking-instructions {
  background: var(--gray-100);
  border-left: 4px solid var(--gold);
  padding: .9rem 1.1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .92rem;
  color: var(--gray-600);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}
.speaking-prompt {
  background: var(--off-white);
  border-left: 4px solid var(--navy);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.65;
  color: var(--gray-800);
  margin-bottom: 1.5rem;
}
.speaking-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.speaking-timer__count {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--navy);
  min-width: 3rem;
  text-align: center;
  line-height: 1;
  transition: color .3s;
}
.speaking-timer__count.urgent { color: var(--red); }
.speaking-timer__label {
  font-size: .85rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.record-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  padding: .9rem 1.5rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform .1s;
}
.record-btn--start { background: var(--red); color: #fff; }
.record-btn--start:hover { background: var(--red-dark); }
.record-btn--stop  { background: var(--gray-800); color: #fff; }
.record-btn--stop:hover  { background: #111; }
.record-btn:active { transform: scale(.98); }
.record-dot {
  width: 12px; height: 12px;
  background: #fff;
  border-radius: 50%;
  animation: blink 1s ease infinite alternate;
}
@keyframes blink { from { opacity: 1; } to { opacity: .3; } }
.phase-prep-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.phase-prep-bar__fill {
  height: 100%;
  background: var(--gold);
  transition: width 1s linear;
}

/* ── Thank-you / CTA ─────────────────────────────────────────── */
.thankyou-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  padding: 3.5rem 0 3rem;
  text-align: center;
}
.thankyou-hero__check {
  font-size: 3.5rem;
  margin-bottom: .75rem;
  animation: pop .5s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.thankyou-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: .5rem;
}
.thankyou-hero p { opacity: .85; font-size: 1rem; max-width: 460px; margin: 0 auto; }

.cta-card {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.cta-card h2 {
  font-size: 1.25rem;
  margin-bottom: .75rem;
}
.cta-card p {
  opacity: .88;
  font-size: .97rem;
  margin-bottom: 1.5rem;
  line-height: 1.65;
}
.cta-card .btn--white {
  background: var(--white);
  color: var(--navy);
  font-weight: 800;
}
.cta-card .btn--white:hover { background: var(--off-white); }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: .5rem;
}
.step-item {
  background: var(--off-white);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
}
.step-item__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem; height: 2.2rem;
  background: var(--navy);
  color: var(--white);
  border-radius: 50%;
  font-size: .85rem;
  font-weight: 800;
  margin-bottom: .6rem;
}
.step-item__text { font-size: .88rem; color: var(--gray-600); font-weight: 500; }

/* ── Admin ───────────────────────────────────────────────────── */
.admin-bar {
  background: var(--navy);
  color: var(--white);
  padding: .6rem 0;
}
.admin-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-bar__title { font-size: .9rem; font-weight: 700; opacity: .9; }
.admin-bar__actions { display: flex; gap: .6rem; align-items: center; }

.admin-filters {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.admin-filters input,
.admin-filters select {
  padding: .5rem .85rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .88rem;
  font-family: inherit;
  min-width: 180px;
  background: var(--white);
}
.admin-filters input:focus,
.admin-filters select:focus {
  outline: none;
  border-color: var(--navy);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.data-table th {
  text-align: left;
  padding: .7rem .9rem;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}
.data-table td {
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
}
.data-table tr:hover > td { background: rgba(4,30,66,.025); }
.data-table .col-name { font-weight: 600; }
.row-toggle { cursor: pointer; }

.detail-row td {
  background: var(--off-white);
  padding: 1.25rem 1.5rem !important;
  border-bottom: 2px solid var(--gray-200);
}
.detail-row { display: none; }
.detail-row.open { display: table-row; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.detail-block { padding: 1rem; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.detail-block h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-600); margin-bottom: .6rem; }
.detail-block p { font-size: .9rem; line-height: 1.5; }
.detail-block.full { grid-column: 1 / -1; }

.override-form {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .75rem;
}
.override-form select {
  padding: .4rem .75rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .88rem;
  font-family: inherit;
  background: var(--white);
}

/* ── PIN screen ──────────────────────────────────────────────── */
.pin-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  padding: 2rem;
}
.pin-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.pin-card .logo-wrap { margin-bottom: 1.5rem; }
.pin-card .logo-wrap img { height: 48px; margin: 0 auto; }
.pin-card h2 { font-size: 1.2rem; font-weight: 800; color: var(--navy); margin-bottom: .4rem; }
.pin-card p { font-size: .88rem; color: var(--gray-600); margin-bottom: 1.5rem; }
.pin-input {
  width: 100%;
  text-align: center;
  letter-spacing: .5em;
  font-size: 1.5rem;
  font-weight: 700;
  padding: .75rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-family: monospace;
}
.pin-input:focus { outline: none; border-color: var(--navy); }
.pin-error { color: var(--red); font-size: .85rem; margin-bottom: .75rem; display: none; }
.pin-error.visible { display: block; }

/* ── Badge ───────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  color: var(--white);
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 12px;
  letter-spacing: .04em;
}

/* ── Alert ───────────────────────────────────────────────────── */
.alert {
  padding: .75rem 1.1rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  margin-bottom: 1rem;
}
.alert--error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert--success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert--info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Toast ───────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--gray-800);
  color: var(--white);
  padding: .75rem 1.25rem;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  transform: translateY(2rem);
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  max-width: 320px;
}
#toast.show { transform: translateY(0); opacity: 1; }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,.55);
  text-align: center;
  padding: 1.25rem;
  font-size: .78rem;
  margin-top: 3rem;
}
.site-footer a { color: rgba(255,255,255,.7); }

/* ── Page layout helpers ─────────────────────────────────────── */
.page-body { padding: 2rem 0 4rem; }
.page-body .container > .card:first-child { margin-top: 0; }

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .9rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-group--full { grid-column: 1; }
  .course-options { grid-template-columns: 1fr; }
  .card { padding: 1.5rem 1.25rem; }
  .detail-grid { grid-template-columns: 1fr; }
  .data-table { font-size: .8rem; }
  .data-table th, .data-table td { padding: .5rem .6rem; }
  .admin-filters { flex-direction: column; align-items: stretch; }
  .admin-filters input, .admin-filters select { min-width: unset; width: 100%; }
}
