/* BUSE PCM Student Portal. Designed & developed by Lumora Technologies. (c) 2026 Lumora Technologies. */
/* =========================================================================
   BUSE PCM Student Portal — foundation
   1. Design tokens   2. Base elements   3. App shell   4. Sidebar
   5. Topbar          6. Content & footer   7. Sign-in view   8. Utilities
   Brand colours sit at the top of :root so they are easy to update.
   ========================================================================= */

/* 1. Design tokens ------------------------------------------------------- */
:root {
  /* Brand palette — adjust these to match the official BUSE PCM logo */
  --brand-navy-950: #06142a;
  --brand-navy-900: #0b1f3a;
  --brand-navy-800: #12294d;
  --brand-navy-700: #1b3a68;
  --brand-blue-600: #2c5ea8;
  --brand-blue-500: #3a72c2;
  --brand-blue-100: #dde8f7;
  --brand-blue-50: #eff4fb;
  --brand-gold-700: #8a6a12;
  --brand-gold-500: #c9a227;
  --brand-gold-400: #dbb94a;
  --brand-gold-100: #f8f0d8;

  /* Surfaces and text */
  --color-bg: #f4f6fa;
  --color-surface: #ffffff;
  --color-surface-muted: #f8fafc;
  --color-border: #e3e8ef;
  --color-border-strong: #cdd5e0;
  --color-text: #0f1b2d;
  --color-text-muted: #475569;
  --color-text-subtle: #64748b;
  --color-link: var(--brand-blue-600);
  --color-focus: var(--brand-blue-500);

  /* Status and category tones */
  --green-700: #166b47;  --green-50: #e5f5ed;
  --amber-700: #8f5b0a;  --amber-50: #fdf2dc;
  --red-700: #b3332d;    --red-50: #fdeceb;
  --violet-700: #5b3fb5; --violet-50: #efebfb;
  --rose-700: #b4314f;   --rose-50: #fcebef;
  --teal-700: #0f6e6a;   --teal-50: #e1f4f2;

  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;

  /* Shape, depth and motion */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(15, 27, 45, 0.05);
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, 0.04), 0 2px 8px rgba(15, 27, 45, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 27, 45, 0.06), 0 14px 32px rgba(15, 27, 45, 0.08);
  --shadow-lg: 0 24px 64px rgba(6, 20, 42, 0.24);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 180ms;

  /* Layout */
  --sidebar-w: 272px;
  --topbar-h: 68px;
  --content-max: 1240px;
  --gutter: 32px;
}

/* 2. Base elements ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.nav-open { overflow: hidden; }

h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.25; font-weight: 600; color: var(--color-text); }
p { margin: 0 0 1em; }
a { color: var(--color-link); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
[hidden] { display: none !important; }
/* Brand images whose file is missing hide their wrapper (see ui.brandImg). */
[data-brand-wrap].is-missing { display: none !important; }

/* Official logos sit on a white chip so any colour version stays legible. */
.affiliation__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(6, 20, 42, 0.12);
}
.affiliation__logo img { display: block; width: auto; max-height: 36px; }
.affiliation__logo--lg img { max-height: 64px; }
.affiliation { display: flex; align-items: center; gap: 12px; font-size: 0.8125rem; line-height: 1.35; }
.affiliation--dark { color: #c9d4e5; }
.affiliation--sidebar { margin-top: 12px; padding: 0 4px; color: #9fb1cb; font-size: 0.75rem; }
.affiliation--sidebar .affiliation__logo img { max-height: 28px; }

:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
::selection { background: var(--brand-gold-100); color: var(--brand-navy-900); }

.icon { width: 20px; height: 20px; flex-shrink: 0; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -64px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--brand-navy-900);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 12px; outline-color: var(--brand-gold-400); }

/* 3. App shell ----------------------------------------------------------- */
.shell { min-height: 100vh; }

.shell__main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 4. Sidebar ------------------------------------------------------------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--brand-navy-900);
  color: #c9d4e5;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.sidebar :focus-visible { outline-color: var(--brand-gold-400); }

.sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 20px 18px;
}

.sidebar__home {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.sidebar__home img { width: 44px; height: 44px; object-fit: contain; }
.topbar .topbar__logo { display: none; width: 34px; height: 34px; object-fit: contain; }
.sidebar__name { display: block; color: #fff; font-weight: 700; letter-spacing: 0.01em; }
.sidebar__tagline { display: block; font-size: 0.75rem; color: #8fa3c0; letter-spacing: 0.04em; }
.sidebar .sidebar__close { display: none; }

/* The whole sidebar scrolls as one, so the motto card never covers navigation. */
.sidebar__nav { flex: 1 0 auto; padding: 8px 12px 16px; }

.nav-group + .nav-group { margin-top: 20px; }
.nav-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }

.nav-group__label {
  margin: 0 0 6px;
  padding: 0 12px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7f93b0;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #c9d4e5;
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-link .icon { color: #8fa3c0; transition: color var(--dur) var(--ease); }
.nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-link:hover .icon { color: #fff; }

.nav-link[aria-current="page"] { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-link[aria-current="page"] .icon { color: var(--brand-gold-400); }
.nav-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand-gold-500);
}

.nav-link__count {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--brand-gold-500);
  color: var(--brand-navy-950);
  font-size: 0.6875rem;
  font-weight: 700;
}

/* Small links under the main menu: About PCM, My account, Contact, Log out. */
.nav-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  margin: 24px 0 0;
  padding: 16px 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  list-style: none;
}
.nav-mini__link {
  display: inline-block;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #8fa3c0;
  font: inherit;
  font-size: 0.8125rem;
  text-decoration: none;
  cursor: pointer;
}
.nav-mini__link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-mini__link[aria-current="page"] { color: #fff; font-weight: 600; }
.nav-mini [data-logout]:hover { background: rgba(232, 99, 88, 0.14); color: #ffdcd8; }

.sidebar__footer { padding: 16px; }

.sidebar-motto {
  padding: 16px 18px;
  border: 1px solid rgba(201, 162, 39, 0.28);
  border-radius: 14px;
  background: rgba(201, 162, 39, 0.08);
}
.sidebar-motto__label {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-gold-400);
}
.sidebar-motto__text {
  margin: 6px 0 4px;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.35;
  color: #fff;
}
.sidebar-motto__ref { margin: 0; font-size: 0.75rem; color: #8fa3c0; }

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(6, 20, 42, 0.5);
  animation: fade-in 200ms var(--ease);
}

/* 5. Topbar -------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 var(--gutter);
  background: rgba(244, 246, 250, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.topbar .topbar__menu { display: none; }
.topbar__heading { display: flex; flex-direction: column; min-width: 0; }
.topbar__eyebrow { font-size: 0.75rem; color: var(--color-text-subtle); }
.topbar__title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--color-text-muted);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--color-surface); border-color: var(--color-border); color: var(--color-text); }
/* The Announcements button: a bell with a small word under it. */
.icon-btn--labelled { width: auto; min-width: 42px; height: 48px; padding: 4px 8px 3px; gap: 1px; align-content: center; text-decoration: none; }
.icon-btn__label { font-size: 0.625rem; font-weight: 600; letter-spacing: 0.02em; line-height: 1; }
.icon-btn--labelled .icon-btn__badge { top: 1px; right: 6px; }
.icon-btn--labelled[aria-current="page"] { color: var(--color-text); background: var(--color-surface); border-color: var(--color-border); }

.icon-btn__badge {
  position: absolute;
  top: 5px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border: 2px solid var(--color-bg);
  border-radius: var(--radius-pill);
  background: var(--red-700);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 14px 4px 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.user-chip:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-sm); }
.user-chip__text { display: flex; flex-direction: column; line-height: 1.2; }
.user-chip__name { font-size: 0.875rem; font-weight: 600; }
.user-chip__role { font-size: 0.75rem; color: var(--color-text-subtle); }

.demo-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px var(--gutter) 0;
  padding: 12px 12px 12px 16px;
  border: 1px solid #ecdca6;
  border-radius: var(--radius-md);
  background: var(--brand-gold-100);
  color: #5e4708;
  font-size: 0.875rem;
}
.demo-banner > .icon { color: var(--brand-gold-700); }
.demo-banner p { flex: 1; margin: 0; }
.demo-banner .btn { color: #5e4708; }
.demo-banner--info { border-color: #cfdef3; background: var(--brand-blue-50); color: #1e3a66; }
.demo-banner--info > .icon { color: var(--brand-blue-600); }

/* 6. Content & footer ---------------------------------------------------- */
.content {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 32px var(--gutter) 56px;
}
.content:focus { outline: none; }

.app-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 20px var(--gutter) 28px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-subtle);
  font-size: 0.8125rem;
}
.app-footer p { margin: 0; }
.app-footer__brand { display: flex; align-items: center; gap: 12px; }
.app-footer__brand > img { width: 40px; height: 40px; object-fit: contain; }
.app-footer__brand .affiliation__logo { padding: 4px 8px; }
.app-footer__brand .affiliation__logo img { max-height: 32px; }
.app-footer { align-items: center; }
.app-footer__motto { font-family: var(--font-display); font-style: italic; color: var(--color-text-muted); }

/* Developer credit (footer and sign-in page) */
.credit { font-size: 0.75rem; color: var(--color-text-subtle); letter-spacing: 0.02em; }
.credit strong { font-weight: 600; color: var(--color-text-muted); }
.app-footer__credit { flex-basis: 100%; padding-top: 12px; border-top: 1px solid var(--color-border); text-align: center; }
.sidebar__credit { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 0.6875rem; color: rgba(255, 255, 255, 0.55); text-align: center; }
.sidebar__credit strong { color: rgba(255, 255, 255, 0.85); }
.auth__credit { width: 100%; max-width: 400px; margin: 32px 0 0; text-align: center; }

/* 7. Sign-in view -------------------------------------------------------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: var(--color-surface);
}

.auth__brand {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: 48px 56px;
  background: var(--brand-navy-900);
  color: #fff;
}
.auth__brand::before {
  content: "";
  position: absolute;
  right: -180px;
  bottom: -180px;
  z-index: -1;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  box-shadow: 0 0 0 60px rgba(255, 255, 255, 0.025), 0 0 0 120px rgba(255, 255, 255, 0.02);
}
.auth__brand::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: radial-gradient(640px 360px at 100% 0%, rgba(58, 114, 194, 0.32), transparent 65%);
}

.auth__logo { display: flex; align-items: center; gap: 14px; }
.auth__logo img { width: 64px; height: 64px; object-fit: contain; }
.auth__footer { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.auth__logo strong { display: block; font-size: 1.0625rem; letter-spacing: 0.01em; }
.auth__logo span { display: block; font-size: 0.8125rem; color: #9fb1cb; }

.auth__eyebrow {
  margin: 0 0 16px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-gold-400);
}
.auth__motto {
  margin: 0 0 14px;
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 1.25rem + 1vw, 2.125rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.auth__motto em { color: var(--brand-gold-400); white-space: nowrap; }
/* The theme's label: a soft gold pill rather than a shouty heading */
.auth__theme-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid rgba(219, 185, 74, 0.4);
  border-radius: 999px;
  background: rgba(219, 185, 74, 0.12);
  letter-spacing: 0.1em;
}
.auth__theme-label .icon { width: 14px; height: 14px; }

/* The PCM logo is a square tile with its own background: soften its corners everywhere. */
img[data-brand="pcm"] { border-radius: 18%; object-fit: cover; }
.auth__subline { margin: 0 0 16px; font-family: var(--font-display); font-style: italic; font-size: 1.125rem; color: #e4ebf5; }
.auth__aim { margin: 0; max-width: 40ch; color: #c9d4e5; font-size: 1.0625rem; }
.auth__ref { margin: 0; font-size: 0.8125rem; color: #8fa3c0; }

.auth__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

/* PCM and SDA logos above the sign-in / create-account / reset forms */
.auth__marks {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 400px;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--color-border);
}
.auth__marks > img { width: 60px; height: 60px; object-fit: contain; flex-shrink: 0; }
.auth__marks-sda { display: inline-flex; flex-shrink: 0; }
.auth__marks-sda img { display: block; width: auto; height: 56px; }
.auth__marks-divider { width: 1px; height: 44px; background: var(--color-border-strong); flex-shrink: 0; }
.auth__marks-text { margin: 0 0 0 4px; font-size: 0.8125rem; font-weight: 700; line-height: 1.35; color: var(--brand-navy-900); }
.auth__marks-text span { display: block; font-weight: 400; color: var(--color-text-subtle); }

@media (max-width: 420px) {
  .auth__marks-text { display: none; }
}
.auth__form { width: 100%; max-width: 400px; }
.auth__title { margin-bottom: 6px; font-family: var(--font-display); font-size: 1.75rem; color: var(--brand-navy-900); }
.auth__subtitle { margin-bottom: 24px; color: var(--color-text-muted); }
.auth__form .notice { margin-bottom: 24px; }

.auth__row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: -4px 0 24px;
}

.auth__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--color-text-subtle);
  font-size: 0.8125rem;
}
.auth__divider::before, .auth__divider::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
.auth__admin { margin: 16px 0 0; text-align: center; font-size: 0.875rem; color: var(--color-text-subtle); }
.auth__switch { margin: 18px 0 0; text-align: center; font-size: 0.9375rem; color: var(--color-text-muted); }

.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #f1cbc7;
  border-radius: var(--radius-md);
  background: var(--red-50);
  color: #7a1f1a;
  font-size: 0.875rem;
}
.form-alert:focus { outline: none; }
.form-alert--critical { border: 2px solid var(--red-700); font-weight: 600; }
.form-alert > .icon { color: var(--red-700); }
.form-alert p { margin: 0; }

/* 8. Utilities ----------------------------------------------------------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.muted { color: var(--color-text-muted); }
.subtle { color: var(--color-text-subtle); }
.stack { display: flex; flex-direction: column; gap: 20px; }

.noscript {
  padding: 24px;
  text-align: center;
  background: var(--brand-gold-100);
  color: #5e4708;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Responsive shell ------------------------------------------------------- */
@media (max-width: 1023.98px) {
  .shell__main { margin-left: 0; }

  .sidebar {
    width: min(86vw, 300px);
    transform: translateX(-100%);
    visibility: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform 260ms var(--ease), visibility 0s linear 260ms;
  }
  .sidebar.is-open {
    transform: none;
    visibility: visible;
    transition: transform 260ms var(--ease), visibility 0s;
  }
  .sidebar .sidebar__close { display: inline-flex; }
  .topbar .topbar__menu { display: inline-flex; }
  .topbar .topbar__logo { display: block; }
}

@media (max-width: 880px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { gap: 28px; padding: 28px 24px 32px; }
  .auth__motto { font-size: 1.75rem; max-width: none; }
  .auth__ref { display: none; }
  .auth__panel { padding: 32px 20px 48px; }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; --topbar-h: 60px; }
  .content { padding-top: 20px; padding-bottom: 40px; }
  .topbar { gap: 8px; }
  .topbar__eyebrow, .user-chip__text { display: none; }
  .user-chip { padding: 3px; }
  .demo-banner { align-items: flex-start; margin-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- A livelier menu: coloured icon tiles, a highlighted leader desk, a warm active item ---- */
.nav-ico {
  display: inline-grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px;
  background: var(--ico-bg); color: var(--ico); transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav-link .nav-ico .icon { width: 17px; height: 17px; color: inherit; }
.nav-ico--blue { --ico: #8fb8f2; --ico-bg: rgba(84, 141, 224, 0.16); }
.nav-ico--gold { --ico: #f0cf63; --ico-bg: rgba(201, 162, 39, 0.18); }
.nav-ico--teal { --ico: #6fd3c9; --ico-bg: rgba(31, 166, 154, 0.17); }
.nav-ico--violet { --ico: #b9a4f5; --ico-bg: rgba(124, 95, 222, 0.2); }
.nav-ico--rose { --ico: #f4a1b5; --ico-bg: rgba(214, 74, 109, 0.18); }
.nav-ico--green { --ico: #7fd6a7; --ico-bg: rgba(46, 158, 107, 0.18); }
.nav-link:hover .nav-ico { transform: scale(1.08) rotate(-4deg); }
.nav-link[aria-current="page"] {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.nav-link[aria-current="page"] .nav-ico { background: var(--ico); color: var(--brand-navy-950); }

/* The leader desk: its own framed block at the top of the menu. */
.nav-group--leaders {
  margin-bottom: 18px; padding: 10px 8px 8px; border: 1px solid rgba(201, 162, 39, 0.35); border-radius: 14px;
  background: linear-gradient(160deg, rgba(201, 162, 39, 0.14), rgba(201, 162, 39, 0.03));
}
.nav-group--leaders .nav-group__label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 6px; color: var(--brand-gold-400); }
.nav-group--leaders .nav-group__label .icon { width: 14px; height: 14px; }
.nav-group__who { flex-basis: 100%; font-size: 0.75rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: #c9d4e5; }
.nav-group--leaders .nav-link[aria-current="page"]::before { left: -8px; }
.nav-programmes { display: grid; gap: 2px; margin: 6px 0 0; padding: 6px 0 0 50px; border-top: 1px dashed rgba(201, 162, 39, 0.25); list-style: none; }
.nav-programme { display: block; padding: 4px 8px; border-radius: 8px; color: #b5c3d8; font-size: 0.8125rem; text-decoration: none; }
.nav-programme:hover, .nav-programme[aria-current="page"] { background: rgba(255, 255, 255, 0.07); color: #fff; }

/* =========================================================================
   Sign-in page, refreshed: the form in a card on a soft coloured background,
   the logos once (in the welcome panel), and on phones the form right away.
   ========================================================================= */
.auth__marks { display: none; }
.auth__panel {
  background:
    radial-gradient(520px 320px at 100% 0%, rgba(201, 162, 39, 0.16), transparent 70%),
    radial-gradient(560px 360px at 0% 100%, rgba(58, 114, 194, 0.16), transparent 70%),
    linear-gradient(160deg, #f3f6fc 0%, #fbf7ec 100%);
}
.auth__form {
  max-width: 420px;
  padding: 32px 30px 28px;
  border: 1px solid rgba(11, 31, 58, 0.06);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(11, 31, 58, 0.12);
}
.auth__form::before {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  margin-bottom: 20px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--brand-gold-500), var(--brand-blue-500));
}
#login-notice { padding: 10px 14px; font-size: 0.875rem; }
.auth__credit { color: var(--color-text-subtle); }

@media (max-width: 880px) {
  .auth { background: linear-gradient(180deg, var(--brand-navy-900) 0, var(--brand-navy-900) 260px, #f3f6fc 260px, #fbf7ec 100%); }
  /* A short welcome band instead of a full screen. */
  .auth { grid-template-rows: auto 1fr; align-content: start; }
  .auth__brand { gap: 14px; padding: 22px 20px 70px; min-height: 0; }
  .auth__logo img { width: 48px; height: 48px; }
  .auth__theme-label, .auth__aim, .auth__ref { display: none; }
  .auth__motto { margin-bottom: 6px; font-size: 1.5rem; max-width: none; }
  .auth__subline { margin: 0; font-size: 0.9375rem; }
  .auth__footer { gap: 8px; }
  .auth__footer .affiliation { font-size: 0.75rem; gap: 8px; }
  .auth__footer .affiliation__logo img { max-height: 26px; }
  /* The form card overlaps the band, so it's on the first screen. */
  .auth__panel { position: relative; z-index: 1; margin-top: -54px; padding: 0 16px 32px; background: none; justify-content: flex-start; }
  .auth__form { padding: 24px 20px 22px; border-radius: 20px; }
  .auth__title { font-size: 1.5rem; }
  .auth__subtitle { margin-bottom: 16px; }
}

/* =========================================================================
   A playful menu: each item glows in its own colour, the icon bounces, the
   current page sits on a coloured pill, counters pulse, and on phones the
   items slide in one after another. No movement for "reduce motion".
   ========================================================================= */
.nav-link:has(.nav-ico--blue)   { --tone: #5b9bf0; --tone-deep: #2c5ea8; }
.nav-link:has(.nav-ico--gold)   { --tone: #f2c230; --tone-deep: #a8800f; }
.nav-link:has(.nav-ico--teal)   { --tone: #2fc4b6; --tone-deep: #0f7f79; }
.nav-link:has(.nav-ico--violet) { --tone: #9b82f5; --tone-deep: #5b3fb5; }
.nav-link:has(.nav-ico--rose)   { --tone: #f2789a; --tone-deep: #b4314f; }
.nav-link:has(.nav-ico--green)  { --tone: #4fd08f; --tone-deep: #1f8a5a; }

.nav-link {
  transition: background 220ms var(--ease), color 220ms var(--ease), transform 220ms var(--ease), box-shadow 220ms var(--ease);
}
/* Hover / tap: a wash of the item's colour, a little nudge right, the icon bounces. */
.nav-link:hover, .nav-link:focus-visible {
  background: linear-gradient(90deg, color-mix(in srgb, var(--tone, #5b9bf0) 26%, transparent), transparent 85%);
  transform: translateX(3px);
}
.nav-link:hover .nav-ico, .nav-link:focus-visible .nav-ico {
  background: var(--tone, #5b9bf0); color: #0b1f3a;
  animation: nav-bounce 520ms cubic-bezier(.3, 1.6, .5, 1);
}
.nav-link:active { transform: translateX(3px) scale(0.98); }
/* The current page: a coloured pill with a soft glow. */
.nav-link[aria-current="page"] {
  background: linear-gradient(100deg, var(--tone-deep, #2c5ea8), color-mix(in srgb, var(--tone, #5b9bf0) 70%, transparent));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--tone, #5b9bf0) 35%, transparent);
  color: #fff;
}
.nav-link[aria-current="page"] .nav-ico { background: #fff; color: var(--tone-deep, #2c5ea8); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); }
.nav-link[aria-current="page"]::before { background: var(--tone, #f2c230); }
.nav-link[aria-current="page"]::after {
  /* A tiny sparkle on the current item. */
  content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, #fff 25%, transparent);
  animation: nav-twinkle 2.4s ease-in-out infinite;
}
.nav-link[aria-current="page"]:has(.nav-link__count:not([hidden]))::after { display: none; }
/* New-item counters: bright and gently pulsing. */
.nav-link__count:not([hidden]) {
  background: linear-gradient(135deg, #ff8a3d, #e8452c); color: #fff; font-weight: 700;
  box-shadow: 0 0 0 0 rgba(232, 69, 44, 0.5); animation: nav-pulse 2s ease-out infinite;
}
/* Leader desk shortcuts and the small links: friendly hovers too. */
.nav-programme { transition: background 200ms var(--ease), color 200ms var(--ease), padding 200ms var(--ease); }
.nav-programme:hover { padding-left: 12px; background: rgba(242, 194, 48, 0.14); color: #fff; }
.nav-mini__link { transition: color 200ms var(--ease); }
.nav-mini__link:hover { color: #f2c230; }

/* Phones: when the menu opens, the items slide in one after another. */
@media (max-width: 1023.98px) {
  .sidebar.is-open .nav-link, .sidebar.is-open .nav-mini__link { animation: nav-in 360ms var(--ease) both; }
  .sidebar.is-open li:nth-child(1) .nav-link { animation-delay: 40ms; }
  .sidebar.is-open li:nth-child(2) .nav-link { animation-delay: 80ms; }
  .sidebar.is-open li:nth-child(3) .nav-link { animation-delay: 120ms; }
  .sidebar.is-open li:nth-child(4) .nav-link { animation-delay: 160ms; }
  .sidebar.is-open li:nth-child(5) .nav-link { animation-delay: 200ms; }
  .sidebar.is-open li:nth-child(6) .nav-link { animation-delay: 240ms; }
  .sidebar.is-open li:nth-child(7) .nav-link { animation-delay: 280ms; }
  .sidebar.is-open li:nth-child(8) .nav-link { animation-delay: 320ms; }
}

@keyframes nav-bounce { 0% { transform: scale(1) rotate(0); } 40% { transform: scale(1.22) rotate(-10deg); } 70% { transform: scale(0.95) rotate(4deg); } 100% { transform: scale(1.08) rotate(0); } }
@keyframes nav-twinkle { 0%, 100% { opacity: 0.4; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes nav-pulse { 0% { box-shadow: 0 0 0 0 rgba(232, 69, 44, 0.5); } 70% { box-shadow: 0 0 0 8px rgba(232, 69, 44, 0); } 100% { box-shadow: 0 0 0 0 rgba(232, 69, 44, 0); } }
@keyframes nav-in { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .nav-link, .nav-link:hover, .nav-link:active { transform: none !important; }
  .nav-link .nav-ico, .nav-link::after, .nav-link__count, .sidebar.is-open .nav-link, .sidebar.is-open .nav-mini__link { animation: none !important; }
}

/* =========================================================================
   A playful sign-in page: floating colour shapes, a card that pops in, a
   waving hello, a gold underline that draws itself, glowing boxes and a
   shining button. No movement for "reduce motion".
   ========================================================================= */
.auth__panel { position: relative; overflow: hidden; isolation: isolate; }
.auth__panel::before, .auth__panel::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(6px); pointer-events: none;
}
.auth__panel::before {
  width: 260px; height: 260px; top: 8%; right: -60px;
  background: radial-gradient(circle at 30% 30%, rgba(242, 194, 48, 0.55), rgba(255, 138, 61, 0.15) 70%, transparent 72%);
  animation: auth-float 9s ease-in-out infinite;
}
.auth__panel::after {
  width: 220px; height: 220px; bottom: 6%; left: -50px;
  background: radial-gradient(circle at 40% 40%, rgba(47, 196, 182, 0.45), rgba(155, 130, 245, 0.18) 70%, transparent 72%);
  animation: auth-float 11s ease-in-out infinite reverse;
}
.auth__form:not([hidden]) { animation: auth-pop 520ms cubic-bezier(.2, 1.4, .4, 1) both; }
.auth__form::before { background: linear-gradient(90deg, #f2c230, #ff8a3d, #f2789a, #9b82f5, #2fc4b6, #f2c230); background-size: 300% 100%; animation: auth-ribbon 6s linear infinite; width: 64px; }
#login-form .auth__title::after { content: " 👋"; display: inline-block; transform-origin: 70% 70%; animation: auth-wave 2.2s ease-in-out 600ms 2; }
.auth__form .input:focus {
  border-color: #f2c230;
  box-shadow: 0 0 0 4px rgba(242, 194, 48, 0.25), 0 0 18px rgba(47, 196, 182, 0.18);
}
.auth__form .btn--primary {
  position: relative; overflow: hidden;
  background: linear-gradient(100deg, #0b1f3a, #2c5ea8 60%, #13908a);
  border-color: transparent;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}
.auth__form .btn--primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent); transform: skewX(-20deg);
}
.auth__form .btn--primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(44, 94, 168, 0.35); }
.auth__form .btn--primary:hover::after { animation: auth-shine 800ms ease; }
.auth__form .btn--primary:active { transform: scale(0.98); }
.auth__form .link-btn { transition: color 180ms var(--ease); }
.auth__form .link-btn:hover { color: #13908a; }
/* The welcome panel: a gently floating logo and a gold underline that draws itself. */
.auth__logo img { animation: auth-bob 4.5s ease-in-out infinite; }
.auth__motto em { position: relative; }
.auth__motto em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, #f2c230, #ff8a3d); transform-origin: left; animation: auth-draw 900ms 400ms var(--ease) both;
}

@keyframes auth-float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-18px, 22px) scale(1.08); } }
@keyframes auth-pop { from { opacity: 0; transform: translateY(18px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes auth-ribbon { to { background-position: 300% 0; } }
@keyframes auth-wave { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(16deg); } 40% { transform: rotate(-10deg); } 60% { transform: rotate(14deg); } 80% { transform: rotate(-6deg); } }
@keyframes auth-shine { from { left: -60%; } to { left: 130%; } }
@keyframes auth-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes auth-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  .auth__panel::before, .auth__panel::after, .auth__form, .auth__form::before, #login-form .auth__title::after,
  .auth__logo img, .auth__motto em::after, .auth__form .btn--primary:hover::after { animation: none !important; }
}

/* =========================================================================
   Sign-in page: calm and professional. PCM navy and gold only — a white
   form card with a navy header and a thin gold line, a navy Sign in
   button, a quiet note, and one muted line showing what's inside.
   ========================================================================= */
.auth__panel { background: radial-gradient(900px 520px at 100% 0%, rgba(11, 31, 58, 0.05), transparent 65%), #f4f6fa; }
.auth__panel::before, .auth__panel::after, .auth__form::before { display: none; }
#login-form .auth__title::after { content: none; }
.auth__logo img { animation: none; }
.auth__motto em::after { background: #c9a227; height: 2px; }

.auth__form {
  padding: 0 30px 26px; overflow: hidden; border: 1px solid #e2e7ef; border-radius: 16px;
  background: #fff; box-shadow: 0 1px 2px rgba(11, 31, 58, 0.04), 0 12px 32px rgba(11, 31, 58, 0.08);
}
/* The header: plain navy with a thin gold line underneath. */
.auth__head {
  position: relative; margin: 0 -30px 22px; padding: 22px 30px 20px;
  background: #0b1f3a; color: #fff; border-bottom: 3px solid #c9a227;
}
.auth__head::before, .auth__head::after { content: none; }
.auth__band-eyebrow { margin: 0 0 6px; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #d9b44a; }
.auth__head .auth__title { margin: 0 0 4px; color: #fff; }
.auth__head .auth__subtitle { margin: 0; color: #c3cfe0; }
/* The help note: quiet grey with a slim gold edge. */
#login-notice { border: 0; border-left: 3px solid #c9a227; border-radius: 8px; background: #f6f7fa; color: #3d4b63; font-size: 0.875rem; }
#login-notice .icon { color: #a8841c; }
/* Sign in: navy, the portal's main colour. */
.auth__form .btn--primary { background: #0b1f3a; border-color: #0b1f3a; color: #fff; font-weight: 600; }
.auth__form .btn--primary:hover { background: #1b3a68; border-color: #1b3a68; box-shadow: 0 6px 16px rgba(11, 31, 58, 0.22); transform: none; }
.auth__form .btn--primary:hover::after { animation: none; }
.auth__form .input:focus { border-color: #2c5ea8; box-shadow: 0 0 0 3px rgba(44, 94, 168, 0.15); }
.auth__form .link-btn { color: #1f4f91; font-weight: 600; }

/* What's inside: one muted line, gold icons. */
.auth__inside { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; width: 100%; max-width: 420px; margin: 20px 0 0; padding: 0; list-style: none; }
.auth__tile { display: inline-flex; align-items: center; gap: 5px; padding: 0; background: none !important; box-shadow: none; color: #5a6a82; font-size: 0.8125rem; font-weight: 500; }
.auth__tile .icon { width: 14px; height: 14px; color: #b08a1e; }

@media (max-width: 880px) {
  .auth { background: linear-gradient(180deg, var(--brand-navy-900) 0, var(--brand-navy-900) 240px, #f4f6fa 240px); }
  .auth__form { padding: 0 20px 22px; border-radius: 16px; }
  .auth__head { margin: 0 -20px 18px; padding: 20px 20px 18px; }
  .auth__inside { gap: 4px 12px; }
  .auth__tile { font-size: 0.75rem; }
}

/* Small links under the menu: a tidy 2 × 2 grid with icons (About PCM, My account, Contact, Log out). */
.nav-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 20px 0 0; padding: 12px 0 0; }
.nav-mini li { min-width: 0; }
.nav-mini__link { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; text-align: left; white-space: nowrap; }
.nav-mini__link .icon { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.8; }
.nav-mini__link span { overflow: hidden; text-overflow: ellipsis; }
.sidebar__footer { padding: 12px 16px 16px; }
.affiliation--sidebar { margin-top: 0; }
