/* ==========================================================================
   Auto-Ecole BERACA — Systeme de design (Site public & Espace eleve)
   Direction : Moderne & serieux (fond clair, marine/azur + accent rouge logo)
   ========================================================================== */

:root {
  --navy-950: #0b1533;
  --navy-900: #112255;
  --navy-800: #1b3478;
  --navy-100: #e7edf9;
  --azure-600: #0284c7;
  --azure-500: #0ea5e9;
  --azure-100: #e0f2fe;
  --azure-50: #f0f9ff;
  --crimson-600: #dc2626;
  --crimson-50: #fef2f2;
  --emerald-600: #059669;
  --emerald-50: #ecfdf5;
  --amber-600: #d97706;
  --amber-50: #fffbeb;

  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 22px 48px rgba(11, 21, 51, 0.14);

  --container: 1160px;
  --header-h: 72px;
  --font-sans: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  top: 0 !important;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-700);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

img, video {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--azure-600);
  text-decoration: none;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

a:hover {
  color: var(--navy-900);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.65rem;
  color: var(--ink-900);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

.b-icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: -0.125em;
}

/* Google Translate cleanup */
.goog-te-banner-frame.skiptranslate,
iframe.skiptranslate {
  display: none !important;
}

.goog-logo-link,
.goog-te-gadget-icon,
#google_translate_element img,
#google_translate_element a {
  display: none !important;
}

.goog-te-gadget {
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
}

/* Layout helpers */
.b-container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.b-container-narrow {
  max-width: 820px;
}

.b-section {
  padding: 4.5rem 0;
}

.b-section-sm {
  padding: 2.75rem 0;
}

.b-section-white {
  background: var(--surface);
}

.b-section-muted {
  background: var(--surface-muted);
}

.b-section-navy {
  background: var(--navy-950);
  color: #e2e8f0;
}

.b-section-navy h1,
.b-section-navy h2,
.b-section-navy h3,
.b-section-navy h4 {
  color: #ffffff;
}

.b-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header & Navigation */
.b-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.b-header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.b-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink-900);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.b-brand img {
  height: 42px;
  width: auto;
  border-radius: 6px;
  display: block;
}

.b-brand-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-500);
  letter-spacing: 0.02em;
}

.b-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.b-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink-700);
}

.b-nav-link:hover {
  color: var(--navy-900);
  background: var(--surface-muted);
}

.b-nav-link.is-active {
  color: var(--navy-900);
  background: var(--azure-50);
  box-shadow: inset 0 0 0 1px var(--azure-100);
}

.b-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Language pill */
.beraca-lang {
  position: relative;
  width: 3rem;
  min-width: 3rem;
  height: 36px;
  flex-shrink: 0;
}

.beraca-lang-code {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-muted);
  color: var(--navy-900);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  pointer-events: none;
}

#google_translate_element,
#google_translate_element .goog-te-gadget,
#google_translate_element .goog-te-combo {
  width: 3rem !important;
  min-width: 3rem !important;
  max-width: 3rem !important;
  height: 36px !important;
}

#google_translate_element .goog-te-combo {
  opacity: 0;
  cursor: pointer;
}

/* User dropdown (student header) */
.b-user-menu {
  position: relative;
}

.b-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-900);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.b-user-trigger:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.b-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy-900);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.b-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.4rem;
  z-index: 950;
}

.b-dropdown[hidden] {
  display: none;
}

.b-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-700);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.b-dropdown-item:hover {
  background: var(--surface-muted);
  color: var(--ink-900);
}

.b-dropdown-item-danger {
  color: var(--crimson-600);
}

.b-dropdown-item-danger:hover {
  background: var(--crimson-50);
  color: var(--crimson-600);
}

/* Mobile drawer button */
.b-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-900);
  cursor: pointer;
}

.b-mobile-panel {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1rem 1.25rem 1.35rem;
}

.b-mobile-panel.is-open {
  display: block;
}

.b-mobile-links {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.b-mobile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

/* Buttons */
.b-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.68rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.b-btn:active {
  transform: translateY(1px);
}

.b-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.b-btn-primary {
  background: var(--navy-900);
  color: #ffffff;
  box-shadow: var(--shadow-xs);
}

.b-btn-primary:hover {
  background: var(--navy-800);
  color: #ffffff;
}

.b-btn-azure {
  background: var(--azure-600);
  color: #ffffff;
}

.b-btn-azure:hover {
  background: #0369a1;
  color: #ffffff;
}

.b-btn-success {
  background: var(--emerald-600);
  color: #ffffff;
}

.b-btn-success:hover {
  background: #047857;
  color: #ffffff;
}

.b-btn-outline {
  background: var(--surface);
  color: var(--navy-900);
  border-color: var(--border-strong);
}

.b-btn-outline:hover {
  background: var(--surface-muted);
  border-color: var(--navy-900);
  color: var(--navy-900);
}

.b-btn-white {
  background: #ffffff;
  color: var(--navy-950);
}

.b-btn-white:hover {
  background: var(--azure-50);
  color: var(--navy-950);
}

.b-btn-ghost-light {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
}

.b-btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.b-btn-sm {
  padding: 0.48rem 0.9rem;
  font-size: 0.86rem;
}

.b-btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

.b-btn-block {
  width: 100%;
}

/* Badges & Tags */
.b-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.2;
}

.b-badge-navy {
  background: var(--navy-100);
  color: var(--navy-900);
}

.b-badge-azure {
  background: var(--azure-100);
  color: #0369a1;
}

.b-badge-success {
  background: var(--emerald-50);
  color: var(--emerald-600);
  border: 1px solid #a7f3d0;
}

.b-badge-danger {
  background: var(--crimson-50);
  color: var(--crimson-600);
  border: 1px solid #fecaca;
}

.b-badge-muted {
  background: var(--surface-muted);
  color: var(--ink-500);
  border: 1px solid var(--border);
}

.b-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--azure-600);
  margin-bottom: 0.75rem;
}

.b-kicker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--crimson-600);
  display: inline-block;
}

/* Hero */
.b-hero {
  background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
  border-bottom: 1px solid var(--border);
  padding: 3.75rem 0 4.25rem;
}

.b-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 3rem;
  align-items: center;
}

.b-hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 1.1;
  color: var(--navy-950);
  margin-bottom: 1.1rem;
}

.b-hero-lead {
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--ink-700);
  max-width: 56ch;
  margin-bottom: 1.75rem;
}

.b-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.b-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--ink-500);
}

.b-hero-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink-700);
  font-weight: 500;
}

.b-hero-meta-item svg {
  color: var(--azure-600);
}

.b-hero-media {
  position: relative;
}

.b-hero-frame {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  background: var(--navy-950);
}

.b-hero-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.b-hero-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.15rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--ink-700);
}

.b-hero-caption strong {
  color: var(--navy-950);
}

/* Page header (subpages) */
.b-page-head {
  background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-900) 60%, #163a70 100%);
  color: #e2e8f0;
  padding: 3rem 0;
  border-bottom: 3px solid var(--azure-500);
}

.b-page-head h1 {
  color: #ffffff;
  font-size: clamp(1.85rem, 3.2vw, 2.5rem);
  margin-bottom: 0.45rem;
}

.b-page-head p {
  color: #cbd5e1;
  font-size: 1.02rem;
  max-width: 62ch;
}

.b-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: #93c5fd;
  margin-bottom: 0.8rem;
}

.b-breadcrumb a {
  color: #bae6fd;
  font-weight: 600;
}

.b-breadcrumb a:hover {
  color: #ffffff;
}

/* Stats strip */
.b-stats-band {
  background: var(--navy-950);
  color: #ffffff;
  padding: 2.5rem 0;
}

.b-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

.b-stat {
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--azure-500);
}

.b-stat-value {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.25rem;
}

.b-stat-label {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.4;
}

/* Section headings */
.b-section-head {
  margin-bottom: 2.25rem;
  max-width: 66ch;
}

.b-section-head h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  margin-bottom: 0.5rem;
}

.b-section-head p {
  color: var(--ink-500);
  font-size: 1.02rem;
}

.b-section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.b-section-head-row .b-section-head {
  margin-bottom: 0;
}

/* Split layout */
.b-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}

.b-split-reverse .b-split-media {
  order: 2;
}

.b-split-media img {
  display: block;
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  object-fit: cover;
}

/* Numbered track list (Formations & Services) */
.b-tracks-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 3rem;
  align-items: start;
}

.b-track-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.b-track-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 1.1rem;
  padding: 1.4rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.b-track-num {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--azure-50);
  border: 1px solid var(--azure-100);
  color: var(--navy-900);
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.b-track-item h3 {
  font-size: 1.12rem;
  margin-bottom: 0.35rem;
}

.b-track-item p {
  font-size: 0.95rem;
  color: var(--ink-500);
}

/* Cards & Grids */
.b-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.b-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.b-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.b-card-hover {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.b-card-hover:hover {
  border-color: var(--azure-500);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.b-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.b-card-media {
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}

.b-card-media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.b-card-media-contain img {
  aspect-ratio: auto;
  max-height: 460px;
  object-fit: contain;
  margin: 0 auto;
}

.b-card-title {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.b-card-meta {
  font-size: 0.84rem;
  color: var(--ink-500);
  margin-bottom: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.b-rich-text p {
  margin-bottom: 0.7rem;
  color: var(--ink-700);
}

.b-rich-text p:last-child {
  margin-bottom: 0;
}

.b-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--azure-50);
  color: var(--azure-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.b-icon-box-navy {
  background: var(--navy-100);
  color: var(--navy-900);
}

/* Checklist */
.b-checklist {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.b-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  color: var(--ink-700);
}

.b-checklist svg {
  color: var(--emerald-600);
  margin-top: 0.2rem;
}

/* CTA Banner */
.b-cta-box {
  background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-900) 65%, #0c4a6e 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-lg);
}

.b-cta-box h2 {
  color: #ffffff;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  margin-bottom: 0.45rem;
}

.b-cta-box p {
  color: #cbd5e1;
  max-width: 54ch;
}

.b-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Gallery & Lightbox */
.b-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.b-gallery-tile {
  position: relative;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-muted);
  cursor: pointer;
  aspect-ratio: 4 / 3;
  display: block;
  width: 100%;
}

.b-gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.28s ease;
}

.b-gallery-tile:hover img {
  transform: scale(1.04);
}

.b-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(11, 21, 51, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.b-lightbox[hidden] {
  display: none;
}

.b-lightbox-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  color: #e2e8f0;
  font-size: 0.92rem;
  font-weight: 600;
}

.b-lightbox-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.65);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.b-lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.b-lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  max-width: 1100px;
}

.b-lightbox-img {
  max-width: min(82vw, 960px);
  max-height: 80vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  object-fit: contain;
  background: #000000;
}

/* Forms & Auth */
.b-auth-wrap {
  padding: 3.5rem 0 4.5rem;
  display: flex;
  justify-content: center;
}

.b-auth-card {
  width: 100%;
  max-width: 500px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 2.25rem;
}

.b-auth-head {
  margin-bottom: 1.5rem;
}

.b-auth-head h1 {
  font-size: 1.7rem;
  margin-bottom: 0.35rem;
}

.b-auth-head p {
  color: var(--ink-500);
  font-size: 0.96rem;
}

.b-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.b-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.b-form-grid .b-field {
  margin-bottom: 0;
}

.b-field-full {
  grid-column: 1 / -1;
}

.b-label {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--ink-900);
}

.b-input,
.b-textarea {
  width: 100%;
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-900);
  font-family: inherit;
  font-size: 0.96rem;
  line-height: 1.4;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.b-textarea {
  min-height: 130px;
  resize: vertical;
}

.b-input:focus,
.b-textarea:focus {
  outline: none;
  border-color: var(--azure-600);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.16);
}

.b-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  font-weight: 550;
  margin-bottom: 1.25rem;
}

.b-alert[hidden] {
  display: none;
}

.b-alert-error {
  background: var(--crimson-50);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.b-alert-success {
  background: var(--emerald-50);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.b-alert-info {
  background: var(--azure-50);
  color: #075985;
  border: 1px solid var(--azure-100);
}

.b-auth-footer {
  margin-top: 1.4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink-500);
}

/* Contact map */
.b-map-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.b-map-frame iframe {
  display: block;
  width: 100%;
  height: 380px;
  border: 0;
}

/* Student space specific components */
.b-student-banner {
  background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-900) 70%, #0c4a6e 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.b-student-banner h1 {
  color: #ffffff;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 0.35rem;
}

.b-student-banner p {
  color: #cbd5e1;
  max-width: 55ch;
}

.b-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.b-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.35rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.b-kpi-num {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--navy-950);
  font-variant-numeric: tabular-nums;
}

.b-kpi-label {
  font-size: 0.86rem;
  color: var(--ink-500);
}

/* Tabs */
.b-tabs {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.3rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.b-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-700);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  cursor: pointer;
}

.b-tab-btn.is-active {
  background: var(--surface);
  color: var(--navy-950);
  box-shadow: var(--shadow-xs);
}

.b-tab-panel[hidden] {
  display: none;
}

/* Theme pills */
.b-theme-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.b-theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.78rem;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--ink-900);
  font-weight: 600;
}

.b-theme-pill small {
  color: var(--ink-500);
  font-weight: 500;
}

/* Exam Runner */
.b-exam-shell {
  max-width: 820px;
  margin: 0 auto;
}

.b-exam-hud {
  position: sticky;
  top: calc(var(--header-h) + 0.75rem);
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.b-exam-hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.b-exam-progress-text {
  font-weight: 700;
  color: var(--navy-950);
  font-variant-numeric: tabular-nums;
}

.b-progress-track {
  width: 100%;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  overflow: hidden;
}

.b-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy-900), var(--azure-500));
  border-radius: var(--radius-pill);
  transition: width 0.25s ease;
}

.beraca-timer {
  font-size: 1.25rem;
  font-weight: 800;
  min-width: 4.5rem;
  text-align: center;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--navy-900);
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.beraca-timer.is-low {
  background: var(--crimson-600);
}

.beraca-q-img {
  display: block;
  width: 100%;
  max-width: 460px;
  height: auto;
  margin: 0 auto 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #ffffff;
}

.beraca-q-video {
  max-height: 360px;
  background: #0f172a;
}

.beraca-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  margin: 0.6rem 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.98rem;
  color: var(--ink-900);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.beraca-opt:hover {
  border-color: var(--azure-500);
  background: var(--azure-50);
}

.beraca-opt:has(input:checked) {
  border-color: var(--azure-600);
  background: var(--azure-50);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.beraca-opt input {
  width: 18px;
  height: 18px;
  margin-top: 0.2rem;
  accent-color: var(--azure-600);
  flex-shrink: 0;
}

.b-opt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--navy-900);
  font-weight: 750;
  font-size: 0.84rem;
  flex-shrink: 0;
}

.beraca-opt:has(input:checked) .b-opt-letter {
  background: var(--azure-600);
  color: #ffffff;
}

.b-exam-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

#beraca-next[hidden],
#beraca-submit[hidden] {
  display: none !important;
}

/* Result & Correction chips */
.b-score-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--navy-100);
  color: var(--navy-950);
  font-weight: 800;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.b-score-pill small {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-500);
}

.b-answer-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.75rem 0 1rem;
}

.b-answer-chip {
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--ink-700);
  font-size: 0.92rem;
}

.b-answer-chip.is-selected {
  background: var(--azure-50);
  border-color: var(--azure-500);
  color: var(--navy-950);
  font-weight: 600;
}

/* PDF Reader */
.beraca-pdf {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  min-height: 60vh;
}

.beraca-pdf canvas {
  display: block;
  margin: 0 auto 0.85rem;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
}

.beraca-pdf-status {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--ink-500);
}

.beraca-pdf-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: #0b1120;
  display: none;
  flex-direction: column;
}

.beraca-pdf-overlay.is-open {
  display: flex;
}

.beraca-pdf-overlay-bar {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #020617;
  color: #ffffff;
  font-weight: 600;
}

.beraca-pdf-overlay-stage {
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.beraca-pdf-overlay-stage canvas {
  background: #ffffff;
  transform-origin: center center;
}

/* Video embeds */
.beraca-video {
  width: 100%;
  max-width: 640px;
  margin: 1rem auto;
}

.beraca-video.is-short {
  max-width: 360px;
}

.beraca-video iframe,
.beraca-video video {
  display: block;
  width: 100%;
  border: 0;
  border-radius: var(--radius-md);
  background: #0f172a;
  aspect-ratio: 16 / 9;
  height: auto;
}

.beraca-video.is-short iframe,
.beraca-video.is-short video {
  aspect-ratio: 9 / 16;
}

/* Empty state */
.b-empty {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--ink-500);
}

/* Footer */
.b-footer {
  background: var(--navy-950);
  color: #cbd5e1;
  padding: 3.5rem 0 2rem;
  margin-top: auto;
}

.b-footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.1fr 0.85fr;
  gap: 2.25rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.b-footer-logo {
  display: inline-block;
  background: #ffffff;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.9rem;
}

.b-footer-logo img {
  height: 44px;
  display: block;
}

.b-footer h4 {
  color: #ffffff;
  font-size: 0.96rem;
  margin-bottom: 0.85rem;
}

.b-footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.92rem;
}

.b-footer a {
  color: #cbd5e1;
}

.b-footer a:hover {
  color: #ffffff;
}

.b-footer-bottom {
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.86rem;
  color: #94a3b8;
}

.b-footer-compact {
  padding: 1.75rem 0;
}

.b-footer-compact-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.88rem;
}

.b-footer-inline-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Responsive */
@media (max-width: 980px) {
  .b-nav,
  .b-header-actions .b-hide-mobile {
    display: none;
  }

  .b-menu-toggle {
    display: inline-flex;
  }

  .b-hero-grid,
  .b-split,
  .b-tracks-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .b-split-reverse .b-split-media {
    order: 0;
  }

  .b-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .b-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .b-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .b-section {
    padding: 3rem 0;
  }

  .b-hero {
    padding: 2.5rem 0 3rem;
  }

  .b-grid-2,
  .b-grid-3,
  .b-kpi-grid,
  .b-form-grid,
  .b-footer-grid {
    grid-template-columns: 1fr;
  }

  .b-cta-box {
    padding: 2rem 1.4rem;
  }

  .b-auth-card {
    padding: 1.5rem;
  }

  .b-lightbox-stage {
    gap: 0.4rem;
  }

  .b-lightbox-img {
    max-width: 92vw;
  }
}
