/* ============================================================
   OASIS Tool Suite — shared theme tokens
   Palette: OASIS brand blue, dark blue, palm green (positive),
   light neutral background, dark slate text.
   ============================================================ */

:root {
  /* Brand palette */
  --oasis-blue: #44759D;
  --oasis-blue-dark: #2F5878;
  --oasis-green: #6B8F52;
  --oasis-bg: #F5F6F4;          /* soft off-white, not stark */
  --oasis-slate: #2B3440;       /* dark slate text */
  --oasis-slate-muted: #5A6A7A;
  --oasis-border: #D8DEDA;
  --oasis-card-bg: #FFFFFF;
  --oasis-warning: #C77E23;     /* restrained amber */
  --oasis-danger: #B0523A;      /* restrained red */
  --oasis-focus: #2F5878;

  /* Typography */
  --font-ui: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-voice: Georgia, "Times New Roman", Times, serif;

  /* Type scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;

  /* Spacing + radius */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --radius: 10px;
  --radius-sm: 6px;

  /* Motion */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--oasis-slate);
  background: var(--oasis-bg);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0 0 var(--space-3);
  color: var(--oasis-slate);
}

a {
  color: var(--oasis-blue);
  text-decoration: none;
}

a:hover {
  color: var(--oasis-blue-dark);
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* Visible keyboard focus */
:focus-visible {
  outline: 3px solid var(--oasis-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Layout shell ---------- */
.site-header {
  position: relative;
  background: var(--oasis-blue-dark);
  color: #fff;
  padding: var(--space-2) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.site-header__left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 4px;
  line-height: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.brand-logo:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.brand-logo__img {
  height: 36px;
  width: auto;
  display: block;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: #E6EDF3;
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-1) var(--space-3);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.back-link:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
  transform: translateX(-2px);
}

.back-link__icon {
  transition: transform var(--transition-fast);
}

.back-link:hover .back-link__icon {
  transform: translateX(-2px);
}

.tool-label {
  color: var(--oasis-green);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-2);
  border: 1px solid rgba(107,143,82,0.5);
  border-radius: 999px;
  white-space: nowrap;
}

/* ∎ Section navigation is centred in the ribbon regardless of how many links
   are present (e.g. when the Requests link is hidden for non-approvers the
   remaining links still centre rather than shifting left). It is absolutely
   positioned at the horizontal centre; the logo/badge stay left and the avatar
   stays right. */
.site-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  color: #E6EDF3;
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  position: relative;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}

.nav-link--active {
  color: #fff;
  font-weight: 700;
}

.nav-link--active::after {
  content: "";
  position: absolute;
  left: var(--space-3);
  right: var(--space-3);
  bottom: 2px;
  height: 3px;
  border-radius: 2px;
  background: var(--oasis-green);
}

.site-header__right {
  display: flex;
  align-items: center;
}

/* ---------- Profile dropdown ---------- */
.profile {
  position: relative;
}

.profile__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--oasis-green);
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.profile__avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.profile__dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--oasis-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(43,52,64,0.15);
  padding: var(--space-2);
  z-index: 100;
}

.profile__header {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--oasis-border);
  margin-bottom: var(--space-1);
}

.profile__name {
  display: block;
  font-family: var(--font-voice);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--oasis-slate);
}

.profile__meta {
  display: block;
  font-size: var(--text-xs);
  color: var(--oasis-slate-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.profile__item {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--oasis-slate);
  font-size: var(--text-sm);
  text-decoration: none;
}

.profile__item:hover {
  background: #EEF1EE;
  text-decoration: none;
}

.profile__signout-form {
  margin: var(--space-1) 0 0;
  padding-top: var(--space-1);
  border-top: 1px solid var(--oasis-border);
}

.profile__signout {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-sm);
  background: #C0504D;
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.profile__signout:hover {
  background: #A94441;
}

.site-main {
  /* §29: fluid content area — no fixed max-width cap. The page fills the
     viewport minus a consistent 24px gutter (16px below 768px). A very high
     safety cap (2400px) is retained for ultra-wide monitors only; it does
     not engage at 1920px or below. */
  max-width: 2400px;
  margin: 0 auto;
  padding: var(--space-6) 24px var(--space-8);
}

.site-footer {
  border-top: 1px solid var(--oasis-border);
  text-align: center;
  /* Footer v4: start close under the divider — the removed logo/wordmark
     container used to hold a larger top padding that left an empty band. */
  padding: 0.5rem var(--space-4) var(--space-5);
  color: var(--oasis-slate-muted);
  font-size: var(--text-sm);
}
.site-footer p {
  margin: 0;
}

/* ── Footer v3: one short row of links + inline registration numbers ──
   Consistent across every page (including pre-sign-in). No logos, no
   build metadata, no wordmark. */
.site-footer .footer-links-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0.9rem;
  font-size: var(--text-sm);
}
.site-footer .footer-links-row a {
  color: #1F4E78;
  text-decoration: none;
}
.site-footer .footer-links-row a:hover,
.site-footer .footer-links-row a:focus {
  text-decoration: underline;
}
.site-footer .footer-links-row .footer-links-row__sep {
  color: var(--oasis-slate-muted);
}
/* Registration numbers in small text, inline below the links. Footer v4: the
   three rows (links · entity · cookie) are one tight group. */
.site-footer .footer-reg {
  margin-top: 0.15rem;
  font-size: var(--text-xs);
  color: var(--oasis-slate-muted);
}
/* Cookie line — one line, small text, at the bottom of the footer. */
.site-footer .footer-cookie {
  margin-top: 0.15rem;
  font-size: var(--text-xs);
  color: var(--oasis-slate-muted);
}

/* Non-production environment indicator — unmistakable solid band. */
.site-footer .footer-env--nonprod {
  margin-top: var(--space-3);
  padding: 0.5rem 0.75rem;
  background: #7A1C12;
  color: #fff;
  font-size: var(--text-sm);
  border-radius: 4px;
}
.site-footer .footer-disclaimer {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--oasis-slate-muted);
  font-style: italic;
}

/* ---------- Cards ---------- */
.card {
  background: var(--oasis-card-bg);
  border: 1px solid var(--oasis-border);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: 0 1px 2px rgba(43, 52, 64, 0.04);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.card--hover:hover {
  box-shadow: 0 4px 12px rgba(43, 52, 64, 0.08);
  transform: translateY(-2px);
}

.card h2 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}
.card h3 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--oasis-slate);
  margin: var(--space-2) 0;
}
.card h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--oasis-slate);
  margin: var(--space-2) 0 0.25rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--oasis-blue);
  color: #fff;
}

.btn--primary:hover {
  background: var(--oasis-blue-dark);
  color: #fff;
  text-decoration: none;
}

.btn--positive {
  background: var(--oasis-green);
  color: #fff;
}

.btn--positive:hover {
  filter: brightness(0.94);
  color: #fff;
  text-decoration: none;
}

.btn--secondary {
  background: transparent;
  border-color: var(--oasis-border);
  color: var(--oasis-slate);
}

.btn--secondary:hover {
  background: #EEF1EE;
  text-decoration: none;
}

.btn--danger {
  background: transparent;
  border-color: var(--oasis-danger);
  color: var(--oasis-danger);
}

.btn--danger:hover {
  background: var(--oasis-danger);
  color: #fff;
  text-decoration: none;
}

.btn--sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
}

/* ---------- Forms ---------- */
.form-field {
  margin-bottom: var(--space-4);
}

.form-field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--oasis-slate);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--oasis-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--oasis-slate);
  background: #fff;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 3px solid var(--oasis-focus);
  outline-offset: 0;
  border-color: var(--oasis-blue);
}

.form-hint {
  font-size: var(--text-sm);
  color: var(--oasis-slate-muted);
  margin-top: var(--space-1);
}

/* ---------- Alerts / messages ---------- */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  border: 1px solid transparent;
}

.alert--error {
  background: #FBEAE5;
  border-color: #EBC9BD;
  color: var(--oasis-danger);
}

.alert--success {
  background: #EAF2E3;
  border-color: #C9DCBC;
  color: #4E733A;
}

.alert--warning {
  background: #FBF1E2;
  border-color: #EDD8B7;
  color: var(--oasis-warning);
}

.alert--info {
  background: #EEF4FB;
  border-color: #C7DBF0;
  color: #1F4E78;
}

/* ---------- Auth pages ---------- */
.auth-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: var(--space-4);
}

.auth-shell {
  width: 100%;
  max-width: 400px;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-shell h1 {
  font-size: var(--text-2xl);
}

/* Brand logo at the top of auth cards: centered, capped width so it is never
   clipped at the viewport edge, with a consistent gap to the title. */
.auth-logo {
  display: block;
  width: auto;
  max-width: 200px;
  height: auto;
  margin: 0 auto var(--space-4);
}

/* ---------- Home page ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-5);
}

.tool-card {
  display: block;
  color: var(--oasis-slate);
}

.tool-card:hover {
  text-decoration: none;
}

.tool-card .tool-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--oasis-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  margin-bottom: var(--space-3);
}

.tool-card--leave .tool-icon {
  background: var(--oasis-green);
}

.tool-card--audit .tool-icon {
  background: var(--oasis-blue);
}

/* SVG tool icon — the SVG carries its own rounded tile, so no background
   wrapper; keeps the same 48×48 box + bottom spacing as the old emoji tile. */
.tool-card .tool-icon--img {
  width: 48px;
  height: 48px;
  display: block;
  margin-bottom: var(--space-3);
}

.tool-card p {
  color: var(--oasis-slate-muted);
  font-size: var(--text-sm);
  margin: 0;
}

/* Coming-soon card — a plain <div>: not a link, not keyboard-focusable, no
   cursor/hover. Visibly greyed via reduced opacity on the icon and text. */
.tool-card--coming-soon {
  opacity: 0.6;
  cursor: default;
  filter: saturate(0.5);
}
.tool-card--coming-soon:hover,
.tool-card--coming-soon:focus,
.tool-card--coming-soon:active {
  box-shadow: none;
  transform: none;
  text-decoration: none;
  cursor: default;
}
.tool-card--coming-soon .tool-icon--img {
  opacity: 0.55;
}
.tool-card--coming-soon h2,
.tool-card--coming-soon p {
  opacity: 0.7;
}
.coming-soon-label {
  display: inline-block;
  margin-top: var(--space-3);
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--oasis-slate-muted);
  border-radius: 999px;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--oasis-slate-muted);
  opacity: 0.85;
}

/* Navigation feedback — thin progress bar at the very top of the page/ribbon.
   Shown on link click (nav-progress.js), cleared on page load. */
.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--oasis-focus);
  opacity: 0;
  z-index: 1500;
  pointer-events: none;
  transition: width 200ms ease, opacity 260ms ease;
}

.nav-progress--active {
  opacity: 1;
}

/* ---------- Utility ---------- */
.text-muted {
  color: var(--oasis-slate-muted);
}

.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;
}

.text-center { text-align: center; }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mb-4 { margin-bottom: var(--space-4); }

/* ---------- Responsive ---------- */
/* §29.3.1: below 768px the page gutter narrows to 16px. */
@media (max-width: 768px) {
  .site-header {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .site-nav {
    position: static;
    left: auto;
    transform: none;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .site-header__right {
    width: 100%;
    justify-content: flex-end;
  }

  .site-main {
    padding: var(--space-4) 16px var(--space-8);
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* §13 / familiarisation — persistent, non-dismissible banner (every page). */
.fam-banner {
  background: #B45309;
  color: #fff;
  font-weight: 600;
  text-align: center;
  padding: 0.6rem 1rem;
  line-height: 1.4;
}

/* §16.18 / demo — visible on every page of the anonymised demonstration dataset. */
.demo-banner {
  background: #9D174D;
  color: #fff;
  font-weight: 700;
  text-align: center;
  padding: 0.7rem 1rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

/* §16.14 — skip link: only visible on keyboard focus; jumps past navigation to
   the calendar grid. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 0.75rem 1rem;
  background: #111827;
  color: #fff;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
  outline: 2px solid var(--oasis-focus, #2563EB);
  outline-offset: -2px;
}
