/* =========================================================
   Brand overrides on top of Bootstrap 5.3.
   Load this AFTER bootstrap.min.css.
   ========================================================= */

:root {
  --bs-primary: #3D4FC4;
  --bs-primary-rgb: 61, 79, 196;
  --bs-body-bg: #F7F7F4;
  --bs-body-color: #111111;
  --bs-border-color: #E3E2DD;
  --bs-link-color: #3D4FC4;
  --bs-link-hover-color: #111111;
  --bs-secondary-color: #4B5563;
  --bs-secondary-color-rgb: 75, 85, 99;
  --bs-font-sans-serif: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-font-monospace: 'IBM Plex Mono', 'Courier New', monospace;

  --brand-ink: #111111;
  --brand-slate: #4B5563;
  --brand-amber: #DC9A3C;
}

.text-muted {
  color: var(--bs-secondary-color) !important;
}

body {
  font-family: var(--bs-font-sans-serif);
}

/* Display/heading font — falls back gracefully to serif if Fraunces isn't installed */
.font-display,
h1, h2, .h1, .h2 {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
}
.subject-panel h1,.subject-panel h2, .subject-panel .h1,.subject-panel .h2 {
  font-family:'Times New Roman', serif;
}

.text-slate { color: var(--brand-slate) !important; }
.text-amber { color: var(--brand-amber) !important; }
.bg-ink { background-color: var(--brand-ink) !important; }

.eyebrow {
  font-family: var(--bs-font-monospace);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-slate);
}

.role-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--bs-primary);
  margin-right: 6px;
  vertical-align: middle;
}

/* ---------- Sidebar (dashboard shell) ---------- */
.sidebar {
  background-color: var(--brand-ink);
  color: #fff;
  min-height: 100vh;
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.6);
  border-radius: 0.375rem;
  font-size: 0.9rem;
}

.sidebar .nav-link:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.05);
}

.sidebar .nav-link.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link .role-dot-inactive {
  background-color: rgba(255, 255, 255, 0.3);
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---------- Cards / forms ---------- */
.card {
  border-color: var(--bs-border-color);
  background-color: #f3f8fa;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
}

/* Answer-option "selected" look for radio cards in the quiz flow */
.option-card {
  cursor: pointer;
  transition: all 0.15s ease;
}

.option-card:has(input:checked) {
  border-color: var(--bs-primary) !important;
  background-color: rgba(var(--bs-primary-rgb), 0.05);
}

/* Plain-list exam options (no box), with a larger, colored radio button */
.option-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 2px;
  cursor: pointer;
}

.option-row-radio {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--bs-primary);
}

.option-row-text {
  font-size: 0.9rem;
  color: #111111;
}

.option-row:has(input:checked) .option-row-text {
  color: #000000;
  font-weight: 500;
}

/* ---------- Site header (shared, no Bootstrap navbar component) ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--bs-border-color);
  padding: 0.9rem 1rem;
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-header-logo img {
  height: 56px;
  display: block;
}

.site-header-center {
  display: none;
}

.site-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.site-header-username {
  color: var(--brand-slate);
  font-size: 0.875rem;
}

.site-header-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--brand-slate);
  text-decoration: none;
  font-size: 0.9rem;
}

.site-header-link:hover {
  color: var(--brand-ink);
}

.site-header-toggle {
  background: none;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius, 6px);
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
}

.site-header-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--brand-ink);
}

@media (min-width: 992px) {
  .site-header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    flex-wrap: nowrap;
  }

  .site-header-left {
    justify-self: start;
  }

  .site-header-center {
    display: block;
    justify-self: center;
  }

  .site-header-right {
    justify-self: end;
    margin-left: 0;
  }
}
.exam-progress .progress-bar {
  background-color: var(--bs-primary);
}

/* Primary action buttons use the logo blue instead of near-black */
.btn-dark {
  background-color: #1d6fd8;
  border-color: #1d6fd8;
}

.btn-dark:hover,
.btn-dark:active,
.btn-dark:focus {
  background-color: #185ab3 !important;
  border-color: #185ab3 !important;
}

.stat-number {
  font-size: 1.15rem;
}

@media (min-width: 576px) {
  .stat-number {
    font-size: 1.75rem;
  }
}

.footer-social-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.footer-social-circle:hover {
  transform: translateY(-2px);
  background-color: rgba(0, 0, 0, 0.03);
}

/* Dashboard stat cards — colors match the logo palette (blue / orange / green).
   "Exams taken" is blue on mobile (since Exam categories is hidden there) and
   switches to orange on desktop where all three cards show together. */
.stat-card-categories {
  background: rgba(29, 111, 216, 0.1);
  color: #1d6fd8;
}

.stat-card-taken {
  background: rgba(29, 111, 216, 0.1);
  color: #1d6fd8;
}

.stat-card-passed {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
}

@media (min-width: 768px) {
  .stat-card-taken {
    background: rgba(224, 138, 30, 0.12);
    color: #a3620f;
  }
}

/* Stacked math fractions (e.g. 1/x) used inside question/option text. */
.frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  font-size: 0.85em;
  line-height: 1.1;
  margin: 0 2px;
}
.frac .num,
.frac .den {
  padding: 0 3px;
}
.frac .num {
  border-bottom: 1.5px solid currentColor;
}