/* OER Frontend - Theme "editorial"
 *
 * Loaded after main/components/responsive/tree: it re-skins the design tokens and the signature
 * components (typography, colours, hero, cards, buttons) without touching layout or markup logic.
 * Fonts are self-hosted (SIL OFL): Fraunces for headings, Inter for text - no third-party requests.
 */

/* latin-ext */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(../fonts/fraunces-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(../fonts/fraunces-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Typography */
  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Blues: a deep navy to anchor titles, hero and footer; the original blue stays for actions */
  --color-navy: #17266a;
  --color-navy-2: #2a3a96;
  /* violet taken from the logo (plum book): blends with the blue in gradients */
  --color-violet: #5b3a9a;
  --color-plum: #4a2f86;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #e7eaff;

  /* Warm accent (coral): highlights, active states, inclusion (BES). Not used for small white text. */
  --color-accent: #f4623a;
  --color-accent-dark: #c2410c;
  --color-accent-light: #ffe9df;

  --color-background: #faf8f4;
  --color-surface: #ffffff;
  --color-text: #1a2152;
  --color-text-muted: #5a6585;
  --color-text-light: #8a94b0;
  --color-border: #e6e2d9;
  --color-border-dark: #d3cec2;

  /* Softer, blue-tinted shadows */
  --shadow-sm: 0 1px 2px rgb(20 39 94 / 0.06);
  --shadow: 0 1px 3px rgb(20 39 94 / 0.08), 0 1px 2px -1px rgb(20 39 94 / 0.06);
  --shadow-md: 0 6px 14px -4px rgb(20 39 94 / 0.12), 0 2px 5px -2px rgb(20 39 94 / 0.08);
  --shadow-lg: 0 18px 32px -10px rgb(20 39 94 / 0.20), 0 6px 10px -6px rgb(20 39 94 / 0.10);

  /* Rounder shapes */
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
}

html { overflow-x: clip; }

body {
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--color-navy);
}

h4, h5, h6 { color: var(--color-text); }

.stat-value,
.dashboard-card-title,
.school-card h3 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.stat-value { color: var(--color-navy-2); font-weight: 700; }

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

/* ---------- Focus: visible, on-brand ---------- */
:focus-visible {
  outline: 3px solid rgb(37 99 235 / 0.35);
  outline-offset: 2px;
  border-radius: 6px;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgb(37 99 235 / 0.14);
}

/* ---------- Buttons ---------- */
.btn { border-radius: var(--radius-md); font-weight: 600; letter-spacing: 0.005em; }

.btn-primary {
  background: linear-gradient(135deg, #2f6df0 0%, #4a58e2 100%);
  box-shadow: 0 1px 2px rgb(20 39 94 / 0.25), inset 0 1px 0 rgb(255 255 255 / 0.18);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2159d8 0%, #3f49cf 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -4px rgb(74 88 226 / 0.5);
}

.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary { border-color: var(--color-border-dark); }
.btn-secondary:hover:not(:disabled) { background: #fff; border-color: var(--color-primary); color: var(--color-primary-dark); }

/* ---------- Navbar ---------- */
.navbar {
  background: rgb(255 255 255 / 0.92);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 6px 18px -12px rgb(20 39 94 / 0.25);
}

.navbar-nav a { color: var(--color-text-muted); font-weight: 500; }
.navbar-nav a:hover { color: var(--color-navy); background-color: var(--color-primary-light); }
.navbar-nav a.active { color: var(--color-navy-2); background-color: transparent; font-weight: 600; }
.navbar-nav a.active::after {
  width: calc(100% - 24px);
  height: 3px;
  background: var(--color-accent);
  border-radius: 3px 3px 0 0;
}

/* ---------- Hero: full-bleed navy with soft shapes and a coral underline ---------- */
.hero {
  position: relative;
  isolation: isolate;
  margin: calc(var(--spacing-xl) * -1) calc(50% - 50vw) 0;
  padding: 84px 24px 132px;
  border: 0;
  background:
    radial-gradient(55% 120% at 88% 0%, rgb(79 110 240 / 0.55) 0%, transparent 60%),
    radial-gradient(50% 100% at 4% 100%, rgb(244 98 58 / 0.20) 0%, transparent 65%),
    linear-gradient(150deg, var(--color-navy) 0%, #2d2f8c 52%, var(--color-plum) 100%);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url('../assets/hero-pattern.svg') center / cover no-repeat;
  opacity: 0.9;
}

.hero h1 {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.4vw, 3.9rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin-bottom: 22px;
  color: #fff;
  background: none;
  -webkit-text-fill-color: #fff;
}

.hero h1::after {
  content: '';
  display: block;
  width: 64px;
  height: 5px;
  margin: 16px auto 0;
  border-radius: 5px;
  background: var(--color-accent);
}

.hero p {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: #cfdcff;
  max-width: 560px;
  line-height: 1.55;
}

/* sections after the hero overlap it a little: cards float on the edge */
.hero + .search-section { margin-top: -108px; position: relative; z-index: 1; }

/* ---------- Home search cards ---------- */
.search-section > h2 {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-section > h2::before {
  content: attr(data-icon);
  font-family: 'Material Icons';
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--color-navy-2);
  background: var(--color-primary-light);
  box-shadow: inset 0 0 0 1px rgb(37 99 235 / 0.12);
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
}

.search-section--resources > h2::before { color: var(--color-accent-dark); background: var(--color-accent-light); box-shadow: inset 0 0 0 1px rgb(244 98 58 / 0.18); }

.hero + .search-section > h2 { color: #fff; }
.hero + .search-section > h2::before { background: rgb(255 255 255 / 0.16); color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.25); }

.search-form {
  border: 1px solid var(--color-border);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-md);
}

.search-form:focus-within { border-color: rgb(37 99 235 / 0.45); box-shadow: var(--shadow-lg); }

.search-section > .text-muted { color: var(--color-text-muted); }

/* ---------- Cards ---------- */
.school-card,
.result-card,
.dashboard-card,
.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.school-card:hover,
.result-card:hover,
.dashboard-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgb(37 99 235 / 0.35);
}

.school-card-grade { background: var(--color-primary-light); color: var(--color-navy-2); font-weight: 600; }

/* ---------- Tags, badges ---------- */
.tag { border-radius: var(--radius-full); font-weight: 600; letter-spacing: 0.01em; }
.bes-tag, .badge-bes { background: var(--color-accent-light); color: var(--color-accent-dark); border-color: rgb(244 98 58 / 0.3); }

/* ---------- Tabs / breadcrumb ---------- */
.tab.active { color: var(--color-navy-2); border-bottom-color: var(--color-accent); }

/* ---------- Autocomplete ---------- */
.suggest-list { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.suggest-list li:hover, .suggest-list li.active { background: var(--color-primary-light); }

/* ---------- Footer ---------- */
footer {
  background: linear-gradient(150deg, var(--color-navy) 0%, #2d2f8c 55%, var(--color-plum) 100%);
  border-top: 0;
  color: #cfdcff;
}
footer p { color: #e8efff; }
/* the logo is shown as it is: its own dark box and white lettering read well on the navy-violet gradient */
footer .footer-tagline, footer .footer-links a { color: #a9bbf0; }
footer .footer-links a:hover { color: #fff; }

/* ---------- Motion: respect the user's preference ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .school-card:hover, .result-card:hover, .dashboard-card:hover, .btn-primary:hover:not(:disabled) { transform: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 768px) {
  .hero { padding: 56px 20px 116px; }
  .hero + .search-section { margin-top: -92px; }
}

/* ---------- Footer links (every link, whatever its class) ---------- */
footer a { color: #c4cffa; }
footer a:hover { color: #fff; }
footer small, footer .text-muted { color: #8fa3dd; }

/* ---------- Icon buttons: quiet by default, tinted on hover ---------- */
.btn-icon {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}
.btn-icon:hover:not(:disabled) {
  background: var(--color-primary-light);
  border-color: rgb(37 99 235 / 0.35);
  color: var(--color-navy-2);
}
.btn-icon.btn-danger,
.btn-icon.danger {
  background: var(--color-danger-light);
  border-color: #fecaca;
  color: var(--color-danger-dark);
}
.btn-icon.btn-danger:hover:not(:disabled),
.btn-icon.danger:hover:not(:disabled) {
  background: #fecaca;
  border-color: #fca5a5;
  color: #7f1d1d;
}

.gdpr-footer-links, .gdpr-footer-links .gdpr-sep, .gdpr-footer-note { color: #8fa3dd; }
.gdpr-footer-links a { color: #cfdcff; }
.gdpr-footer-links a:hover { color: #fff; }

/* ---------- Login ---------- */
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: var(--font-size-base); }

.auth-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--navbar-height) - 220px);
  padding: var(--spacing-2xl) 0;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 44px 36px 28px;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* navy band with the coral accent on top of the card */
.auth-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 8px;
  background: linear-gradient(90deg, var(--color-navy) 0%, var(--color-violet) 62%, var(--color-accent) 100%);
}

.auth-header h1 { font-size: 1.9rem; margin-bottom: 10px; }
.auth-header p { margin-bottom: var(--spacing-lg); }
.auth-body { margin-bottom: var(--spacing-lg); }
.auth-footer { padding-top: var(--spacing-md); border-top: 1px solid var(--color-border); }
.auth-footer p { margin: 0; font-size: var(--font-size-sm); }

/* =====================================================================
   Polish layer: skeletons, motion, file type tiles, empty states,
   home extras, modals/toasts, page transitions, print.
   ===================================================================== */

:root { color-scheme: light; accent-color: var(--color-primary); caret-color: var(--color-primary); }

.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; }

/* ---------- Scrollbar ---------- */
html { scrollbar-color: #b9bfdc transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c4c9e4; border-radius: 10px; border: 2px solid var(--color-background); }
::-webkit-scrollbar-thumb:hover { background: #9aa3d6; }

/* ---------- Skeletons ---------- */
.skeleton {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, #ece9e1 0%, #f6f4ee 45%, #ece9e1 90%);
  background-size: 220% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.skeleton-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: var(--spacing-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.skeleton-title { height: 22px; width: 62%; }
.skeleton-line { height: 12px; width: 100%; }
.skeleton-line.short { width: 55%; }
.skeleton-pill { height: 24px; width: 46%; border-radius: 999px; margin-top: 4px; }
.skeleton-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.skeleton-icon { flex: none; width: 34px; height: 34px; border-radius: 10px; }
.skeleton-row .skeleton-line { height: 14px; }
.tree-loading, .file-list-loading { display: flex; flex-direction: column; }

/* ---------- Navbar: compact once scrolled ---------- */
.navbar { transition: height var(--transition), box-shadow var(--transition); }
.navbar-logo { transition: height var(--transition); }
.is-scrolled .navbar { height: 56px; box-shadow: 0 10px 24px -14px rgb(20 39 94 / 0.45); }
.is-scrolled .navbar-logo { height: 34px; }

/* ---------- Content rises in (first paint of lists only) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.school-card, .result-card, .dashboard-card { animation: rise 0.45s ease both; }
.school-cards-grid > :nth-child(2) { animation-delay: 70ms; }
.school-cards-grid > :nth-child(3) { animation-delay: 140ms; }
.school-cards-grid > :nth-child(n+4) { animation-delay: 200ms; }

/* ---------- File type tiles ---------- */
.file-col-icon { width: 56px; }
.ftype {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em;
  color: var(--ft-fg); background: var(--ft-bg);
  box-shadow: inset 0 0 0 1px var(--ft-ring);
}
.ftype-pdf   { --ft-fg: #b42318; --ft-bg: #fee4e2; --ft-ring: #fcc5c0; }
.ftype-doc   { --ft-fg: #1d4ed8; --ft-bg: #dbe7ff; --ft-ring: #b9cdfb; }
.ftype-xls   { --ft-fg: #15803d; --ft-bg: #dcf5e4; --ft-ring: #b3e6c4; }
.ftype-ppt   { --ft-fg: #c2410c; --ft-bg: #ffe8d6; --ft-ring: #fdcaa6; }
.ftype-img   { --ft-fg: #7e22ce; --ft-bg: #f1e4ff; --ft-ring: #ddc2fb; }
.ftype-video { --ft-fg: #0e7490; --ft-bg: #d5f5fb; --ft-ring: #a8e6f1; }
.ftype-audio { --ft-fg: #a16207; --ft-bg: #fdf0c8; --ft-ring: #f6df93; }
.ftype-zip   { --ft-fg: #475569; --ft-bg: #e8ecf3; --ft-ring: #d2d9e6; }
.ftype-txt   { --ft-fg: #334155; --ft-bg: #eef0f5; --ft-ring: #d8dce8; }
.ftype-other { --ft-fg: #5a6585; --ft-bg: #eef0f6; --ft-ring: #d8dce8; }

.file-row { transition: background-color var(--transition-fast); }
.file-row:hover { background-color: #f3f1ff; }

/* ---------- Empty states ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: var(--spacing-2xl) var(--spacing-lg); }
.empty-state-icon,
.empty-state .material-icons.empty-state-icon {
  display: grid; place-items: center;
  width: 84px; height: 84px; margin-bottom: 22px;
  border-radius: 50%;
  font-size: 38px; color: var(--color-navy-2);
  background: var(--color-primary-light);
  box-shadow: 0 0 0 12px rgb(74 88 226 / 0.07), 0 0 0 26px rgb(74 88 226 / 0.04);
}
.empty-state h3 { margin: 0; font-size: 1.25rem; }
.empty-state p { margin: 0; color: var(--color-text-muted); max-width: 34ch; }

/* ---------- Breadcrumb and folder tree ---------- */
.breadcrumb a { color: var(--color-text-muted); border-radius: 6px; padding: 2px 4px; transition: background-color var(--transition-fast), color var(--transition-fast); }
.breadcrumb a:hover { background: var(--color-primary-light); color: var(--color-navy-2); text-decoration: none; }
.breadcrumb-current { color: var(--color-navy); font-weight: 600; }

.tree-item { border-radius: 10px; transition: background-color var(--transition-fast); }
.tree-item:hover { background-color: #f3f1ff; }
.tree-item.selected { background-color: var(--color-primary-light); box-shadow: inset 3px 0 0 var(--color-accent); }

/* ---------- Modals and toasts ---------- */
.modal-backdrop { background-color: rgb(20 28 70 / 0.45); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.modal { border-radius: 1.25rem; border: 1px solid var(--color-border); box-shadow: var(--shadow-lg); transform: scale(0.94) translateY(8px); transition: transform var(--transition-slow); }
.modal-backdrop.active .modal { transform: none; }
.modal-header { background: linear-gradient(180deg, #f7f6ff 0%, #fff 100%); }
.modal-header h3 { font-family: var(--font-display); color: var(--color-navy); }

.toast {
  position: relative; overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding-left: calc(var(--spacing-lg) + 4px);
}
.toast::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--color-primary); }
.toast-success::before { background: var(--color-success); }
.toast-warning::before { background: var(--color-warning); }
.toast-error::before { background: var(--color-danger); }
.toast-timed::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: currentColor; opacity: 0.25; transform-origin: left;
  animation: toast-progress var(--toast-duration, 5s) linear forwards;
}
@keyframes toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- Home extras ---------- */
.popular-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: var(--spacing-lg); }
.popular-tags[hidden] { display: none; }
.popular-tags-label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); }
.popular-tags-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  display: inline-flex; align-items: center;
  padding: 5px 13px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  color: var(--color-navy-2); background: #fff;
  border: 1px solid var(--color-border-dark);
  transition: all var(--transition-fast);
}
.tag-chip:hover { background: var(--color-primary-light); border-color: rgb(74 88 226 / 0.4); text-decoration: none; transform: translateY(-1px); }

/* ---------- Page transitions (browsers that support cross-document view transitions) ---------- */
@view-transition { navigation: auto; }
.navbar { view-transition-name: site-navbar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.2s; }

/* ---------- Print: just the content ---------- */
@media print {
  .navbar, footer, .toast-container, #cookie-banner, .btn, .btn-icon, .navbar-mobile-toggle, .hero::before { display: none !important; }
  body { background: #fff; color: #000; }
  .hero { background: none !important; color: #000; margin: 0; padding: 0 0 12px; }
  .hero h1, .hero p { color: #000; -webkit-text-fill-color: #000; }
  .school-card, .result-card, .card { box-shadow: none; border: 1px solid #bbb; break-inside: avoid; animation: none; }
  a { color: #000; text-decoration: underline; }
}

/* an empty/error message spans the whole results grid */
.school-cards-grid > .empty-state, .school-cards-grid > .loading { grid-column: 1 / -1; }

/* the bar stays on top while scrolling (its container, not the bar, is what has to be sticky) */
#navbar { position: sticky; top: 0; z-index: 100; }

/* ---------- Progress bar under the navbar while requests are in flight ---------- */
#navbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--color-primary) 30%, var(--color-violet) 60%, var(--color-accent) 85%, transparent 100%);
  background-size: 40% 100%; background-repeat: no-repeat;
  opacity: 0; transition: opacity var(--transition);
  pointer-events: none;
}
html.is-busy #navbar::after { opacity: 1; animation: busy-slide 1.1s ease-in-out infinite; }
@keyframes busy-slide { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* ---------- Error / 404 page ---------- */
.error-page { display: grid; place-items: center; min-height: calc(100vh - var(--navbar-height) - 260px); padding: var(--spacing-2xl) 0; }
.error-card { max-width: 540px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--spacing-md); }
.error-content { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.error-content.hidden { display: none; }
.error-icon.material-icons {
  display: grid; place-items: center; width: 84px; height: 84px; margin-bottom: 18px;
  border-radius: 50%; font-size: 38px; color: var(--color-navy-2); background: var(--color-primary-light);
  box-shadow: 0 0 0 12px rgb(74 88 226 / 0.07), 0 0 0 26px rgb(74 88 226 / 0.04);
}
.error-content h1 {
  margin: 0; font-size: clamp(4.5rem, 14vw, 8rem); line-height: 0.95; letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-violet) 55%, var(--color-accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.error-content h2 { margin: 0; font-size: 1.6rem; }
.error-content p { margin: 0; color: var(--color-text-muted); max-width: 40ch; }
.error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: var(--spacing-md); }

/* ---------- Navigation icons: thin line, aligned with the label ---------- */
.nav-icon { flex: none; width: 18px; height: 18px; display: block; }
.navbar-nav a .nav-icon { opacity: 0.85; transition: opacity var(--transition-fast), transform var(--transition-fast); }
.navbar-nav a:hover .nav-icon, .navbar-nav a.active .nav-icon { opacity: 1; }
.navbar-nav a.active .nav-icon { stroke-width: 1.9; }
.btn-login .nav-icon, .btn .nav-icon { width: 17px; height: 17px; }

