/* ============================================================================
   Lewis Forecourts — Digital Signage
   Design system: tokens, layout primitives, components.

   Light, editorial and unhurried. The product is photographs of real
   forecourts and real screens; a pale paper ground lets those carry the page
   rather than competing with a dark chrome for attention.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Grounds — warm paper rather than pure white, which reads as unfinished */
  --paper:     #fbfaf8;
  --paper-2:   #f4f2ec;
  --paper-3:   #ece9e1;
  --surface:   #ffffff;

  /* Ink */
  --ink:       #14171b;
  --ink-2:     #39414c;
  --ink-3:     #6a7380;
  --ink-4:     #98a0ab;

  /* Deep petrol green. Forecourt heritage, and distinct from the default
     SaaS blue that makes every site look like the same template. */
  --accent:      #12574e;
  --accent-2:    #1a7a6c;
  --accent-3:    #2b9c8b;
  --accent-soft: rgba(18, 87, 78, .07);
  --accent-line: rgba(18, 87, 78, .18);

  /* Brass, used sparingly — rules, small marks, the occasional underline */
  --brass:      #ab7c38;
  --brass-soft: rgba(171, 124, 56, .1);

  --ok:       #17795a;
  --ok-soft:  rgba(23, 121, 90, .09);
  --warn:     #9a6512;
  --warn-soft:rgba(154, 101, 18, .1);
  --bad:      #a32c25;
  --bad-soft: rgba(163, 44, 37, .08);

  --line:      rgba(20, 23, 27, .11);
  --line-soft: rgba(20, 23, 27, .06);
  --line-hard: rgba(20, 23, 27, .2);

  --radius:    16px;
  --radius-sm: 10px;
  --radius-lg: 26px;

  --shadow-sm: 0 1px 2px rgba(20, 23, 27, .05);
  --shadow:    0 2px 6px rgba(20, 23, 27, .05), 0 12px 28px -12px rgba(20, 23, 27, .14);
  --shadow-lg: 0 4px 12px rgba(20, 23, 27, .06), 0 32px 64px -24px rgba(20, 23, 27, .24);

  /* A serif display face carries the elegance; both stacks are system fonts,
     so there is no webfont request, no CSP exception and no layout shift. */
  --display: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  --sans:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:    ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap:   1340px;
  --wrap-narrow: 760px;
  --gutter: clamp(20px, 4.5vw, 64px);
}

/* --------------------------------------------------------------- reset ---- */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* No overflow-x:hidden here — it hides layout bugs instead of fixing them,
     and breaks position:sticky in several browsers. */
}

img, svg, video { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

h1, h2, h3, h4 { color: var(--ink); margin: 0 0 .5em; font-weight: 500; }
h1, h2 { font-family: var(--display); letter-spacing: -.018em; line-height: 1.08; }
h1 { font-size: clamp(2.5rem, 5.4vw, 4.3rem); }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.85rem); }
h3 { font-family: var(--sans); font-size: 1.06rem; font-weight: 600; line-height: 1.35; letter-spacing: -.005em; }

/* A section heading that has to be an <h2> for the outline but should read as
   an <h3>. The client's account and cancellation pages already asked for this
   class; nothing defined it, so those headings came out in the display face at
   up to 2.85rem — the same size as the page title above them. */
.h3 {
  font-family: var(--sans);
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.005em;
}
h4 { font-family: var(--sans); font-size: .95rem; font-weight: 600; }
p  { margin: 0 0 1.15em; }

:focus-visible {
  outline: 2.5px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 300;
  background: var(--accent); color: #fff;
  padding: 13px 22px; font-weight: 600; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; color: #fff; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: var(--wrap-narrow); }

.section { padding-block: clamp(64px, 8vw, 132px); position: relative; }
.section--tight { padding-block: clamp(44px, 5.5vw, 76px); }
.section--paper2 { background: var(--paper-2); }
.section--ink {
  background: var(--ink);
  color: rgba(255, 255, 255, .72);
}
.section--ink h2, .section--ink h3 { color: #fff; }
.section--ink .eyebrow { color: var(--accent-3); }

/* A rule that reaches the full viewport width regardless of the wrap. */
.section + .section { border-top: 1px solid var(--line-soft); }
.section--ink + .section, .section--ink { border-top-color: transparent; }

.eyebrow {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.eyebrow--brass { color: var(--brass); }

.lede {
  font-size: clamp(1.06rem, 1.35vw, 1.19rem);
  line-height: 1.62;
  color: var(--ink-2);
  max-width: 60ch;
}

.muted { color: var(--ink-3); }
.small { font-size: .9rem; }
.tiny  { font-size: .81rem; }

/* Section heading + supporting copy, side by side on wide screens. */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(14px, 2vw, 30px);
  margin-bottom: clamp(36px, 5vw, 64px);
  max-width: 1000px;
}
@media (min-width: 900px) {
  .section-head--split {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: end;
    max-width: none;
  }
  .section-head--split > :first-child { margin-bottom: 0; }
}
.section-head h2 { margin-bottom: 0; }

/* --------------------------------------------------------------- header --- */

.site-header {
  position: sticky; top: 0; z-index: 90;
  background: rgba(251, 250, 248, .84);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  background: rgba(251, 250, 248, .95);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; min-height: 76px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: linear-gradient(152deg, var(--accent-2), var(--accent));
  display: grid; place-items: center;
  color: #fff; font-family: var(--display); font-size: 19px; font-weight: 600;
  box-shadow: 0 3px 10px rgba(18, 87, 78, .28);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-family: var(--display); font-size: 1.12rem; font-weight: 600; letter-spacing: -.01em; }
.brand__sub {
  font-size: .63rem; font-weight: 600; color: var(--ink-3);
  letter-spacing: .18em; text-transform: uppercase;
}

.site-nav { display: flex; align-items: center; gap: 4px; }
.navlink {
  color: var(--ink-2); font-size: .94rem; font-weight: 500;
  padding: 9px 15px; border-radius: 9px;
  transition: color .18s ease, background .18s ease;
}
.navlink:hover { color: var(--ink); background: rgba(20, 23, 27, .05); }
.navlink[aria-current="page"] { color: var(--accent); }

/* Mobile navigation.
   The old build simply hid the links below 720px, so half the site became
   unreachable on a phone — which is where most of this traffic arrives. */
.nav-toggle {
  display: none;
  width: 46px; height: 46px;
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line);
  border-radius: 11px; cursor: pointer; color: var(--ink);
  flex: none;
}
.nav-toggle:hover { background: rgba(20, 23, 27, .04); }
.nav-toggle__bars { display: block; width: 19px; height: 13px; position: relative; }
.nav-toggle__bars i {
  position: absolute; left: 0; right: 0; height: 1.8px;
  background: currentColor; border-radius: 2px;
  transition: transform .28s cubic-bezier(.2,.8,.3,1), opacity .2s ease;
}
.nav-toggle__bars i:nth-child(1) { top: 0; }
.nav-toggle__bars i:nth-child(2) { top: 5.6px; }
.nav-toggle__bars i:nth-child(3) { top: 11.2px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(1) { transform: translateY(5.6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:nth-child(3) { transform: translateY(-5.6px) rotate(-45deg); }

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: fixed;
    inset: 76px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 18px var(--gutter) 26px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    /* Collapsed by default; [hidden] is toggled by JS so it also works with
       the keyboard and is announced correctly. */
    transform-origin: top center;
    animation: nav-drop .26s cubic-bezier(.2,.85,.3,1);
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
  }
  @keyframes nav-drop {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .site-nav[hidden] { display: none; }
  .navlink {
    padding: 15px 14px;
    font-size: 1.03rem;
    border-radius: 10px;
    border-bottom: 1px solid var(--line-soft);
  }
  .navlink:last-of-type { border-bottom: 0; }
  .site-nav .btn { margin-top: 14px; width: 100%; }
}
@media (min-width: 881px) {
  /* The panel is only hidden on small screens; never carry [hidden] up. */
  .site-nav[hidden] { display: flex !important; }
}

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px;
  border-radius: 11px;
  border: 1px solid transparent;
  font: inherit; font-size: .97rem; font-weight: 600; letter-spacing: -.005em;
  cursor: pointer; text-align: center; white-space: nowrap;
  transition: transform .16s cubic-bezier(.2,.8,.3,1), box-shadow .22s ease,
              background .2s ease, border-color .2s ease, color .2s ease;
}
/* On a phone, a button whose label is a sentence — "Confirm the ticked
   adverts are on the screens" — is wider than the screen, and nowrap makes it
   push the page sideways rather than take a second line. */
@media (max-width: 560px) {
  .btn { white-space: normal; }
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }

.btn--primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 2px 6px rgba(18,87,78,.2), 0 10px 22px -10px rgba(18,87,78,.5);
}
.btn--primary:hover {
  background: var(--accent-2); color: #fff;
  box-shadow: 0 3px 10px rgba(18,87,78,.24), 0 16px 32px -12px rgba(18,87,78,.55);
}

.btn--ghost { background: var(--surface); border-color: var(--line-hard); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { border-color: var(--ink-4); color: var(--ink); background: var(--surface); }

.btn--quiet { background: transparent; color: var(--ink-2); padding-inline: 14px; }
.btn--quiet:hover { color: var(--ink); background: rgba(20,23,27,.05); }

.btn--onink { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.26); color: #fff; }
.btn--onink:hover { background: rgba(255,255,255,.18); color: #fff; }

.btn--danger { background: var(--bad); color: #fff; }
.btn--danger:hover { color: #fff; filter: brightness(1.06); }

.btn--sm { padding: 10px 17px; font-size: .89rem; border-radius: 9px; }
.btn--lg { padding: 17px 34px; font-size: 1.03rem; border-radius: 12px; }
.btn--block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* Text link with an animated underline — used for tertiary actions. */
.link-arrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 600; font-size: .95rem; color: var(--accent);
}
.link-arrow svg { transition: transform .22s cubic-bezier(.2,.8,.3,1); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------------------------------------------------------------- cards --- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 2.6vw, 34px);
  box-shadow: var(--shadow-sm);
}
.card--flush { padding: 0; overflow: hidden; }
.card--raised { box-shadow: var(--shadow); }
.card__title { font-size: 1.05rem; font-weight: 600; color: var(--ink); margin: 0 0 5px; }
.card__head {
  padding: 20px clamp(20px, 2.6vw, 30px);
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.card__body { padding: clamp(20px, 2.6vw, 30px); }

.grid { display: grid; gap: clamp(16px, 1.8vw, 26px); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }

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

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  font-size: .755rem; font-weight: 600; letter-spacing: .01em;
  border: 1px solid transparent; white-space: nowrap;
}
.badge--ok   { background: var(--ok-soft);   color: var(--ok);    border-color: rgba(23,121,90,.24); }
.badge--warn { background: var(--warn-soft); color: var(--warn);  border-color: rgba(154,101,18,.24); }
.badge--bad  { background: var(--bad-soft);  color: var(--bad);   border-color: rgba(163,44,37,.22); }
.badge--info { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.badge--mute { background: var(--paper-2); color: var(--ink-3); border-color: var(--line); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.dot--pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

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

.field { margin-bottom: 22px; }
.field__label { display: block; margin-bottom: 8px; font-size: .93rem; font-weight: 600; color: var(--ink); }
.field__hint { font-size: .85rem; color: var(--ink-3); margin: 7px 0 0; }
.field__req { color: var(--accent); margin-left: 2px; }

.input, .select, .textarea {
  width: 100%;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line-hard);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit; font-size: 1rem;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent-2);
  box-shadow: 0 0 0 3.5px var(--accent-soft);
}
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--bad); }
.textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236a7380' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; padding-right: 40px;
}

.field__error {
  display: flex; align-items: flex-start; gap: 7px;
  margin: 8px 0 0; font-size: .87rem; color: var(--bad); font-weight: 500;
}

.choice {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 15px 17px;
  background: var(--surface);
  border: 1px solid var(--line-hard);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.choice:hover { border-color: var(--ink-4); }
.choice:has(input:checked) { border-color: var(--accent-2); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent-2) inset; }
.choice:has(input:focus-visible) { box-shadow: 0 0 0 3.5px var(--accent-soft); }
.choice input { margin: 2px 0 0; width: 19px; height: 19px; accent-color: var(--accent); flex: none; cursor: pointer; }
.choice__label { font-weight: 600; color: var(--ink); font-size: .97rem; display: block; }
.choice__desc { font-size: .86rem; color: var(--ink-3); margin-top: 3px; line-height: 1.5; }

.choice-stack { display: grid; gap: 11px; }

fieldset { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
legend { padding: 0; margin-bottom: 10px; font-size: .93rem; font-weight: 600; color: var(--ink); }

/* --------------------------------------------------------------- alerts --- */

.alert {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 15px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid; border-left-width: 3px;
  margin-bottom: 24px; font-size: .95rem; line-height: 1.6;
}
.alert--ok    { background: var(--ok-soft);   border-color: rgba(23,121,90,.3);   color: #0f5a42; }
.alert--error { background: var(--bad-soft);  border-color: rgba(163,44,37,.3);   color: #8c241e; }
.alert--warn  { background: var(--warn-soft); border-color: rgba(154,101,18,.3);  color: #7a5010; }
.alert--info  { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.alert a { color: inherit; text-decoration: underline; }

/* --------------------------------------------------------------- footer --- */

.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,.6);
  padding-block: clamp(48px, 6vw, 78px) 30px;
  font-size: .92rem;
}
.site-footer__grid {
  display: grid;
  /* min(100%, …) so a column can never be wider than the screen — the old
     fixed minmax overflowed the viewport at 390px. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: clamp(30px, 4vw, 56px);
  margin-bottom: 42px;
}
@media (min-width: 860px) {
  .site-footer__grid { grid-template-columns: 1.7fr repeat(3, minmax(0, 1fr)); }
}
.site-footer .brand { color: #fff; margin-bottom: 16px; }
.site-footer .brand:hover { color: #fff; }
.site-footer .brand__sub { color: rgba(255,255,255,.45); }
.site-footer h4 {
  font-size: .73rem; text-transform: uppercase; letter-spacing: .17em;
  color: rgba(255,255,255,.42); margin-bottom: 16px; font-weight: 700;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.site-footer a { color: rgba(255,255,255,.72); }
.site-footer a:hover { color: #fff; }
.site-footer__bar {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 26px;
  display: flex; flex-wrap: wrap; gap: 12px 28px;
  justify-content: space-between; align-items: center;
  color: rgba(255,255,255,.4); font-size: .85rem;
}

/* ------------------------------------------------------- cookie banner ---- */

.cookie-banner {
  position: fixed; z-index: 200;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  max-width: 660px; margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px 26px;
  transform: translateY(140%);
  transition: transform .5s cubic-bezier(.16,1,.3,1);
  max-height: calc(100dvh - 32px); overflow-y: auto;
}
.cookie-banner.is-visible { transform: translateY(0); }
.cookie-banner h2 { font-family: var(--sans); font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; letter-spacing: 0; }
.cookie-banner p { font-size: .92rem; margin-bottom: 17px; color: var(--ink-2); }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: 10px; }
/*
 * display:grid here used to beat the browser's own [hidden] rule, so the
 * detail panel was laid out even while marked hidden. On a phone that made
 * the banner 764px tall — 91% of the screen — a consent wall nobody designed,
 * sitting over whatever was at the bottom of the page. The global [hidden]
 * rule below is the real fix; this stays explicit as documentation of what
 * went wrong.
 */
.cookie-banner__detail { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-soft); display: grid; gap: 12px; }
.cookie-banner__detail[hidden] { display: none; }

/* A banner is a message, not a wall. On a small screen it should still leave
   most of the page visible behind it. */
@media (max-width: 520px) {
  .cookie-banner { padding: 18px 18px 20px; }
  .cookie-banner h2 { font-size: .98rem; margin-bottom: 6px; }
  .cookie-banner p { font-size: .86rem; margin-bottom: 14px; }
  .cookie-banner__actions { gap: 8px; }
}

/*
 * hidden means hidden.
 *
 * Any rule that sets a display value beats the browser's own
 * `[hidden] { display: none }`, which is a specificity accident waiting to
 * happen every time a component is styled and also toggled from JavaScript.
 * One !important here is worth more than remembering it component by
 * component — and the failure mode is invisible in review, because the markup
 * says hidden and the page says otherwise.
 */
[hidden] { display: none !important; }

/* --------------------------------------------------------------- tables --- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.table th {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-3); font-weight: 700; white-space: nowrap; background: var(--paper-2);
}
.table tbody tr:hover { background: var(--paper); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ utilities --- */

.stack    { display: grid; gap: 20px; }
.stack-sm { display: grid; gap: 11px; }
.row      { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.center   { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 11px; } .mt-2 { margin-top: 22px; } .mt-3 { margin-top: 36px; }
.mb-1 { margin-bottom: 11px; } .mb-2 { margin-bottom: 22px; } .mb-3 { margin-bottom: 36px; }
.hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .88em; }

/* --------------------------------------------------------- legal pages ---- */

.legal { background: var(--paper); }
.legal h2 {
  font-size: clamp(1.3rem, 2.1vw, 1.6rem);
  margin-top: 2.3em; padding-top: 1.15em;
  border-top: 1px solid var(--line-soft);
}
.legal h2:first-of-type { border-top: 0; padding-top: 0; }
.legal h3 { font-size: 1.03rem; margin-top: 1.8em; }
.legal ul, .legal ol { padding-left: 24px; margin: 0 0 1.2em; }
.legal li { margin-bottom: .55em; }
.legal .table { margin-bottom: 1.3em; }
.legal strong { color: var(--ink); font-weight: 600; }

/* --------------------------------------------------------- error pages ---- */

.error-page {
  min-height: 64vh; display: grid; place-items: center;
  text-align: center; padding-block: clamp(56px, 9vw, 104px);
}
.error-page__code {
  font-family: var(--display);
  font-size: clamp(4rem, 13vw, 7.5rem);
  font-weight: 500; line-height: 1; letter-spacing: -.04em;
  color: var(--accent); margin-bottom: 14px;
}
.error-page p { max-width: 46ch; margin-inline: auto; }

/* ============================================================== utilities ==
 * These exist because the Content-Security-Policy blocks inline style
 * attributes outright. A CSP nonce authorises <style> ELEMENTS only — it has
 * no effect on a style="" attribute, which needs 'unsafe-inline' (or
 * 'unsafe-hashes' plus a hash per value). Rather than weaken the policy for
 * the sake of a few one-off declarations, every one of them is a class.
 * ========================================================================= */

.u-center-row   { justify-content: center; }
.u-mt-sm        { margin-top: 16px; }
.u-mt-md        { margin-top: 24px; }
.u-pt-md        { padding-top: 24px; }
.u-m0           { margin: 0; }
.u-mb0          { margin-bottom: 0; }
.u-mi-auto      { margin-inline: auto; }
.u-text-left    { text-align: left; }
.u-ink          { color: var(--ink); }
.u-back-link    { display: inline-block; margin-bottom: 22px; }

.u-w-620  { max-width: 620px; }
.u-w-720  { max-width: 720px; }
.u-w-760  { max-width: 760px; }
.u-w-34ch { max-width: 34ch; }
.u-w-70ch { max-width: 70ch; }

/* Page titles a step down from the landing-page h1. */
.u-title-sm { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.u-title-md { font-size: clamp(1.5rem, 3.4vw, 2rem); }
.u-title-lg { font-size: clamp(1.8rem, 4vw, 2.5rem); }

/* Off-screen honeypot. Not .visually-hidden: that is for content a screen
   reader SHOULD announce, and this field is meant to be found by nothing but
   a bot that ignores both. */
.u-offscreen {
  position: absolute !important;
  left: -9999px; top: -9999px;
  width: 1px; height: 1px; overflow: hidden;
}

.u-svg-defs { position: absolute; width: 0; height: 0; }

/* The round status mark on confirmation and thank-you pages. */
.status-mark {
  width: 66px; height: 66px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 24px;
  border: 1px solid;
}
.status-mark--ok   { background: var(--ok-soft);     border-color: rgba(23,121,90,.3);  color: var(--ok); }
.status-mark--warn { background: var(--warn-soft);   border-color: rgba(154,101,18,.3); color: var(--warn); }
.status-mark--info { background: var(--accent-soft); border-color: var(--accent-line);  color: var(--accent); }

/* "Cookie settings" sits in the footer's legal list and has to be a button
   rather than a link, because it opens the consent panel. It is styled to be
   indistinguishable from the links around it. */
.footer-link-button {
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: .92rem;
  line-height: inherit;
  color: rgba(255, 255, 255, .72);
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}
.footer-link-button:hover { color: #fff; }

/* --------------------------------------------------- Anglesey Digital mark --
 * The build credit in the footer. Mark only, no wordmark — it sits beside the
 * Lewis Forecourts brand and must not compete with it.
 * ========================================================================= */

.footer-by {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 0;
  font-size: .78rem;
  color: rgba(255, 255, 255, .38);
}

.ad-mark {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, .55);
  padding: 4px 6px;
  margin: -4px -6px;          /* keeps the hit area large without shifting layout */
  border-radius: 7px;
  transition: color .2s ease, background .2s ease;
}
.ad-mark svg { width: 26px; height: 21px; display: block; }
.ad-mark:hover { color: #fff; background: rgba(255, 255, 255, .07); }

/* ============================================================ auth screens ==
 * Sign-in, second factor and recovery. Narrow, centred, and deliberately
 * free of navigation: the only things on screen are the task and the way
 * back out of it.
 * ========================================================================= */

.auth {
  min-height: calc(100dvh - 76px);
  display: grid;
  place-items: center;
  padding-block: clamp(32px, 6vw, 76px);
  background:
    radial-gradient(900px 480px at 50% -10%, var(--accent-soft) 0%, transparent 62%),
    var(--paper);
}

.auth__panel { width: 100%; max-width: 448px; }

.auth__head { text-align: center; margin-bottom: 28px; }
.auth__head h1 {
  font-size: clamp(1.55rem, 3.4vw, 2.05rem);
  margin-bottom: 8px;
}
.auth__head p { color: var(--ink-3); font-size: .96rem; margin: 0; }

.auth__card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 3.4vw, 36px);
  box-shadow: var(--shadow);
}

.auth__foot {
  margin-top: 24px;
  text-align: center;
  font-size: .9rem;
  color: var(--ink-3);
}
.auth__foot a { font-weight: 600; }

.auth__divider {
  display: flex; align-items: center; gap: 14px;
  margin: 26px 0 22px;
  color: var(--ink-4); font-size: .78rem;
  text-transform: uppercase; letter-spacing: .14em;
}
.auth__divider::before, .auth__divider::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}

/* A prompt back to the enquiry form, for somebody who has arrived at the
   login page without an account. */
.auth__prospect {
  margin-top: 26px;
  padding: 20px 22px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-align: center;
}
.auth__prospect p { font-size: .92rem; color: var(--ink-2); margin-bottom: 14px; }

/* --------------------------------------------------------- the code field --
 * One wide field rather than six boxes. Six boxes look precise and then fight
 * password managers, paste, and screen readers; a single field does none of
 * that and autocompletes from the SMS/authenticator suggestion.
 */
.code-input {
  width: 100%;
  padding: 16px;
  font-family: var(--mono);
  font-size: 1.6rem;
  letter-spacing: .5em;
  text-align: center;
  text-indent: .5em;          /* centres despite the trailing letter-space */
  background: var(--surface);
  border: 1px solid var(--line-hard);
  border-radius: var(--radius-sm);
  color: var(--ink);
}
.code-input:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3.5px var(--accent-soft);
}
.code-input::placeholder { color: var(--ink-4); letter-spacing: .5em; }

.auth__timer {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink-2);
}

/* =========================================================== setup wizard ==
 * The three-step account setup a client completes from their invitation.
 * ========================================================================= */

.wizard { max-width: 620px; margin-inline: auto; }
.wizard--wide { max-width: 760px; }

.wizard__steps {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 30px;
  list-style: none; padding: 0;
}
.wizard__step {
  display: flex; align-items: center; gap: 9px;
  font-size: .82rem; color: var(--ink-4); font-weight: 500;
}
.wizard__step + .wizard__step::before {
  content: ''; width: 20px; height: 1px; background: var(--line-hard); margin-right: 8px;
}
.wizard__step b {
  width: 25px; height: 25px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper-3); color: var(--ink-3);
  font-size: .76rem; font-weight: 700;
}
.wizard__step--now { color: var(--ink); }
.wizard__step--now b { background: var(--accent); color: #fff; }
.wizard__step--done { color: var(--ink-3); }
.wizard__step--done b { background: var(--ok-soft); color: var(--ok); }
@media (max-width: 560px) { .wizard__step span { display: none; } }

/* --------------------------------------------------------- QR enrolment --- */

.enrol {
  display: grid;
  gap: clamp(20px, 3vw, 32px);
  align-items: start;
}
@media (min-width: 640px) { .enrol { grid-template-columns: auto minmax(0, 1fr); } }

.enrol__qr {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  justify-self: center;
}
.enrol__qr img { width: 182px; height: 182px; display: block; }

.enrol__manual {
  margin-top: 14px;
  padding: 13px 15px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.enrol__manual code {
  display: block;
  font-family: var(--mono);
  font-size: .95rem;
  letter-spacing: .06em;
  color: var(--ink);
  word-break: break-all;
  margin-top: 6px;
  user-select: all;         /* one tap selects the whole secret */
}

/* -------------------------------------------------------- recovery codes -- */

.recovery-codes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 20px 0;
  padding: 20px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.recovery-codes code {
  font-family: var(--mono);
  font-size: .95rem;
  letter-spacing: .04em;
  color: var(--ink);
  text-align: center;
  padding: 9px 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  user-select: all;
}

.package-summary {
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 26px;
}
.package-summary h2 {
  font-family: var(--sans); font-size: .95rem; font-weight: 700;
  letter-spacing: 0; color: var(--accent); margin-bottom: 10px;
}
.package-summary__price {
  font-family: var(--display); font-size: 1.5rem; color: var(--ink);
  margin-bottom: 8px;
}
.package-summary ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .89rem; }
.package-summary li { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }

/* ----------------------------------------------------------- busy button ---

   A tap with no visible response is a tap somebody repeats. The spinner is a
   circle with one transparent edge, rotating — no image, no library, and it
   inherits the button's own text colour so it works on every variant.        */

.spinner {
  display: inline-block;
  width: .8em; height: .8em;
  margin-right: .5em;
  vertical-align: -.08em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

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

/* Busy, but still readable: a disabled button that fades to nothing is a
   button nobody can tell they pressed. */
.is-busy { opacity: .85; cursor: progress; }
.btn.is-busy { pointer-events: none; }

/* Somebody who has asked for less movement gets a mark that does not spin.
   The feedback still has to exist — it just holds still. */
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-right-color: currentColor; opacity: .45; }
}
