/* SolutionTee Edu Academy — Deep Space Glass primitives
   =========================================================================
   The material layer. Everything here describes HOW a surface is made,
   not what it contains: glass, edge, glow, lift. Pages compose from these
   and should rarely need to invent a new surface.

   Loaded after components.css, so where a name already existed this file
   is the one that wins. Old names are kept deliberately — .btn, .card,
   .eyebrow, .notice — because rewriting 9,000 lines of template to rename
   a class is work that buys nothing.

   THE THREE RULES OF GLASS
   -----------------------
   1. A raised surface is never just lighter. It is lighter, it catches a
      highlight along its top edge, and it sits on a shadow. All three, or
      it reads as a flat rectangle someone forgot to finish.
   2. Blur is expensive and it is not free on a mid-range Android. Every
      backdrop-filter here is behind @supports and degrades to an opaque
      panel, and no page stacks more than a handful.
   3. Glow means something. Gold glow = live, urgent, now. Blue glow = the
      thing the page wants you to press. A glow for decoration is a glow
      that has stopped communicating.
   ====================================================================== */


/* ==========================================================================
   SURFACE
   ========================================================================== */

.glass {
  position: relative;
  background: var(--glass-1);
  border: 1px solid var(--edge);
  border-radius: var(--r-4);
  box-shadow: var(--glow-inset);
}

/* The highlight along the top edge — one pixel of white at 7%, and the
   entire difference between "a box" and "a surface". Drawn as a
   pseudo-element rather than a border so it can fade out at both ends. */
.glass::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 1px;
  background: var(--grad-hairline);
  border-start-start-radius: inherit;
  border-start-end-radius: inherit;
  pointer-events: none;
}

.glass--raised {
  background: var(--glass-2);
  border-color: var(--edge-strong);
  box-shadow: var(--glow-inset), var(--shadow-2);
}

.glass--deep {
  background: var(--glass-3);
  border-color: var(--edge-strong);
  box-shadow: var(--glow-inset), var(--shadow-3);
}

/* A well: the opposite move. Recessed rather than raised, for anything
   inset into a panel — a code block, a result readout, an empty state. */
.glass--well {
  background: var(--panel-sunken);
  border-color: var(--edge);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

.glass--well::before {
  display: none;
}

/* Real translucency, only where the browser can do it without falling
   back to a blank rectangle. */
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .glass--blur {
    -webkit-backdrop-filter: var(--blur-glass);
    backdrop-filter: var(--blur-glass);
  }

  .glass--blur-heavy {
    -webkit-backdrop-filter: var(--blur-heavy);
    backdrop-filter: var(--blur-heavy);
  }
}

.glass--flush { border-radius: 0; }
.glass--pill { border-radius: var(--r-pill); }


/* ==========================================================================
   MEDIA
   ==========================================================================
   A ratio box with the image cropped to fill it. The ratio is declared
   in the markup so the space is reserved before the image arrives, which
   is what stops the page jumping as photographs load.

   These lived only in admin.css, which the public layouts do not load —
   so every ratio class on the public site resolved to nothing and images
   sized themselves to whatever they happened to be. They belong in the
   shared layer, because the shared layer is where they are used.
   ========================================================================== */

.media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--panel-sunken);
}

.media > img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  display: block;
}

.media--4x3 { aspect-ratio: 4 / 3; }
.media--3x2 { aspect-ratio: 3 / 2; }
.media--16x9 { aspect-ratio: 16 / 9; }
.media--21x9 { aspect-ratio: 21 / 9; }
.media--square { aspect-ratio: 1 / 1; }
.media--portrait { aspect-ratio: 4 / 5; }

/* A reserved slot: the box an image WILL occupy, so nothing moves when
   one is chosen. Hatched rather than blank, so it reads as deliberately
   empty instead of as a failed load. */
.media--awaiting {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px dashed var(--edge-strong);
  background: var(--panel-sunken);
}

.media--awaiting::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -45deg, transparent 0 11px, var(--edge) 11px 12px);
  opacity: 0.35;
}


/* ==========================================================================
   EMPTY
   ==========================================================================
   A section with nothing in it yet, saying so. Centred, because an empty
   state is the whole content of its container rather than the first item
   in a list.
   ========================================================================== */

.empty {
  padding: var(--space-8) var(--space-5);
  text-align: center;
  background: var(--glass-1);
  border: 1px solid var(--edge);
  border-radius: var(--r-4);
}

.empty--compact {
  padding: var(--space-6) var(--space-4);
}

.empty__title {
  margin-block-end: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: var(--weight-bold);
  color: var(--ink);
}

.empty__text {
  max-inline-size: 46ch;
  margin-inline: auto;
  margin-block-end: var(--space-4);
  line-height: var(--lh-snug);
  color: var(--ink-muted);
}


/* ==========================================================================
   SPOTLIGHT
   ==========================================================================
   A panel whose edge lights up where the pointer is. motion.js writes
   --mx / --my as percentages on pointermove; with no script the fallback
   position is the top-left corner, which simply reads as a lit edge.

   This is the one piece of decoration in the system that earns its place:
   on a dark page full of low-contrast edges, it is what tells you a large
   surface is interactive at all.
   ========================================================================== */

.spotlight {
  --mx: 20%;
  --my: 0%;
  position: relative;
  isolation: isolate;
}

.spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    420px circle at var(--mx) var(--my),
    rgba(242, 178, 51, 0.55) 0%,
    rgba(94, 155, 232, 0.30) 32%,
    transparent 68%
  );
  /* Paint the gradient into the 1px padding ring only, so it is a border
     and not a wash across the whole panel. */
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
  pointer-events: none;
  z-index: 2;
}

.spotlight:hover::after,
.spotlight:focus-within::after {
  opacity: 1;
}

/* A soft interior bloom to go with the lit edge, for the larger panels
   where an edge alone is too quiet. */
.spotlight--bloom::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    380px circle at var(--mx) var(--my),
    rgba(94, 155, 232, 0.10) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
  pointer-events: none;
  z-index: 0;
}

.spotlight--bloom:hover::before,
.spotlight--bloom:focus-within::before {
  opacity: 1;
}

/* A pointer-tracked border is meaningless without a pointer, and on a
   phone it is a permanently-lit edge that never moves. */
@media (hover: none) {
  .spotlight::after,
  .spotlight--bloom::before {
    display: none;
  }
}


/* ==========================================================================
   GRAIN
   ==========================================================================
   Large flat expanses of near-black band on 8-bit displays — visible
   stepping across every gradient. A very faint noise layer breaks the
   bands up. It is 0.022 opacity: you are not meant to see it, only to
   stop seeing the banding.

   The SVG is inline as a data URI rather than a file so it costs no
   request, and it is one small tile repeated.
   ========================================================================== */

.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.022;
  pointer-events: none;
  mix-blend-mode: overlay;
  z-index: 1;
}

@media (forced-colors: active) {
  .grain::after { display: none; }
}


/* ==========================================================================
   BUTTONS
   ==========================================================================
   Four, and the hierarchy is the point:

     .btn--primary   GOLD. The one action this screen exists for. If two
                     appear in one viewport, one of them is wrong.
     .btn--brand     Blue. A strong action that is not THE action.
     .btn--outline   Glass with a control-grade border. The common case.
     .btn--quiet     Text only. Cancel, back, dismiss.

   Gold is the primary rather than navy because on this canvas navy is a
   surface colour — a navy button on a navy-black page is a hole. Gold is
   the only thing in the palette that cannot be missed, which is exactly
   what a primary action is for, and 9.9:1 of near-black on it.
   ========================================================================== */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.78em 1.45em;
  border: 1px solid transparent;
  border-radius: var(--r-3);
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: var(--weight-bold);
  line-height: 1.15;
  letter-spacing: 0.005em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  isolation: isolate;
  overflow: hidden;
  /* No transform in the transition. A button that jumps up on hover
     moves the target while the pointer is travelling toward it, which is
     the small, constant annoyance that made the old hover feel cheap.
     What changes instead is the SURFACE: a sheen crosses it, the shadow
     deepens, the colour warms. The button stays exactly where it is. */
  transition: box-shadow var(--dur-base) var(--ease-out),
              background-color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

/* The sheen: a narrow band of light that crosses the button once, left
   to right, when the pointer arrives. It is 340ms and it does not
   repeat — a looping shimmer is a loading state, and this is not one. */
.btn::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: -60%;
  inline-size: 45%;
  background: linear-gradient(100deg,
              transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-18deg);
  opacity: 0;
  pointer-events: none;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .btn:hover::after {
    animation: btn-sheen 640ms var(--ease-out);
  }
}

@keyframes btn-sheen {
  from { inset-inline-start: -60%; opacity: 1; }
  to { inset-inline-start: 120%; opacity: 0; }
}

/* Press is the one place a transform belongs: it happens after the
   pointer has already arrived, so it cannot move the target. */
.btn:active {
  transform: scale(0.975);
  transition-duration: var(--dur-instant);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn:disabled::after,
.btn[aria-disabled="true"]::after { display: none; }

/* ---- Primary: gold --------------------------------------------------- */
.btn--primary {
  background: var(--grad-accent);
  color: var(--ink-on-accent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset,
              0 6px 20px rgba(242, 178, 51, 0.22);
}

.btn--primary:hover {
  color: var(--ink-on-accent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset,
              0 10px 32px rgba(242, 178, 51, 0.38),
              var(--glow-gold);
}

/* ---- Brand: blue ----------------------------------------------------- */
.btn--brand {
  background: var(--grad-brand);
  color: var(--ink-on-brand);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset,
              0 6px 20px rgba(37, 99, 179, 0.28);
}

.btn--brand:hover {
  color: var(--ink-on-brand);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset,
              0 10px 32px rgba(37, 99, 179, 0.42),
              var(--glow-blue);
}

/* ---- Outline: glass -------------------------------------------------- */
.btn--outline {
  background: var(--glass-2);
  border-color: var(--edge-control);
  color: var(--ink);
}

.btn--outline:hover {
  background: var(--glass-3);
  border-color: var(--edge-bright);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

/* ---- Quiet: text ----------------------------------------------------- */
.btn--quiet {
  --btn-lift: 0px;
  padding-inline: 0.6em;
  background: transparent;
  color: var(--ink-muted);
}

.btn--quiet:hover {
  background: var(--glass-2);
  color: var(--ink);
}

/* ---- Danger ---------------------------------------------------------- */
.btn--danger {
  background: var(--danger-bg);
  border-color: var(--danger-edge);
  color: var(--danger);
}

.btn--danger:hover {
  background: color-mix(in srgb, var(--danger) 22%, transparent);
  border-color: var(--danger);
  color: var(--danger);
}

/* Kept as an alias: existing templates use it for the gold call to
   action, which is now what --primary means. */
.btn--accent {
  background: var(--grad-accent);
  color: var(--ink-on-accent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset,
              0 6px 20px rgba(242, 178, 51, 0.22);
}

.btn--accent:hover {
  color: var(--ink-on-accent);
  box-shadow: 0 10px 32px rgba(242, 178, 51, 0.38), var(--glow-gold);
}

/* ---- Sizes ----------------------------------------------------------- */
/* Both spellings. Eleven templates say --small and one says --sm, and
   --small was only ever defined inside admin.css — so every small button
   on the public site and in the examination paper was rendering at full
   size. Aliasing is cheaper and safer than editing twelve templates, and
   the duplicate name is recorded here rather than left to be
   rediscovered. */
.btn--sm,
.btn--small {
  padding: 0.55em 1em;
  font-size: var(--step--2);
  border-radius: var(--r-2);
}

.btn--lg {
  padding: 0.95em 1.9em;
  font-size: var(--step-0);
  border-radius: var(--r-4);
}

.btn--block {
  display: flex;
  inline-size: 100%;
}

/* The arrow inside a button nudges forward on hover — a 3px cue that the
   press goes somewhere, which a colour change alone does not say. */
.btn svg,
.btn__arrow {
  inline-size: 1.05em;
  block-size: 1.05em;
  flex: none;
  transition: transform var(--dur-base) var(--ease-spring);
}

.btn:hover svg,
.btn:hover .btn__arrow {
  transform: translateX(3px);
}


/* ==========================================================================
   ICON BUTTON
   ========================================================================== */

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 42px;
  block-size: 42px;
  flex: none;
  padding: 0;
  background: var(--glass-2);
  border: 1px solid var(--edge);
  border-radius: var(--r-3);
  color: var(--ink-muted);
  cursor: pointer;
  transition: background-color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.icon-btn:hover {
  background: var(--glass-3);
  border-color: var(--edge-strong);
  color: var(--ink);
}

.icon-btn:active { transform: scale(0.94); }

.icon-btn svg {
  inline-size: 18px;
  block-size: 18px;
}


/* ==========================================================================
   EYEBROW
   ==========================================================================
   The small spaced label above a section heading, with an optional index.
   Gold, monospaced index, and a short rule running out to the right — the
   rule is what stops it floating.
   ========================================================================== */

.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-size: var(--step--2);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-accent);
}

.eyebrow::after {
  content: "";
  flex: 1;
  block-size: 1px;
  background: linear-gradient(90deg, var(--edge-gold), transparent);
}

.eyebrow__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 26px;
  padding: 2px 6px;
  background: var(--warning-bg);
  border: 1px solid var(--edge-gold);
  border-radius: var(--r-1);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}


/* ==========================================================================
   CHIPS · BADGES · STATUS
   ========================================================================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.34em 0.8em;
  background: var(--glass-2);
  border: 1px solid var(--edge);
  border-radius: var(--r-pill);
  font-size: var(--step--2);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

a.chip:hover,
button.chip:hover {
  background: var(--glass-3);
  border-color: var(--edge-strong);
  color: var(--ink);
}

.chip--accent {
  background: var(--warning-bg);
  border-color: var(--edge-gold);
  color: var(--ink-accent);
}

.chip--brand {
  background: var(--info-bg);
  border-color: var(--edge-strong);
  color: var(--ink-brand);
}

.chip[aria-current="true"],
.chip.is-active {
  background: var(--glass-4);
  border-color: var(--edge-bright);
  color: var(--ink);
}

/* Status, with a dot. The dot is never the only signal — the word beside
   it carries the same information, because a colour-blind student reading
   "Open" does not need to resolve the green. */
.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--step--2);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.status__dot {
  inline-size: 7px;
  block-size: 7px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.status--open { color: var(--success); }
.status--soon { color: var(--warning); }
.status--closed { color: var(--ink-faint); }

/* A live state pulses. Nothing else on the page does, so the pulse is
   unambiguous: it means "happening now". */
.status--live {
  color: var(--accent);
}

.status--live .status__dot {
  animation: pulse-dot 2s var(--ease-in-out) infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 178, 51, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(242, 178, 51, 0); }
}

/* A count on a nav item. */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 20px;
  block-size: 20px;
  padding-inline: 5px;
  background: var(--grad-accent);
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  color: var(--ink-on-accent);
}


/* ==========================================================================
   CARD
   ========================================================================== */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--glass-1);
  border: 1px solid var(--edge);
  border-radius: var(--r-4);
  box-shadow: var(--glow-inset);
  text-decoration: none;
  color: inherit;
  /* See .btn: nothing translates on hover. A card that lifts pushes its
     own shadow around and shifts the text you were about to read. The
     border brightens and the shadow deepens instead — the card appears
     to come forward without moving. */
  transition: border-color var(--dur-base) var(--ease-out),
              background-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-slow) var(--ease-out);
}

.card::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 1px;
  background: var(--grad-hairline);
  border-start-start-radius: inherit;
  border-start-end-radius: inherit;
  pointer-events: none;
}

a.card:hover,
.card--interactive:hover {
  background: var(--glass-2);
  border-color: var(--edge-bright);
  box-shadow: var(--glow-inset), var(--shadow-2);
}

.card__title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-heading);
  line-height: var(--lh-heading);
  color: var(--ink);
}

.card__body,
.card__text {
  margin: 0;
  color: var(--ink-muted);
  font-size: var(--step--1);
  line-height: var(--lh-snug);
}

/* The whole card is a link, but only the title is focusable — a card with
   five tab stops is a card nobody keyboards through. The pseudo-element
   stretches the title's hit area over the entire card. */
.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 1;
}


/* ==========================================================================
   METRIC — the dashboard stat tile
   ==========================================================================
   Label above, number below, optional trailing detail. The number is the
   display face with tabular figures at a size that makes it the only
   thing you read first.
   ========================================================================== */

.metric {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-5);
  background: var(--glass-1);
  border: 1px solid var(--edge);
  border-radius: var(--r-4);
  box-shadow: var(--glow-inset);
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 1px;
  background: var(--grad-hairline);
  pointer-events: none;
}

.metric__label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--step--2);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-faint);
}

.metric__value {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-heading);
  line-height: var(--lh-tight);
  color: var(--ink);
}

.metric__detail {
  font-size: var(--step--1);
  color: var(--ink-muted);
  line-height: var(--lh-snug);
}

/* A metric that needs attention takes the gold edge and a bloom behind
   the number. One per dashboard, at most. */
.metric--urgent {
  border-color: var(--edge-gold);
  background: var(--warning-bg);
}

.metric--urgent .metric__value { color: var(--ink-accent); }
.metric--urgent .metric__label { color: var(--ink-accent); }

.metric--urgent::after {
  content: "";
  position: absolute;
  inset-block-start: -40%;
  inset-inline-end: -20%;
  inline-size: 180px;
  block-size: 180px;
  background: radial-gradient(circle, rgba(242, 178, 51, 0.16), transparent 70%);
  pointer-events: none;
}

.metric--good { border-color: var(--success-edge); }
.metric--good .metric__value { color: var(--success); }


/* ==========================================================================
   PROGRESS
   ========================================================================== */

.progress {
  position: relative;
  block-size: 6px;
  inline-size: 100%;
  background: var(--panel-sunken);
  border: 1px solid var(--edge);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.progress__bar {
  display: block;
  block-size: 100%;
  background: var(--grad-accent);
  border-radius: inherit;
  box-shadow: 0 0 12px rgba(242, 178, 51, 0.45);
  transition: inline-size var(--dur-page) var(--ease-out);
}

.progress--brand .progress__bar {
  background: var(--grad-brand);
  box-shadow: 0 0 12px rgba(37, 99, 179, 0.5);
}


/* ==========================================================================
   FIELDS
   ==========================================================================
   Moved to forms.css, which owns every control on the site and loads
   after this file. Having two stylesheets both claiming .input was how
   the control border ended up decided by load order rather than by
   anybody's decision.
   ========================================================================== */


/* ==========================================================================
   NOTICE
   ========================================================================== */

.notice {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  background: var(--glass-2);
  border: 1px solid var(--edge-strong);
  border-inline-start: 3px solid var(--ink-faint);
  border-radius: var(--r-3);
  color: var(--ink-muted);
  font-size: var(--step--1);
  line-height: var(--lh-snug);
}

.notice__label {
  font-family: var(--font-display);
  font-size: var(--step--2);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink);
}

.notice__body { color: var(--ink-muted); }

.notice--info {
  background: var(--info-bg);
  border-color: var(--info-edge);
  border-inline-start-color: var(--info);
}

.notice--info .notice__label { color: var(--info); }

.notice--warning {
  background: var(--warning-bg);
  border-color: var(--warning-edge);
  border-inline-start-color: var(--warning);
}

.notice--warning .notice__label { color: var(--ink-accent); }

.notice--success {
  background: var(--success-bg);
  border-color: var(--success-edge);
  border-inline-start-color: var(--success);
}

.notice--success .notice__label { color: var(--success); }

.notice--danger {
  background: var(--danger-bg);
  border-color: var(--danger-edge);
  border-inline-start-color: var(--danger);
}

.notice--danger .notice__label { color: var(--danger); }


/* ==========================================================================
   SECTION GROUNDS
   ==========================================================================
   .on-aurora and .on-band carry their own ink scale (see tokens.css), so
   putting one of these on a <section> is all that is needed — everything
   inside re-measures itself.
   ========================================================================== */

.on-aurora {
  position: relative;
  background: var(--aurora), var(--canvas);
  isolation: isolate;
}

.on-aurora--calm {
  background: var(--aurora-calm), var(--canvas);
}

.on-band {
  position: relative;
  background: var(--band);
  isolation: isolate;
}

/* A hairline across the top of a band, so the seam is drawn rather than
   left as an abrupt colour change. */
.on-band::before,
.on-aurora::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 1px;
  background: var(--grad-rule);
  pointer-events: none;
  z-index: 2;
}


/* ==========================================================================
   ORBS
   ==========================================================================
   The soft coloured lights that drift behind a hero. Purely atmospheric,
   aria-hidden, and removed entirely under reduced motion and forced
   colours. They are absolutely positioned by the page that uses them.
   ========================================================================== */

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  /* Tokenised with the colours, because "how strong" and "what colour"
     are one decision: 0.5 is right over a night sky and roughly double
     what a pale wash can take. */
  opacity: var(--orb-opacity);
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

/* The brand ramp, not the hex. These are decorative lights drifting
   behind the hero, and the aurora they sit on is a night sky in the dark
   theme and a pale blue-and-white wash in the light one — so the orb
   that reads as a soft glow on navy reads as a bruise on white. Driving
   them from --blue-600 / --gold-500 means the light theme can dial them
   back without anybody hunting for a literal in a component file. */
.orb--blue { background: radial-gradient(circle, var(--orb-blue), transparent 70%); }
.orb--gold { background: radial-gradient(circle, var(--orb-gold), transparent 70%); }
.orb--deep { background: radial-gradient(circle, var(--orb-deep), transparent 70%); }

@media (prefers-reduced-motion: reduce) {
  .orb { opacity: calc(var(--orb-opacity) * 0.56); }
}

@media (forced-colors: active) {
  .orb { display: none; }
}


/* ==========================================================================
   SCROLL PROGRESS
   ==========================================================================
   A one-pixel gold line across the top of the viewport. motion.js scales
   it; with no script it stays at zero width and is simply invisible.
   ========================================================================== */

.scroll-progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  inline-size: 100%;
  block-size: 2px;
  z-index: var(--z-toast);
  pointer-events: none;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--blue-400), var(--gold-500));
  box-shadow: 0 0 12px rgba(242, 178, 51, 0.6);
}


/* ==========================================================================
   DIVIDERS
   ========================================================================== */

.rule {
  block-size: 1px;
  inline-size: 100%;
  background: var(--grad-rule);
  border: none;
  margin: 0;
}

.rule--gold {
  background: linear-gradient(90deg, transparent, var(--edge-gold), transparent);
}


/* ==========================================================================
   UTILITIES
   ========================================================================== */

.text-muted { color: var(--ink-muted); }
.text-faint { color: var(--ink-faint); }
.text-accent { color: var(--ink-accent); }
/* Used where a moderation row has to say WHY a comment is hidden — spam
   is a different judgement from taken down, and the word needs to read
   as one. */
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-brand { color: var(--ink-brand); }
.text-display { font-family: var(--font-display); }

.lede {
  font-size: var(--step-1);
  line-height: var(--lh-snug);
  color: var(--ink-muted);
  max-inline-size: var(--measure);
  text-wrap: pretty;
}

.label {
  font-family: var(--font-display);
  font-size: var(--step--2);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-faint);
}


/* ==========================================================================
   PANEL
   ==========================================================================
   The unit a dashboard is made of: a titled glass surface with a body.
   ========================================================================== */

.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--glass-1);
  border: 1px solid var(--edge);
  border-radius: var(--r-4);
  box-shadow: var(--glow-inset);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 1px;
  background: var(--grad-hairline);
  pointer-events: none;
}

.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-5) var(--space-3);
}

/* A sentence under a panel heading, for the one thing about a list that
   is not obvious from the rows: "kept, not deleted". Sits opposite the
   title on the same baseline, which is why .panel__head is a flex row
   with space-between rather than a block. */
.panel__note {
  flex: 0 1 26rem;
  font-size: var(--step--2);
  line-height: var(--lh-snug);
  color: var(--ink-faint);
  text-align: end;
  text-wrap: pretty;
}

@media (max-width: 40rem) {
  .panel__note { flex-basis: 100%; text-align: start; }
}

.panel__title {
  font-family: var(--font-display);
  font-size: var(--step--2);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* A panel's one corner link. Padded to a 44px target and pulled back
   out by the same amount, so it keeps its optical alignment with the
   title's baseline while the hit area extends past the text. Without
   this it is a 19px-tall tap target in the corner of a phone screen. */
.panel__action {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  padding-inline: var(--space-3);
  margin-inline-end: calc(var(--space-3) * -1);
  margin-block: calc(var(--space-3) * -1);
  border-radius: var(--r-2);
  font-size: var(--step--2);
  font-weight: var(--weight-semibold);
  color: var(--ink-brand);
  text-decoration: none;
  white-space: nowrap;
}

.panel__action:hover { text-decoration: underline; }

.panel__body {
  padding: 0 var(--space-5) var(--space-5);
}

.panel__body--flush {
  padding-inline: 0;
  padding-block-end: 0;
}


/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.blank {
  display: grid;
  gap: var(--space-4);
  justify-items: start;
  padding: var(--space-8) var(--space-5);
  text-align: start;
}

.blank__title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: var(--weight-bold);
  color: var(--ink);
}

.blank__text {
  max-inline-size: 46ch;
  color: var(--ink-muted);
  line-height: var(--lh-snug);
}

.blank__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-block-start: var(--space-2);
}


/* ==========================================================================
   A BUTTON THAT IS WORKING
   ==========================================================================
   Every form here does something slow — taking a payment, marking a
   paper, uploading an image — and on a Nigerian mobile connection the
   gap before the next page arrives is routinely two or three seconds. A
   button that looks identical during that gap invites a second press,
   which for a payment means a second reference.

   The label is hidden with `visibility` rather than `display: none` so
   the button keeps the size its text gave it; interactions.js also pins
   the measured width, because a label replaced by a spinner otherwise
   collapses the button and the card jumps at the moment somebody has
   just committed to paying.

   `aria-disabled`, not `disabled`: a disabled button leaves the tab
   order and focus falls to the top of the document. The double-submit
   guard is a flag on the form, not the button's state.
   ========================================================================== */

.btn.is-busy {
  position: relative;
  cursor: progress;
  pointer-events: none;
}

.btn.is-busy > * {
  visibility: hidden;
}

.btn.is-busy::before {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  inline-size: 1.05em;
  block-size: 1.05em;
  margin-block-start: -0.525em;
  margin-inline-start: -0.525em;
  border: 2px solid currentColor;
  /* One transparent edge is what makes a ring read as spinning. */
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0.9;
  animation: btn-spin 620ms linear infinite;
}

/* The sheen on hover is decoration and must not run underneath a
   spinner — two things moving in one button reads as a glitch. */
.btn.is-busy::after {
  animation: none;
  opacity: 0;
}

@keyframes btn-spin {
  to { transform: rotate(1turn); }
}

/* Reduced motion gets a pulse instead of a rotation: the information
   ("this is working") is preserved, the spin is not. */
@media (prefers-reduced-motion: reduce) {
  .btn.is-busy::before {
    animation: btn-pulse 1.1s ease-in-out infinite;
    border-top-color: currentColor;
  }

  @keyframes btn-pulse {
    0%, 100% { opacity: 0.25; }
    50%      { opacity: 0.9; }
  }
}

/* Forced colours strips the border colours that make the ring visible. */
@media (forced-colors: active) {
  .btn.is-busy::before {
    border-color: CanvasText;
    border-top-color: Canvas;
  }
}


/* ==========================================================================
   NOTIFICATIONS DROPDOWN
   ==========================================================================
   The bell, in BOTH shells. It lived in console.css until the public
   header grew one too, at which point a component used by two shells
   belonged in the stylesheet both of them load.

   Its list scrolls and its head does not — unbounded, a busy
   account grew this panel past the bottom of the screen and the oldest
   notifications could not be reached at all.
   ========================================================================== */

.dropdown { position: relative; }

.dropdown__panel {
  position: absolute;
  inset-block-start: calc(100% + var(--space-2));
  inset-inline-end: 0;
  z-index: var(--z-drawer);
  inline-size: 21rem;
  max-inline-size: calc(100vw - var(--space-6));
  background: var(--panel-raised);
  border: 1px solid var(--edge-strong);
  border-radius: var(--r-4);
  box-shadow: var(--glow-inset), var(--shadow-3);
  overflow: hidden;
}

@supports (backdrop-filter: blur(1px)) {
  .dropdown__panel {
    background: color-mix(in srgb, var(--panel-raised) 92%, transparent);
    -webkit-backdrop-filter: var(--blur-heavy);
    backdrop-filter: var(--blur-heavy);
  }
}

.js .dropdown__panel:not([hidden]) {
  animation: menu-in var(--dur-base) var(--ease-out) both;
}

.dropdown__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-block-end: 1px solid var(--edge);
  font-family: var(--font-display);
  font-size: var(--step--2);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-faint);
}

.dropdown__head button {
  font-size: var(--step--2);
  font-weight: var(--weight-semibold);
  color: var(--ink-accent);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}

.notes__list {
  max-block-size: min(60vh, 26rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  color: var(--ink-muted);
  transition: background-color var(--dur-fast) var(--ease-out);
}

.note + .note { border-block-start: 1px solid var(--edge); }
.note:hover { background: var(--glass-2); }

.note__dot {
  inline-size: 7px;
  block-size: 7px;
  flex: none;
  margin-block-start: 0.45em;
  border-radius: 50%;
  background: transparent;
}

.note--unread .note__dot { background: var(--accent); }
.note--unread .note__title { color: var(--ink); }

.note__text { min-inline-size: 0; }

.note__title {
  display: block;
  font-size: var(--step--1);
  font-weight: var(--weight-semibold);
  color: var(--ink-muted);
}

.note__body,
.note__time {
  display: block;
  font-size: var(--step--2);
  color: var(--ink-faint);
}

.note__time { margin-block-start: 2px; }

.notes__empty {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  font-size: var(--step--1);
  color: var(--ink-faint);
}



/* ==========================================================================
   THEME TOGGLE
   ==========================================================================
   ONE BUTTON SHOWING ONE ICON: the moon when a press would take you to
   dark, the sun when it would take you back. Showing both at once asks
   the reader to work out which is the state and which is the action.

   IN glass.css, NOT nav.css. These rules lived in the public site's
   stylesheet, which the console and the sign-in shells do not load — so
   on every one of those pages BOTH icons rendered inside the button.
   Every shell loads glass.css through the shared bundle.
   ========================================================================== */

.theme-icon { display: none; }

/* Light is the default, so the default icon is the MOON — the thing a
   press would take you to. On dark it swaps to the sun. */
.theme-icon--moon { display: block; }

:root[data-theme="dark"] .theme-icon--moon { display: none; }
:root[data-theme="dark"] .theme-icon--sun { display: block; }
