/* ==========================================================================
   Autokrosas design system
   Layered on Bootstrap 5.3: tokens below feed Bootstrap's own CSS variables,
   so stock components (forms, tables, alerts) follow the theme too.
   ========================================================================== */

:root {
  /* Brand: Lithuanian flag colours, tuned for screens. */
  --ax-yellow: #fdb913;
  --ax-orange: #ff6a1a;
  --ax-red: #e5383b;
  --ax-green: #12a26b;
  --ax-gradient: linear-gradient(115deg, var(--ax-yellow) 0%, var(--ax-orange) 55%, var(--ax-red) 100%);

  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 1rem;
  --radius-sm: .6rem;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* Dark theme (default). */
[data-bs-theme="dark"] {
  --bg: #0a0d0c;
  --surface: #121715;
  --surface-2: #19201d;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #eef2ef;
  --muted: #94a19b;
  --accent: var(--ax-yellow);
  --accent-ink: #1a1405;
  --link: #ffcf57;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 30px -12px rgba(0, 0, 0, .7);
  --glow: 0 0 0 1px rgba(253, 185, 19, .35), 0 12px 40px -10px rgba(253, 185, 19, .35);
  --header-bg: rgba(10, 13, 12, .72);
}

[data-bs-theme="light"] {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f1f2ee;
  --line: rgba(16, 24, 20, .09);
  --line-strong: rgba(16, 24, 20, .18);
  --text: #121715;
  --muted: #5d6963;
  --accent: #f0a500;
  --accent-ink: #1a1405;
  --link: #b45309;
  --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 10px 30px -14px rgba(16, 24, 20, .18);
  --glow: 0 0 0 1px rgba(240, 165, 0, .45), 0 12px 32px -12px rgba(240, 120, 0, .35);
  --header-bg: rgba(246, 246, 243, .78);
}

[data-bs-theme] {
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-emphasis-color: var(--text);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--surface-2);
  --bs-secondary-bg: var(--surface-2);
  --bs-border-color: var(--line);
  --bs-border-color-translucent: var(--line);
  --bs-link-color: var(--link);
  --bs-link-color-rgb: 255, 207, 87;
  --bs-link-hover-color: var(--text);
  --bs-body-font-family: var(--font-body);
  --bs-border-radius: var(--radius-sm);
  --bs-border-radius-lg: var(--radius);
  --bs-card-bg: var(--surface);
  --bs-focus-ring-color: rgba(253, 185, 19, .35);
}
[data-bs-theme="light"] { --bs-link-color-rgb: 180, 83, 9; }

html { font-size: 15px; scroll-behavior: smooth; }
@media (min-width: 768px) { html { font-size: 16px; } }

body {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--text); }

h1, h2, h3, .h1, .h2, .h3, .display-title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.05;
}
h1, .h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); text-transform: uppercase; margin-bottom: 1rem; }
h2, .h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4, h5, .h4, .h5 { font-weight: 700; letter-spacing: -.01em; }

::selection { background: var(--accent); color: var(--accent-ink); }

.text-gradient {
  background: var(--ax-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  width: 1.25rem;
  height: 3px;
  border-radius: 2px;
  background: var(--ax-gradient);
}

/* ---------- Header ---------- */

.site-header {
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .navbar { padding: .65rem 0; }

.navbar-brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); }
.navbar-brand:hover { color: var(--text); }

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: .65rem;
  background: var(--ax-gradient);
  color: #160f02;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -.02em;
  box-shadow: 0 6px 18px -6px rgba(255, 106, 26, .7);
}
.brand-text { font-family: var(--font-display); font-weight: 800; font-size: 1.45rem; text-transform: uppercase; letter-spacing: .02em; }
.brand-dot { color: var(--accent); }

.site-header .nav-link {
  color: var(--muted);
  font-weight: 500;
  padding: .45rem .85rem !important;
  border-radius: 999px;
  transition: color .2s, background-color .2s;
}
.site-header .nav-link:hover { color: var(--text); }
.site-header .nav-link.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }

.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--surface);
  color: var(--text);
}
.btn-icon:hover { border-color: var(--line-strong); color: var(--text); }
.btn-icon svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.navbar-toggler:focus { box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); }

[data-bs-theme="dark"] .theme-toggle .icon-moon,
[data-bs-theme="light"] .theme-toggle .icon-sun { display: none; }

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-left: .75rem;
}
.lang-switch a {
  padding: .2rem .7rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.lang-switch a.active { background: var(--accent); color: var(--accent-ink); }

@media (max-width: 991.98px) {
  .site-header .navbar-collapse { padding: .75rem 0 .5rem; }
  .site-header .navbar-nav { gap: .15rem; }
  .lang-switch { margin: .75rem 0 0; }
}
@media (min-width: 992px) { .site-header .navbar-nav { gap: .15rem; } }

/* Admin sub-navigation: a scrollable pill bar on phones. */
.admin-nav { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.admin-nav-links { overflow-x: auto; scrollbar-width: none; }
.admin-nav-links::-webkit-scrollbar { display: none; }
.admin-link {
  white-space: nowrap;
  font-size: .85rem;
  font-weight: 500;
  padding: .35rem .8rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}
.admin-link:hover { color: var(--text); background: var(--surface-2); }
.admin-link.active { color: var(--accent-ink); background: var(--accent); }

/* ---------- Hero (home page) ---------- */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(3rem, 9vw, 6.5rem) 0 clamp(2.5rem, 7vw, 5rem);
  border-bottom: 1px solid var(--line);
}
.hero::before {
  /* Soft colour blobs, the "mesh gradient" look. */
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 140%;
  z-index: -2;
  background:
    radial-gradient(40% 50% at 15% 20%, rgba(253, 185, 19, .28), transparent 70%),
    radial-gradient(35% 45% at 85% 10%, rgba(229, 56, 59, .25), transparent 70%),
    radial-gradient(45% 50% at 70% 90%, rgba(18, 162, 107, .18), transparent 70%);
  filter: blur(10px);
  animation: hero-drift 18s ease-in-out infinite alternate;
}
.hero::after {
  /* Faint grid, fades out towards the bottom. */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
}
@keyframes hero-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(2%, 3%, 0) scale(1.06); }
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  font-size: clamp(2.8rem, 9vw, 6rem);
  line-height: .92;
  letter-spacing: -.01em;
  margin: 1rem 0 1.25rem;
}
.hero-lead { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--muted); max-width: 34rem; }

.hero-stats { display: flex; gap: 2rem; margin-top: 2rem; flex-wrap: wrap; }
.hero-stats .stat-value { font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; line-height: 1; }
.hero-stats .stat-label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

/* Next-round card inside the hero. */
.next-card {
  position: relative;
  border-radius: calc(var(--radius) + 4px);
  padding: 1.5rem;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}
.next-card::before {
  /* Gradient border. */
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--ax-gradient);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .7;
  pointer-events: none;
}
.next-card h2 { font-size: 2rem; text-transform: uppercase; margin: .4rem 0 .25rem; }
.next-card .meta { color: var(--muted); }

.countdown { display: flex; gap: .6rem; margin: 1.25rem 0; }
.countdown > div {
  flex: 1;
  text-align: center;
  padding: .7rem .25rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.countdown .num { display: block; font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown .lbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

.pulse-dot {
  width: .55rem; height: .55rem; border-radius: 50%;
  background: var(--ax-green);
  box-shadow: 0 0 0 0 rgba(18, 162, 107, .6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 .55rem rgba(18, 162, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(18, 162, 107, 0); }
}

/* ---------- Buttons ---------- */

.btn { font-weight: 600; border-radius: .7rem; transition: transform .15s var(--ease), box-shadow .2s, background-color .2s, border-color .2s, color .2s; }
.btn:active { transform: translateY(1px); }
.btn-lg { padding: .8rem 1.4rem; font-size: 1rem; border-radius: .85rem; }

.btn-ax, .btn-primary {
  --bs-btn-color: var(--accent-ink);
  --bs-btn-hover-color: var(--accent-ink);
  --bs-btn-active-color: var(--accent-ink);
  border: 0;
  color: var(--accent-ink);
  background: var(--ax-gradient);
  box-shadow: 0 8px 22px -10px rgba(255, 106, 26, .8);
}
.btn-ax:hover, .btn-ax:focus-visible, .btn-primary:hover {
  color: var(--accent-ink);
  background: var(--ax-gradient);
  box-shadow: 0 12px 28px -10px rgba(255, 106, 26, .95);
  transform: translateY(-1px);
}

.btn-ghost, .btn-outline-dark {
  --bs-btn-color: var(--text);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-hover-color: var(--text);
  --bs-btn-hover-bg: var(--surface-2);
  --bs-btn-hover-border-color: var(--line-strong);
  --bs-btn-active-color: var(--text);
  --bs-btn-active-bg: var(--surface-2);
  --bs-btn-active-border-color: var(--line-strong);
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }

.btn-outline-secondary {
  --bs-btn-color: var(--muted);
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-hover-bg: var(--surface-2);
  --bs-btn-hover-color: var(--text);
  --bs-btn-hover-border-color: var(--line-strong);
}
.btn-success { --bs-btn-bg: var(--ax-green); --bs-btn-border-color: var(--ax-green); }

.btn-arrow::after { content: "→"; display: inline-block; margin-left: .45rem; transition: transform .2s var(--ease); }
.btn-arrow:hover::after { transform: translateX(3px); }

/* ---------- Cards and surfaces ---------- */

.card, .surface {
  --bs-card-border-color: var(--line);
  --bs-card-cap-bg: transparent;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header { border-bottom-color: var(--line); padding: .9rem 1.15rem; }
.card-body { padding: 1.25rem; }
.card-footer { border-top-color: var(--line); padding: .9rem 1.25rem; }

.card-hover { transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.card-hover:hover { transform: translateY(-3px); border-color: transparent; box-shadow: var(--glow); }

/* Track images */
.track-image { display: block; aspect-ratio: 16 / 9; background: var(--line); border-bottom: 1px solid var(--line); }
.track-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Shown for tracks without an image when others have one, so the cards line up. */
.track-image-empty { position: relative; background: var(--surface); }
.track-image-empty::before {
  content: ""; position: absolute; inset: 0; opacity: .06;
  background-image:
    linear-gradient(45deg, var(--text) 25%, transparent 25%, transparent 75%, var(--text) 75%),
    linear-gradient(45deg, var(--text) 25%, transparent 25%, transparent 75%, var(--text) 75%);
  background-size: 28px 28px;
  background-position: 0 0, 14px 14px;
}
.track-thumb { width: 12rem; max-width: 50%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: calc(var(--radius) / 2); border: 1px solid var(--line); }
.track-thumb-sm { width: 4rem; max-width: none; }

.list-group {
  --bs-list-group-bg: var(--surface);
  --bs-list-group-border-color: var(--line);
  --bs-list-group-action-hover-bg: var(--surface-2);
  --bs-list-group-action-hover-color: var(--text);
  --bs-list-group-color: var(--text);
  border-radius: var(--radius);
}
.list-group-item { padding: .85rem 1.15rem; }

/* Page heading block used on inner pages. */
.page-head { margin-bottom: 2rem; }
.page-head h1 { margin: .5rem 0 .35rem; }
.page-head p { color: var(--muted); margin: 0; }

.section-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: .75rem; margin: 3rem 0 1.25rem; }
.section-head h2 { margin: .35rem 0 0; text-transform: uppercase; }

/* Podium cards on the home page. */
.podium-card .card-header { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.podium-card .card-header a { color: var(--text); text-decoration: none; }
.podium-list { list-style: none; margin: 0; padding: .4rem; }
.podium-list li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .65rem;
  border-radius: var(--radius-sm);
}
.podium-list li + li { margin-top: .15rem; }
.podium-list li:first-child { background: linear-gradient(90deg, rgba(253, 185, 19, .14), transparent 80%); }
.podium-list .driver { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.podium-list .pts { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9rem; }

.medal {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: #1b1405;
}
.medal-1 { background: linear-gradient(135deg, #ffe17a, #f5a300); box-shadow: 0 4px 14px -4px rgba(245, 163, 0, .8); }
.medal-2 { background: linear-gradient(135deg, #f1f3f5, #a7b0b8); }
.medal-3 { background: linear-gradient(135deg, #f0c08c, #b8712f); }
.medal-n { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }

/* Quick links tiles. */
.tile {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  height: 100%;
  padding: 1.25rem;
  color: var(--text);
  text-decoration: none;
}
.tile:hover { color: var(--text); }
.tile-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: .8rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--accent);
}
.tile-icon svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tile-title { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; text-transform: uppercase; line-height: 1; }
.tile-text { color: var(--muted); font-size: .9rem; margin-top: -.4rem; }
.tile .btn-arrow { margin-top: auto; color: var(--muted); font-size: .85rem; font-weight: 600; }
.tile:hover .btn-arrow { color: var(--accent); }

/* Calendar cards: date block. */
.round-card { display: flex; flex-direction: column; height: 100%; }
.round-card .card-body { display: flex; gap: 1rem; align-items: flex-start; }
.date-block {
  flex: none;
  width: 4.2rem;
  text-align: center;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.date-block .month {
  display: block;
  padding: .2rem 0;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--ax-gradient);
}
.date-block .day { display: block; padding: .3rem 0 .35rem; font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; line-height: 1; }
.round-card .round-no { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.round-card h2 { font-size: 1.45rem; text-transform: uppercase; margin: .2rem 0 .35rem; }
.round-card.is-next { box-shadow: var(--glow); border-color: transparent; }
.round-card.is-past { opacity: .82; }

/* Badges for round status. */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .65rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.status-badge::before { content: ""; width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; }
.status-finished { color: #34d399; background: rgba(18, 162, 107, .12); border-color: rgba(18, 162, 107, .3); }
.status-open { color: var(--accent); background: rgba(253, 185, 19, .12); border-color: rgba(253, 185, 19, .35); }
.status-cancelled { color: var(--muted); background: var(--surface-2); border-color: var(--line); text-decoration: line-through; }
.status-planned { color: var(--muted); background: transparent; border-color: var(--line-strong); }
[data-bs-theme="light"] .status-finished { color: #047857; }
[data-bs-theme="light"] .status-open { color: #b45309; }

.number-badge {
  display: inline-block;
  padding: .1rem .55rem;
  border-radius: .5rem;
  background: var(--ax-gradient);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
}

/* ---------- Class pills / tabs ---------- */

/* Pills wrap onto more rows, so every class stays visible however many there are. */
.nav-pills {
  flex-wrap: wrap;
  gap: .35rem;
  padding: .3rem;
  border-radius: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  width: max-content;
  max-width: 100%;
}
.nav-pills .nav-link {
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: .9rem;
  padding: .4rem .95rem;
}
.nav-pills .nav-link:hover { color: var(--text); }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { background: var(--accent); color: var(--accent-ink); }

/* ---------- Tables ---------- */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-wrap .table-responsive { margin: 0; }
.table-wrap .table { margin: 0; }

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--line);
  --bs-table-hover-bg: var(--surface-2);
  --bs-table-hover-color: var(--text);
  --bs-table-striped-bg: var(--surface-2);
}
.table > :not(caption) > * > * { padding: .7rem .8rem; }
.table thead th {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom-color: var(--line);
}
.table-sm > :not(caption) > * > * { padding: .55rem .7rem; }

/* Result tables: compact, readable on phones, first columns stay visible while scrolling sideways. */
.table-results { font-size: .92rem; white-space: nowrap; }
.table-results td.num, .table-results th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-results .sticky-col { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.table-results thead .sticky-col { background: var(--surface-2); }
.table-results tbody tr:hover .sticky-col { background: var(--surface-2); }
.table-results a { color: var(--text); text-decoration: none; font-weight: 500; }
.table-results a:hover { color: var(--link); }
.table-results thead a { color: var(--muted); }
.table-results tbody tr:last-child > * { border-bottom: 0; }
.table-results tr.podium-1 > td:first-child { box-shadow: inset 3px 0 0 #f5a300; }
.table-results tr.podium-2 > td:first-child { box-shadow: inset 3px 0 0 #a7b0b8; }
.table-results tr.podium-3 > td:first-child { box-shadow: inset 3px 0 0 #b8712f; }
.table-results .pts-total { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; }

/* ---------- Forms ---------- */

.form-control, .form-select {
  background-color: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
  border-radius: .65rem;
}
.form-control:focus, .form-select:focus {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color);
}
.form-control::placeholder { color: var(--muted); opacity: .8; }
.form-label { font-weight: 500; font-size: .9rem; }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); border-color: var(--accent); }
[data-bs-theme="dark"] .form-check-input:checked[type="checkbox"] {
  --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%231a1405' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}
.input-group .btn { border-radius: 0 .65rem .65rem 0; }

.search-box { position: relative; max-width: 32rem; }
.search-box .form-control { padding-left: 2.6rem; height: 3rem; border-radius: .85rem; }
.search-box svg { position: absolute; left: .95rem; top: 50%; translate: 0 -50%; width: 1.1rem; height: 1.1rem; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search-box .btn { position: absolute; right: .35rem; top: .35rem; bottom: .35rem; border-radius: .6rem; }

.filter-bar { gap: .5rem; }
.filter-bar .form-select { min-width: 8rem; }

details > summary { cursor: pointer; }

.breadcrumb { --bs-breadcrumb-divider-color: var(--muted); --bs-breadcrumb-item-active-color: var(--muted); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }

.alert { border-radius: var(--radius-sm); }
.alert-success { --bs-alert-bg: rgba(18, 162, 107, .12); --bs-alert-border-color: rgba(18, 162, 107, .35); --bs-alert-color: var(--text); }

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

/* Driver profile header. */
.driver-hero { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.driver-number {
  display: grid;
  place-items: center;
  width: 5rem;
  height: 5rem;
  border-radius: 1.1rem;
  background: var(--ax-gradient);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 2.4rem;
  box-shadow: 0 12px 30px -12px rgba(255, 106, 26, .8);
}
.driver-facts { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.driver-facts li { padding: .3rem .75rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .85rem; }
.driver-facts span { color: var(--muted); margin-right: .3rem; }

/* Admin dashboard stat cards. */
.stat-card { display: block; padding: 1.1rem 1.2rem; color: var(--text); text-decoration: none; }
.stat-card:hover { color: var(--text); }
.stat-card .value { font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; line-height: 1; }
.stat-card .label { color: var(--muted); font-size: .85rem; margin-top: .25rem; }

.admin-nav .btn { white-space: nowrap; }
.form-results .form-control { min-width: 4.5rem; }

.auth-card { max-width: 26rem; margin: 2rem auto; padding: 2rem; }
.auth-card h1 { font-size: 2.2rem; }

/* ---------- Footer ---------- */

.site-footer { margin-top: 3rem; background: var(--surface); border-top: 1px solid var(--line); }
.checker-strip {
  height: 10px;
  background-image:
    linear-gradient(45deg, var(--text) 25%, transparent 25%, transparent 75%, var(--text) 75%),
    linear-gradient(45deg, var(--text) 25%, transparent 25%, transparent 75%, var(--text) 75%);
  background-size: 10px 10px;
  background-position: 0 0, 5px 5px;
  opacity: .12;
}
.footer-title { font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .75rem; }
.footer-links li + li { margin-top: .4rem; }
.footer-links a { color: var(--text); text-decoration: none; opacity: .85; }
.footer-links a:hover { opacity: 1; color: var(--accent); }
.footer-bottom { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }

/* ---------- Motion ---------- */

.reveal { animation: reveal .6s var(--ease) both; }
.reveal-1 { animation-delay: .06s; }
.reveal-2 { animation-delay: .12s; }
.reveal-3 { animation-delay: .18s; }
.reveal-4 { animation-delay: .24s; }
@keyframes reveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
main > * { animation: reveal .5s var(--ease) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Admin pages reuse the public look, a bit denser. */
.min-w-0 { min-width: 0; }
.is-admin h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.is-admin .table-responsive {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.is-admin .table-responsive > .table { margin: 0; }
.is-admin .table-responsive > .table tbody tr:last-child > * { border-bottom: 0; }
.is-admin form.col-12 { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.is-admin .table-bordered > :not(caption) > * > * { border-width: 0 0 1px; }
.table-results th.num:first-child, .table-results td.num:first-child { width: 1%; }
