/* Sitescan design tokens and components.
 *
 * White-labelling rule: no component ever hard-codes a brand colour. Only
 * --brand-primary and --brand-accent are injected (from Branding.resolve);
 * every shade below is derived from them with color-mix(). Changing a
 * customer's hex re-themes the entire interface, including states and tints,
 * with no stylesheet rebuild.
 *
 * Visual intent: a precise instrument, not a dashboard. Dense where the data
 * is, calm everywhere else. Brand colour is reserved for action and active
 * state so that status colours (flagged / awaiting source) stay legible.
 */

:root {
  /* Injected per customer in base.html; these are only fallbacks. */
  --brand-primary: #1d4f91;
  --brand-accent: #0f9b8e;

  /* Derived brand ramp. */
  --brand-primary-hover: color-mix(in srgb, var(--brand-primary) 85%, black);
  --brand-primary-soft: color-mix(in srgb, var(--brand-primary) 12%, var(--surface));
  --brand-primary-line: color-mix(in srgb, var(--brand-primary) 35%, var(--border));
  --brand-primary-ink: color-mix(in srgb, var(--brand-primary) 70%, var(--ink));
  --brand-accent-soft: color-mix(in srgb, var(--brand-accent) 14%, var(--surface));

  /* The ink that sits ON a brand-primary surface (primary buttons, map pins,
   * candidate chips, the auth gradient). One token rather than a #fff per
   * component: the branding layer may later compute it from the contrast of
   * the injected --brand-primary, and then a light brand colour gets dark
   * ink everywhere at once. Pure white is only the current default. */
  --brand-on-primary: #ffffff;

  /* Neutrals. */
  --canvas: #f6f7f9;
  --surface: #ffffff;
  --surface-sunken: #f0f2f5;
  --border: #d9dde3;
  --border-strong: #b9c0ca;
  --ink: #16191d;
  --ink-muted: #5c6673;
  --ink-faint: #8b94a1;

  /* Status. Deliberately not brand-derived: these must read the same
   * regardless of which customer's palette is loaded. */
  --ok: #1a7f52;
  --ok-soft: #e6f4ec;
  --warn: #9a6400;
  --warn-soft: #fdf3e0;
  --danger: #a32020;
  --danger-soft: #fbeaea;
  --pending: #5c6673;
  --pending-soft: #eef0f3;

  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 20, 28, 0.06);
  --shadow-md: 0 4px 14px rgba(16, 20, 28, 0.1);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --step: 4px;
  --header-h: 56px;

  color-scheme: light;
}

/* Theme is explicit, not OS-derived: light is the product default and
 * data-theme="dark" is an opt-in set by the header toggle (persisted in
 * localStorage, applied pre-paint in base.html). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #14171b;
  --surface: #1b1f25;
  --surface-sunken: #22272e;
  --border: #2f363f;
  --border-strong: #434c57;
  --ink: #e8ebef;
  --ink-muted: #a2abb7;
  --ink-faint: #76808d;

  --ok: #4cc08a;
  --ok-soft: #14301f;
  --warn: #e0a33a;
  --warn-soft: #302512;
  --danger: #e97070;
  --danger-soft: #331717;
  --pending: #a2abb7;
  --pending-soft: #262b32;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0 0 calc(var(--step) * 2);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 20px;
}
h2 {
  font-size: 16px;
}
h3 {
  font-size: 14px;
}

a {
  color: var(--brand-primary-ink);
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-color: currentColor;
}

code,
.mono,
.coord {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--ink-muted);
}
.faint {
  color: var(--ink-faint);
}
.small {
  font-size: 12px;
}

/* ---------- app chrome ---------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: calc(var(--step) * 4);
  height: var(--header-h);
  padding: 0 calc(var(--step) * 5);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: calc(var(--step) * 2);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.app-brand__mark-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.app-brand__logo {
  max-height: 28px;
  max-width: 150px;
  object-fit: contain;
}

.app-nav {
  display: flex;
  gap: var(--step);
  margin-left: calc(var(--step) * 2);
}

.app-nav a {
  padding: calc(var(--step) * 1.5) calc(var(--step) * 3);
  border-radius: var(--radius);
  color: var(--ink-muted);
  font-weight: 500;
  text-decoration: none;
}

.app-nav a:hover {
  background: var(--surface-sunken);
  color: var(--ink);
}

.app-nav a[aria-current="page"] {
  background: var(--brand-primary-soft);
  color: var(--brand-primary-ink);
}

.app-header__right {
  display: flex;
  align-items: center;
  gap: calc(var(--step) * 3);
  margin-left: auto;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--surface-sunken);
  color: var(--ink);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Show the icon for the theme you would switch TO. */
.theme-toggle__sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle__sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle__moon {
  display: none;
}

.tenant-chip {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--step) * 1.5);
  padding: calc(var(--step) * 1) calc(var(--step) * 2.5);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-muted);
}

.app-main {
  padding: calc(var(--step) * 6) calc(var(--step) * 5);
  max-width: 1400px;
  margin: 0 auto;
}

.app-main--wide {
  max-width: none;
  padding: 0;
}

.app-footer {
  padding: calc(var(--step) * 4) calc(var(--step) * 5);
  color: var(--ink-faint);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

/* ---------- layout helpers ---------- */

.page-head {
  display: flex;
  align-items: flex-start;
  gap: calc(var(--step) * 4);
  margin-bottom: calc(var(--step) * 5);
}

.page-head__actions {
  display: flex;
  gap: calc(var(--step) * 2);
  margin-left: auto;
}

.stack > * + * {
  margin-top: calc(var(--step) * 3);
}
.stack-lg > * + * {
  margin-top: calc(var(--step) * 5);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(var(--step) * 2);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: calc(var(--step) * 5);
}

@media (max-width: 1000px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- card ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card__head {
  display: flex;
  align-items: center;
  gap: calc(var(--step) * 2);
  padding: calc(var(--step) * 3) calc(var(--step) * 4);
  border-bottom: 1px solid var(--border);
}

.card__head h2,
.card__head h3 {
  margin: 0;
}

.card__body {
  padding: calc(var(--step) * 4);
}

.card__body--flush {
  padding: 0;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--step) * 1.5);
  padding: calc(var(--step) * 2) calc(var(--step) * 3.5);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-sunken);
}

.btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-on-primary);
}

.btn--primary:hover {
  background: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
}

.btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-muted);
}

.btn--ghost:hover {
  background: var(--surface-sunken);
  color: var(--ink);
}

.btn--danger {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
  color: var(--danger);
}

.btn--sm {
  padding: calc(var(--step) * 1) calc(var(--step) * 2);
  font-size: 12px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- forms ---------- */

.field {
  display: block;
}

.field__label {
  display: block;
  margin-bottom: var(--step);
  font-weight: 500;
  font-size: 13px;
}

.field__hint {
  margin-top: var(--step);
  font-size: 12px;
  color: var(--ink-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: calc(var(--step) * 2) calc(var(--step) * 2.5);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

/* A read-only textarea must look read-only: a planner without edit rights
 * should not discover that by typing into it. */
textarea[readonly] {
  background: var(--surface-sunken);
  color: var(--ink-muted);
  resize: none;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-soft);
}

.errorlist {
  margin: var(--step) 0 0;
  padding: 0;
  list-style: none;
  color: var(--danger);
  font-size: 12px;
}

/* ---------- table ---------- */

/* No scroll container by default. An `overflow-x: auto` here makes the
 * wrapper the nearest scrollport, and because the wrapper itself never
 * scrolls vertically the sticky thead below had nothing to stick to. With
 * the page as the scrollport the header sticks under .app-header instead. */
.table-wrap {
  overflow-x: visible;
}

/* For the tables that genuinely can be wider than their column — the export
 * history in the 340px side column, the review matrix — put the horizontal
 * scroller back explicitly. */
.table-wrap--scroll {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

table.data th,
table.data td {
  padding: calc(var(--step) * 2.5) calc(var(--step) * 3);
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.data thead th {
  position: sticky;
  /* The page is the scrollport, and .app-header occupies its first 56px:
   * sticking at 0 would park the column names underneath it. z-index keeps
   * the row above the cells that follow it in the DOM, and stays well below
   * .app-header's 40 so the header still wins. */
  top: var(--header-h);
  z-index: 1;
  background: var(--surface-sunken);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* Inside a scroll container the wrapper is the scrollport, so the offset is
 * measured from its own top edge, not from the app header. */
.table-wrap--scroll table.data thead th {
  top: 0;
}

table.data tbody tr:hover {
  background: var(--brand-primary-soft);
}

table.data tr:last-child td {
  border-bottom: none;
}

.row-group th {
  background: var(--surface-sunken);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

/* Narrower than the .split breakpoint a dense table will not fit whatever we
 * do, so every wrapper gets its scroller back. Sticky headers are given up
 * there; a table you have to pan sideways is read a column at a time anyway. */
@media (max-width: 1000px) {
  .table-wrap {
    overflow-x: auto;
  }

  table.data thead th {
    top: 0;
  }
}

/* ---------- key/value definition list ---------- */

/* Label column as wide as the labels need, value column takes the rest.
 *
 * The second track is minmax(0, 1fr), never a bare 1fr: 1fr means
 * minmax(auto, 1fr), and that auto floor is the width of the longest
 * unbreakable word — a sha256, a code version — which then pushes the grid
 * past its container. Paired with overflow-wrap on the value so the long
 * string breaks instead. Same pattern as .kv in map.css. */
.dl-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: calc(var(--step) * 1.5) calc(var(--step) * 3);
  margin: 0;
}

.dl-grid--tight {
  gap: var(--step) calc(var(--step) * 3);
}

.dl-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* ---------- checksum disclosure ---------- */

/* A sha256 in a table column: the first twelve characters identify the file
 * at a glance, and the native <details> opens the full value as text that
 * can actually be selected and copied — which a title attribute cannot. */
.sum__short {
  cursor: pointer;
  white-space: nowrap;
  color: var(--ink-muted);
}

.sum[open] .sum__short {
  color: var(--ink);
}

.sum__full {
  display: block;
  margin-top: var(--step);
  max-width: 26ch;
  font-size: 11px;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
  user-select: all;
}

/* ---------- badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--step) * 1);
  padding: 1px calc(var(--step) * 1.75);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge--ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.badge--warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge--danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.badge--pending {
  background: var(--pending-soft);
  color: var(--pending);
}
.badge--brand {
  background: var(--brand-primary-soft);
  color: var(--brand-primary-ink);
}
.badge--accent {
  background: var(--brand-accent-soft);
  /* More ink than --brand-primary-ink's 70%: accents are chosen bright, and
   * 11px semibold text needs the extra contrast against --brand-accent-soft. */
  color: color-mix(in srgb, var(--brand-accent) 55%, var(--ink));
}

/* ---------- callouts ---------- */

.callout {
  display: flex;
  gap: calc(var(--step) * 3);
  padding: calc(var(--step) * 3) calc(var(--step) * 4);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.callout--warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}
.callout--danger {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}
.callout--info {
  border-left-color: var(--brand-primary);
  background: var(--brand-primary-soft);
}
.callout--ok {
  border-left-color: var(--ok);
  background: var(--ok-soft);
}

.callout__title {
  font-weight: 600;
  margin-bottom: calc(var(--step) * 0.5);
}

/* ---------- empty state ---------- */

.empty {
  padding: calc(var(--step) * 12) calc(var(--step) * 6);
  text-align: center;
  color: var(--ink-muted);
}

.empty__title {
  margin-bottom: var(--step);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.empty__body {
  max-width: 46ch;
  margin: 0 auto calc(var(--step) * 4);
}

/* ---------- provenance disclosure ---------- */

/* A fact with its source. The source is always reachable but never shouts;
 * the planner should be able to scan values and drill only where suspicious. */
.cell-value {
  display: flex;
  align-items: baseline;
  gap: calc(var(--step) * 1.5);
}

.prov {
  position: relative;
  display: inline-block;
}

.prov__toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

/* The visual circle stays 16px — dense tables cannot afford more — but the
 * pointer/touch target is grown to 24px with a transparent overlay. */
.prov__toggle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
}

.prov__toggle:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.prov__panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: 340px;
  max-width: 80vw;
  padding: calc(var(--step) * 3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  text-align: left;
}

.prov__panel dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--step) calc(var(--step) * 2);
  margin: 0;
}

.prov__panel dt {
  color: var(--ink-muted);
  white-space: nowrap;
}

.prov__panel dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* ---------- progress ---------- */

.steps {
  display: flex;
  gap: calc(var(--step) * 2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps li {
  display: flex;
  align-items: center;
  gap: calc(var(--step) * 1.5);
  font-size: 12px;
  color: var(--ink-faint);
}

.steps li[data-state="done"] {
  color: var(--ok);
}
.steps li[data-state="active"] {
  /* Same derivation as .badge--accent: raw --brand-accent is too light for
   * 12px label text on --canvas, so mix ink in and keep the accent hue. */
  color: color-mix(in srgb, var(--brand-accent) 55%, var(--ink));
  font-weight: 600;
}

.steps__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--brand-primary-soft);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2s;
  }
}

/* ---------- htmx in-flight feedback ---------- */

/* htmx puts .htmx-request on the element that issued the request (and on any
 * hx-indicator target) for exactly as long as it is in flight. Dimming it is
 * the cheapest honest answer to "did my click register?". */
.htmx-request {
  opacity: 0.6;
  cursor: progress;
}

/* Background polling is not progress the planner asked for: a target that
 * refreshes itself every 1500ms would flicker rather than reassure. */
[hx-trigger*="every"].htmx-request,
[data-hx-trigger*="every"].htmx-request {
  opacity: 1;
  cursor: auto;
}

/* ---------- utility ---------- */

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

[hidden] {
  display: none !important;
}

/* ==========================================================================
 * login & wachtwoordherstel (auth pages)
 *
 * APPENDED SECTION — owns only .auth-* selectors. It references (never
 * modifies) .card, .btn, .field, .callout and .theme-toggle from above.
 *
 * Colour rule as elsewhere in this file: every brand shade is derived from
 * the injected --brand-primary / --brand-accent via color-mix(). Text that
 * sits ON the brand gradient uses --brand-on-primary, exactly like
 * .btn--primary. The whites and the near-black that only act as mixers
 * inside color-mix() are neutrals and stay literal.
 * ========================================================================== */

.auth-shell {
  display: grid;
  /* ~55% brand panel / 45% form panel. */
  grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* Set by the templates when the authenticated app header is rendered above
 * the auth layout: fill the remaining viewport instead of fighting it. */
.auth-shell--inset {
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
}

/* Left brand panel and the single-card variant share the same layered
 * gradient: deep primary at the top, drifting into a primary/accent mix,
 * with two soft accent glows. Deliberately deep and calm, not garish. */
.auth-brand,
.auth-shell--single {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(
      110% 85% at 88% -8%,
      color-mix(in srgb, var(--brand-accent) 40%, transparent) 0%,
      transparent 58%
    ),
    radial-gradient(
      90% 70% at -10% 105%,
      color-mix(in srgb, var(--brand-accent) 24%, transparent) 0%,
      transparent 52%
    ),
    linear-gradient(
      158deg,
      color-mix(in srgb, var(--brand-primary) 72%, #0a0e14) 0%,
      color-mix(in srgb, var(--brand-primary) 94%, #0a0e14) 48%,
      color-mix(in srgb, var(--brand-primary) 60%, var(--brand-accent)) 100%
    );
}

.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 6vw, 88px);
  /* Light text belongs to the gradient panel ONLY. Never on the shared
   * shell: .auth-shell--single contains a white .card whose headings and
   * labels inherit color, and near-white on white is invisible. */
  color: color-mix(in srgb, var(--brand-on-primary) 92%, var(--brand-primary));
}

/* Topographic contour pattern (inline SVG). Strokes inherit this colour:
 * brand accent lifted towards white, mostly transparent — map-like, subtle. */
.auth-contours {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  color: color-mix(
    in srgb,
    color-mix(in srgb, var(--brand-accent) 45%, #ffffff) 24%,
    transparent
  );
}

.auth-contours use {
  vector-effect: non-scaling-stroke;
}

.auth-brand__content {
  position: relative;
  z-index: 1;
  max-width: 52ch;
  display: grid;
  gap: calc(var(--step) * 8);
}

.auth-brand__id {
  display: flex;
  align-items: center;
  gap: calc(var(--step) * 2.5);
  font-weight: 600;
  font-size: 15px;
  color: var(--brand-on-primary);
}

.auth-brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, #ffffff 35%, transparent);
  background: color-mix(in srgb, #ffffff 14%, transparent);
  color: var(--brand-on-primary);
  font-size: 16px;
  font-weight: 700;
}

.auth-brand__logo {
  max-height: 34px;
  max-width: 180px;
  object-fit: contain;
}

/* Square product mark (transparent PNG, safe on the dark gradient). */
.auth-brand__mark-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.auth-brand__title {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--brand-on-primary);
  text-wrap: balance;
}

.auth-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: calc(var(--step) * 4);
}

.auth-features li {
  display: flex;
  align-items: flex-start;
  gap: calc(var(--step) * 3);
  font-size: 14px;
  line-height: 1.5;
  color: color-mix(in srgb, var(--brand-on-primary) 80%, var(--brand-primary));
}

.auth-features b {
  color: var(--brand-on-primary);
  font-weight: 600;
}

.auth-features__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, #ffffff 28%, transparent);
  background: color-mix(in srgb, #ffffff 10%, transparent);
  color: color-mix(in srgb, var(--brand-accent) 40%, #ffffff);
}

/* Right panel: the form, vertically centered on the canvas. */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 56px);
  background: var(--canvas);
}

.auth-card {
  width: min(410px, 100%);
}

.auth-card .card__body {
  padding: calc(var(--step) * 7) calc(var(--step) * 7) calc(var(--step) * 6);
}

.auth-card__title {
  margin: 0;
  font-size: 20px;
}

.auth-card__sub {
  margin: var(--step) 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}

/* Sits inside a .stack; same specificity, later in the sheet, so the tighter
 * margin wins over the generic stack rhythm. */
.auth-forgot {
  display: flex;
  justify-content: flex-end;
  margin-top: calc(var(--step) * 1.5);
  font-size: 13px;
}

.auth-submit {
  width: 100%;
}

.auth-support {
  margin: 0;
  padding-top: calc(var(--step) * 3);
  border-top: 1px solid var(--border);
}

/* Floating theme toggle: reuses .theme-toggle, only positions it. */
.auth-theme-toggle {
  position: fixed;
  top: calc(var(--step) * 4);
  right: calc(var(--step) * 4);
  z-index: 60;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* Single-card variant: wachtwoordherstel pages — card centered on the brand
 * gradient, same contour pattern, so the flow stays visually one piece. */
.auth-shell--single {
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
}

.auth-single {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  padding: clamp(24px, 5vw, 48px) calc(var(--step) * 5);
  display: grid;
  gap: calc(var(--step) * 5);
  justify-items: center;
}

.auth-single__brand {
  display: flex;
  align-items: center;
  gap: calc(var(--step) * 2.5);
  font-weight: 600;
  font-size: 15px;
  color: var(--brand-on-primary);
}

.auth-single .auth-card {
  width: 100%;
}

/* Mobile: stack vertically; the brand panel collapses to a compact band. */
@media (max-width: 800px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-brand {
    justify-content: flex-start;
    padding: calc(var(--step) * 5) calc(var(--step) * 5) calc(var(--step) * 6);
  }

  .auth-brand__content {
    gap: calc(var(--step) * 3.5);
  }

  .auth-brand__title {
    font-size: 17px;
  }

  .auth-features {
    display: none;
  }

  .auth-panel {
    align-items: flex-start;
    padding-top: calc(var(--step) * 8);
  }
}
