/* ==========================================================================
   Westminster Law School LMS — Theme
   Palette and typography sampled directly from westminsterlawschool.co.uk
   (see the design-system note in resources/views/layouts/main.twig).
   Layers on top of Bootstrap 5 via its CSS custom properties rather than
   replacing it — Bootstrap stays in the stack, this file is the brand skin.
   ========================================================================== */

:root {
  /* Brand palette, sampled from the live site */
  --wls-navy: #002051;
  --wls-navy-deep: #122448;
  --wls-navy-soft: #1a3a72;
  --wls-gold: #d4af37;
  --wls-gold-deep: #b6922a;
  --wls-gold-soft: #f0e2b6;
  --wls-ink: #292929;
  --wls-ink-muted: #5b6472;
  --wls-paper: #f6f7f9;
  --wls-white: #ffffff;
  --wls-border: #e1e5eb;

  /* Bootstrap variable overrides — this is what actually retints components */
  --bs-primary: var(--wls-navy);
  --bs-primary-rgb: 0, 32, 81;
  --bs-body-color: var(--wls-ink);
  --bs-body-bg: var(--wls-paper);
  --bs-border-color: var(--wls-border);
  --bs-link-color: var(--wls-navy);
  --bs-link-hover-color: var(--wls-gold-deep);
  /* Bootstrap 5.3's actual `a{}` rule reads color: rgba(var(--bs-link-color-rgb), ...)
     — --bs-link-color above is a display convenience alias the compiled CSS
     never consumes on its own. Without these, every plain link silently stays
     Bootstrap's default blue regardless of the override two lines up
     (design-review finding, 2026-07-18). */
  --bs-link-color-rgb: 0, 32, 81;
  --bs-link-hover-color-rgb: 182, 146, 42;
  --bs-body-font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bs-body-font-size: 0.875rem;
}

body {
  background: var(--wls-paper);
}

h1, h2, h3, h4, h5, h6,
.wls-heading {
  font-family: "Plus Jakarta Sans", var(--bs-body-font-family);
  font-weight: 700;
  color: var(--wls-navy-deep);
}

a {
  text-decoration: none;
}

/* ---- Logo mark (used standalone on public/auth pages too) --------------- */

.wls-logo {
  height: 74px;
  width: auto;
  display: block;
}

/* Rectangular horizontal lockup (wls-logo.png, ~3.1:1) used in the sidebar
   brand and mobile topbar — sized down from the base 74px .wls-logo height
   so it fits the 260px sidebar column (and the mobile topbar strip)
   without overflowing; the square/stacked mark's 74px default would run
   the rectangular version far too wide. */
.wls-sidebar-logo {
  height: 70px;
}

.wls-mobile-topbar-logo {
  height: 70px;
}

/* Square logo mark for the auth pages (login/register) — wls-logo-white.png
   is a transparent white mark, shown directly on the navy page background
   set by body.wls-auth-page below, no boxing needed. */
.wls-auth-logo {
  width: 200px;
  height: 200px;
  object-fit: contain;
}

/* Full-bleed navy background for the auth pages, scoped via bodyClass so it
   doesn't affect any authenticated screen. The card stays light for
   contrast; footer text is dimmed white instead of the default dark ink,
   which would be unreadable on navy. */
body.wls-auth-page .wls-main-column {
  background: var(--wls-navy);
}
body.wls-auth-page .wls-footer {
  color: rgba(255, 255, 255, 0.55);
}
body.wls-auth-page .wls-footer a {
  color: rgba(255, 255, 255, 0.75);
}

/* ---- Sidebar shell -------------------------------------------------------
   Left sidebar replaces the old horizontal top bar (Module 5, left-sidebar
   redesign) — gold accent still reserved for the active state, same
   restraint as the bar it replaced. Built on Bootstrap's responsive
   offcanvas (offcanvas-lg): a normal static column at ≥992px, a slide-in
   panel below that — no custom JS needed. */

.wls-app-shell {
  min-height: 100vh;
}

/* Flex items default to min-width: auto, so without this the main column
   refuses to shrink below its content's intrinsic width (long text, the
   Bootstrap grid) and overflows the viewport horizontally on mobile. */
.wls-main-column {
  min-width: 0;
}

.wls-sidebar {
  --bs-offcanvas-width: 260px;
}

/* Full-height sidebar with the account card pinned to the bottom (design
   uplift punch-list item 1). Scoped to the ≥992px static-column state only —
   below that, the offcanvas is a fixed-position slide-in panel and already
   spans the viewport on its own; sticky/height:100vh here would fight that.
   `position: sticky` (rather than `fixed`) keeps it in normal flex flow so
   it still sits beside — not on top of — the main column, but pins it to
   the viewport as the page scrolls, guaranteeing full-height coverage even
   when the main column's content is taller than one screen. */
@media (min-width: 992px) {
  .wls-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    align-self: flex-start;
  }

  .wls-sidebar .offcanvas-body {
    height: 100%;
  }
}

/* Bootstrap's offcanvas-lg forces the outer element's background to
   transparent (!important) once it becomes a static column at ≥992px —
   background/border go on the inner offcanvas-body instead, which isn't
   touched by that rule, so the sidebar keeps its surface in both states.
   Dark-navy fill (design uplift) — matches the mockup's dark sidebar; text
   colors below flip to light-on-dark accordingly. */
.wls-sidebar .offcanvas-body {
  background: var(--wls-navy-deep) !important;
  width: 260px;
}

.wls-sidebar-brand {
  display: block;
  padding: 1.20rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.wls-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1rem 0.75rem;
  overflow-y: auto;
}

.wls-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.wls-sidebar-link i {
  font-size: 1.05rem;
  width: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}

.wls-sidebar-link:hover {
  background: var(--wls-navy-soft);
  color: var(--wls-white);
}

.wls-sidebar-link.active {
  background: var(--wls-gold);
  color: var(--wls-navy-deep);
}

/* First collapsible sidebar submenu (Module 11 nav grouping) — the toggle
   reuses .wls-sidebar-link's own look on a <button> instead of an <a>,
   plus a chevron that rotates open/closed. */
.wls-sidebar-chevron {
  transition: transform 0.15s ease;
}

.wls-sidebar-link[aria-expanded="true"] .wls-sidebar-chevron {
  transform: rotate(180deg);
}

.wls-sidebar-sublink {
  padding-left: 2.4rem;
  font-size: 0.87rem;
}

.wls-account-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.wls-avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--wls-gold);
  color: var(--wls-navy-deep);
  font-weight: 700;
  font-size: 0.85rem;
}

.wls-account-info {
  min-width: 0;
  flex-grow: 1;
}

.wls-account-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--wls-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wls-account-role {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
}

.wls-account-logout {
  flex-shrink: 0;
}

/* The logout button is a stock .btn-outline-secondary in the markup — its
   grey-on-white default is illegible against the dark sidebar, so it's
   retinted here rather than adding a one-off button variant just for this
   single spot. */
.wls-account-logout .btn {
  --bs-btn-color: rgba(255, 255, 255, 0.75);
  --bs-btn-border-color: rgba(255, 255, 255, 0.3);
  --bs-btn-hover-color: var(--wls-navy-deep);
  --bs-btn-hover-bg: var(--wls-white);
  --bs-btn-hover-border-color: var(--wls-white);
}

.wls-notification-bell {
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.wls-bell-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
  font-size: 0.85rem;
}

.wls-bell-toggle:hover {
  background: var(--wls-navy-soft);
  color: var(--wls-white);
}

.wls-bell-toggle i {
  font-size: 1.05rem;
}

.wls-bell-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--wls-gold-deep);
  color: var(--wls-navy);
  font-size: 0.7rem;
  font-weight: 700;
}

.wls-notification-dropdown {
  width: 320px;
  max-height: 360px;
  overflow-y: auto;
  padding: 0;
  border-color: var(--wls-border);
}

.wls-notification-dropdown-header {
  padding: 0.65rem 1rem;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--wls-ink-muted);
  border-bottom: 1px solid var(--wls-border);
}

.wls-notification-empty {
  padding: 1rem;
  font-size: 0.85rem;
  color: var(--wls-ink-muted);
}

.wls-notification-item {
  display: block;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--wls-border);
  text-decoration: none;
  color: inherit;
}

.wls-notification-item:last-child {
  border-bottom: none;
}

.wls-notification-item.unread {
  background: var(--wls-gold-soft);
}

.wls-notification-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--wls-navy-deep);
}

.wls-notification-time {
  font-size: 0.75rem;
  color: var(--wls-ink-muted);
}

.wls-mobile-topbar {
  background: var(--wls-navy-deep);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* The mobile topbar's menu toggle is a stock .btn-outline-secondary — same
   retint reasoning as .wls-account-logout .btn above. */
.wls-mobile-topbar .btn {
  --bs-btn-color: rgba(255, 255, 255, 0.85);
  --bs-btn-border-color: rgba(255, 255, 255, 0.3);
  --bs-btn-hover-color: var(--wls-navy-deep);
  --bs-btn-hover-bg: var(--wls-white);
  --bs-btn-hover-border-color: var(--wls-white);
}

/* ---- Buttons -------------------------------------------------------------
   Navy solid fill is the primary action style on the live site
   ("CLICK TO APPLY"); gold is an accent, used as an outline/ghost variant
   here, not a competing fill color. */

.btn-primary {
  --bs-btn-bg: var(--wls-navy);
  --bs-btn-border-color: var(--wls-navy);
  --bs-btn-hover-bg: var(--wls-navy-deep);
  --bs-btn-hover-border-color: var(--wls-navy-deep);
  --bs-btn-active-bg: var(--wls-navy-deep);
  --bs-btn-focus-shadow-rgb: 0, 32, 81;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Unlike --bs-primary, .btn-outline-primary's colors are baked into
   Bootstrap's compiled CSS at build time, not read from a root variable —
   so it needs the same manual --bs-btn-* override .btn-primary already
   gets above, or it silently stays Bootstrap blue (design-review finding,
   2026-07-18: 9 templates use this class). */
.btn-outline-primary {
  --bs-btn-color: var(--wls-navy);
  --bs-btn-border-color: var(--wls-navy);
  --bs-btn-hover-bg: var(--wls-navy);
  --bs-btn-hover-border-color: var(--wls-navy);
  --bs-btn-active-bg: var(--wls-navy);
  --bs-btn-active-border-color: var(--wls-navy);
  font-weight: 600;
}

.btn-wls-gold {
  --bs-btn-color: var(--wls-navy-deep);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: var(--wls-gold);
  --bs-btn-hover-color: var(--wls-navy-deep);
  --bs-btn-hover-bg: var(--wls-gold-soft);
  --bs-btn-hover-border-color: var(--wls-gold);
  font-weight: 600;
}

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

.wls-card {
  background: var(--wls-white);
  border: 1px solid var(--wls-border);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(18, 36, 72, 0.04), 0 8px 24px rgba(18, 36, 72, 0.06);
}

.wls-card-accent-top {
  border-top: 3px solid var(--wls-gold);
}

/* ---- Status pills (reused across modules for lookup-table statuses) --- */

.wls-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.wls-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.wls-pill-pending { background: #fbf1dd; color: #92650f; }
.wls-pill-approved { background: #e2f3ea; color: #1f7a52; }
.wls-pill-rejected { background: #fbe6e6; color: #a6383e; }
.wls-pill-neutral { background: var(--wls-paper); color: var(--wls-ink-muted); }
.wls-pill-info { background: #e3edf7; color: #2c5c8f; }

/* ---- Wizard stepper (design uplift) -------------------------------------
   Numbered circles connected by a line, replacing the old .wls-wizard-nav
   pill grid. Two states only — active (current stage) and neutral
   (everything else) — since nothing in the reference design distinguishes
   "already completed" from "not yet reached." */

.wls-stepper-scroll {
  overflow-x: auto;
}

.wls-stepper {
  display: flex;
  align-items: flex-start;
  width: max-content;
  min-width: 100%;
}

.wls-stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 6.5rem;
  text-align: center;
}

.wls-stepper-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 2px solid var(--wls-border);
  background: var(--wls-white);
  color: var(--wls-ink-muted);
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.wls-stepper-step.is-active .wls-stepper-circle {
  background: var(--wls-navy-deep);
  border-color: var(--wls-navy-deep);
  color: var(--wls-white);
}

.wls-stepper-label {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--wls-ink-muted);
  line-height: 1.25;
}

.wls-stepper-step.is-active .wls-stepper-label {
  color: var(--wls-navy-deep);
}

.wls-stepper-line {
  flex-grow: 1;
  height: 2px;
  background: var(--wls-border);
  margin-top: 1.1rem;
  min-width: 0.75rem;
}

/* ---- Wizard card icon header (design uplift) ----------------------------
   A circular icon badge beside a heading + one-line description, used once
   at the top of each wizard stage's card. */

.wls-card-icon-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--wls-border);
}

.wls-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: #e3edf7;
  color: var(--wls-navy);
  font-size: 1.3rem;
}

.wls-card-icon-header h2 {
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
}

.wls-card-icon-header p {
  font-size: 0.85rem;
  color: var(--wls-ink-muted);
  margin-bottom: 0;
}

/* ---- Larger, custom-styled checkbox (design uplift) ---------------------
   Used on the declaration consent checkbox — a bigger box, cleaner border,
   and a solid navy fill once checked (native checkbox, no JS). */

.wls-checkbox {
  width: 1.4em;
  height: 1.4em;
  margin-top: 0.15em;
  border: 2px solid var(--wls-border);
}

.wls-checkbox:checked {
  background-color: var(--wls-navy-deep);
  border-color: var(--wls-navy-deep);
}

.wls-checkbox:focus {
  border-color: var(--wls-navy-soft);
  box-shadow: 0 0 0 0.2rem rgba(0, 32, 81, 0.15);
}

.wls-wizard-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
}
.wls-wizard-nav .wls-pill { justify-content: center; }

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

.form-control:focus,
.form-select:focus {
  border-color: var(--wls-navy-soft);
  box-shadow: 0 0 0 0.2rem rgba(0, 32, 81, 0.15);
}

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

.wls-footer {
  color: var(--wls-ink-muted);
  font-size: 0.85rem;
}

/* color: inherit rather than the sitewide navy link color — a "Powered by"
   credit reads as understated footer text, not a primary call-to-action
   link, and inheriting means it also stays legible for free wherever the
   footer's own color is overridden (e.g. the light-on-navy login page
   below), no separate dark-background rule needed. */
.wls-footer a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: currentColor;
  opacity: 0.85;
}

.wls-footer a:hover {
  opacity: 1;
  color: var(--wls-gold-deep);
}

