/* ==========================================================================
   CelcomDigi · Customer Registration
   Design system — "Calm Nordic Glass"
   Light, warm, Scandinavian. Glassmorphism used structurally, not decoratively.

   COLOUR STRATEGY — 60 / 30 / 10
   60%  Canvas    warm paper neutrals (#FBF9F6 → #F1ECE5) + translucent white glass
   30%  Structure ink & graphite typography, hairline rules, quiet chrome (#132433 → #6B7885)
   10%  Accent    CelcomDigi Blue (#0080DD, from the logo gradient)
                  · of which ~2% is CelcomDigi Yellow (#FFD400) used only as a spark
   ========================================================================== */

/* ---------- 1. TOKENS ---------------------------------------------------- */
:root {
  /* -- 60% · Canvas ------------------------------------------------------ */
  --paper:        #FBF9F6;   /* page ground — warm, oat-white           */
  --paper-2:      #F5F1EB;   /* recessed / banded areas                 */
  --paper-3:      #EDE7DE;   /* deepest warm neutral                    */
  --white:        #FFFFFF;

  /* Glass surfaces */
  --glass:        rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .74);
  --glass-quiet:  rgba(255, 255, 255, .38);
  --glass-edge:   rgba(255, 255, 255, .78);
  --blur:         saturate(178%) blur(22px);
  --blur-sm:      saturate(150%) blur(14px);

  /* -- 30% · Structure --------------------------------------------------- */
  --ink:          #132433;   /* headings, primary text                  */
  --ink-2:        #3A4A59;   /* body text                               */
  --muted:        #64717F;   /* helper text — 5.4:1 on paper            */
  --faint:        #8B95A1;   /* placeholders, disabled                  */
  --line:         rgba(19, 36, 51, .10);
  --line-2:       rgba(19, 36, 51, .16);

  /* -- 10% · Accent ------------------------------------------------------ */
  --blue:         #0080DD;   /* CelcomDigi blue — mid stop of logo ramp */
  --blue-deep:    #0064DC;
  --blue-bright:  #009BDF;
  --blue-ink:     #005AA8;   /* accessible blue text on light           */
  --blue-wash:    #EAF4FD;
  --blue-wash-2:  #DCEDFB;
  --blue-ring:    rgba(0, 128, 221, .22);
  --blue-grad:    linear-gradient(135deg, #009BDF 0%, #0080DD 45%, #0064DC 100%);

  --yellow:       #FFD400;   /* the 2% spark                            */
  --yellow-soft:  #FFF4CC;
  --yellow-ink:   #8A6A00;

  /* Functional — used sparingly, never decoratively */
  --ok:           #0F7A5A;
  --ok-wash:      #E6F5EF;
  --warn-ink:     #8A5A00;
  --warn-wash:    #FFF3E0;
  --err:          #C0392F;
  --err-ink:      #A32B22;
  --err-wash:     #FDEDEB;

  /* -- Type -------------------------------------------------------------- */
  /* Familjen Grotesk is a Swedish grotesque — the Nordic voice of the headings.
     Manrope carries the interface: warm, geometric, and legible at 13–16px. */
  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Familjen Grotesk", "Manrope", ui-sans-serif, system-ui, sans-serif;

  --t-eyebrow: .6875rem;  /* 11 */
  --t-micro:   .75rem;    /* 12 */
  --t-small:   .8125rem;  /* 13 */
  --t-body:    .9375rem;  /* 15 */
  --t-input:   1rem;      /* 16 — prevents iOS zoom-on-focus */
  --t-lead:    1.0625rem; /* 17 */

  /* -- Space (4pt) — Scandinavian generosity ----------------------------- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px; --s10: 72px;

  /* -- Radius ------------------------------------------------------------ */
  --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-xl: 24px; --r-pill: 999px;

  /* -- Elevation — soft, warm-tinted, never harsh ------------------------ */
  --e1: 0 1px 2px rgba(19,36,51,.04), 0 1px 3px rgba(19,36,51,.03);
  --e2: inset 0 1px 0 rgba(255,255,255,.85), 0 1px 2px rgba(19,36,51,.04), 0 10px 26px -14px rgba(19,36,51,.20);
  --e3: inset 0 1px 0 rgba(255,255,255,.9),  0 1px 3px rgba(19,36,51,.05), 0 22px 50px -22px rgba(19,36,51,.26);
  --e-blue: 0 8px 22px -10px rgba(0,100,220,.45);

  --shell: 1120px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- 2. RESET ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  /* Keep anchored/focused elements clear of the sticky header and action bar. */
  scroll-padding-top: 150px;
  scroll-padding-bottom: 120px;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); margin: 0; font-weight: 600; letter-spacing: -.022em; }
p { margin: 0; }
ul, ol { margin: 0; }

/* Ambient light — the layer the glass refracts. Fixed, calm, very low opacity. */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(36rem 28rem at 10% -4%,  rgba(0,155,223,.30), transparent 62%),
    radial-gradient(30rem 24rem at 92% 2%,   rgba(255,212,0,.26),  transparent 60%),
    radial-gradient(46rem 34rem at 82% 88%,  rgba(0,100,220,.20),  transparent 64%),
    radial-gradient(34rem 26rem at 2% 74%,   rgba(255,212,0,.16),  transparent 62%),
    radial-gradient(28rem 22rem at 46% 44%,  rgba(0,155,223,.10),  transparent 66%);
}

/* Universal focus treatment */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ---------- 3. HEADER ---------------------------------------------------- */
.brandbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4);
  padding: var(--s4) max(var(--s6), calc((100vw - var(--shell)) / 2));
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.brand-logo { height: 30px; width: auto; flex: none; display: block; }
.brand-divider { width: 1px; height: 28px; background: var(--line-2); flex: none; }
.brand-text { min-width: 0; }
.brand-text b {
  display: block; font-family: var(--font-display); font-size: var(--t-body);
  font-weight: 600; color: var(--ink); letter-spacing: -.01em; line-height: 1.25;
}
.brand-text small {
  display: block; font-size: var(--t-micro); color: var(--muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-side { display: flex; align-items: center; gap: var(--s3); flex: none; }
.secure-badge {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-size: var(--t-micro); font-weight: 500; color: var(--ink-2);
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 7px 13px 7px 10px;
}
.secure-badge svg { width: 14px; height: 14px; color: var(--ok); flex: none; }

/* Autosave pill — quiet, appears only when it has something to say */
.autosave {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--t-micro); color: var(--muted);
  background: var(--glass-quiet); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 7px 13px;
  opacity: 0; transform: translateY(-2px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.autosave.show { opacity: 1; transform: none; }
.autosave i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ok);
  flex: none; display: block;
}

/* ---------- 4. LAYOUT ---------------------------------------------------- */
main { flex: 1; width: min(var(--shell), calc(100% - var(--s8))); margin-inline: auto; }
.landing-main { padding: var(--s10) 0 var(--s9); }
.form-page   { padding: var(--s7) 0 var(--s10); max-width: 1040px; }
.field, .upload, .sig-panel, .form-section, .check { scroll-margin-bottom: 110px; scroll-margin-top: 150px; }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: var(--s8);
  padding: var(--s6) 0;
}
.site-footer > div {
  width: min(var(--shell), calc(100% - var(--s8)));
  margin-inline: auto;
  display: flex; flex-wrap: wrap; gap: var(--s4);
  align-items: center; justify-content: space-between;
  font-size: var(--t-micro); color: var(--muted);
}
.site-footer nav { display: flex; gap: var(--s5); }
.site-footer a:hover { color: var(--blue-ink); }

/* ---------- 5. LANDING --------------------------------------------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-size: var(--t-eyebrow); font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--blue-ink);
}
.eyebrow::before {
  content: ""; width: 18px; height: 2px; border-radius: 2px;
  background: var(--yellow); display: block;
}
.eyebrow.centered { justify-content: center; }

.hero { text-align: center; max-width: 740px; margin-inline: auto; }
.hero h1 {
  font-size: clamp(2rem, 4.4vw, 2.85rem);
  line-height: 1.12; letter-spacing: -.032em;
  margin: var(--s4) 0 var(--s4);
}
.hero p { font-size: var(--t-lead); color: var(--muted); line-height: 1.65; }

.type-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--s5); margin-top: var(--s9);
}
.type-card {
  position: relative; display: flex; flex-direction: column;
  padding: var(--s7);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-xl);
  box-shadow: var(--e2);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
  overflow: hidden;
}
.type-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none; z-index: 0;
  background: linear-gradient(160deg, rgba(255,255,255,.28), transparent 42%);
}
.type-card > * { position: relative; z-index: 1; }
.type-card:hover, .type-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--e3);
  border-color: rgba(0,128,221,.32);
}
.type-card .card-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4); margin-bottom: var(--s5);
}
.type-icon {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: var(--blue-wash); color: var(--blue-deep);
  border: 1px solid rgba(0,128,221,.16);
}
.type-icon svg { width: 22px; height: 22px; }
.type-card.corporate .type-icon {
  background: var(--yellow-soft); color: var(--yellow-ink);
  border-color: rgba(255,212,0,.42);
}
.tag {
  font-size: var(--t-eyebrow); font-weight: 600; letter-spacing: .05em;
  color: var(--muted); background: var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 5px 11px;
}
.type-card h2 { font-size: 1.375rem; letter-spacing: -.024em; }
.type-card > p {
  font-size: var(--t-body); font-weight: 500; color: var(--ink-2);
  margin-top: var(--s2); line-height: 1.55;
}
.type-card ul { list-style: none; padding: 0; margin: var(--s5) 0 var(--s6); display: grid; gap: 10px; }
.type-card li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: var(--t-body); font-weight: 500; color: var(--ink);
}
.type-card li svg { width: 15px; height: 15px; color: var(--blue); flex: none; margin-top: 2px; }
/* The card's call to action is a real button, not a text link dressed as one. */
.card-cta {
  margin-top: auto; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: var(--r-pill);
  background: var(--blue-grad); color: #fff;
  font-size: var(--t-small); font-weight: 700; letter-spacing: -.005em;
  box-shadow: var(--e-blue);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), filter .3s var(--ease);
}
.card-cta svg { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.type-card:hover .card-cta,
.type-card:focus-visible .card-cta {
  box-shadow: 0 12px 30px -10px rgba(0,100,220,.62);
  filter: saturate(112%);
}
.type-card:hover .card-cta svg { transform: translateX(4px); }
.type-card:active .card-cta { transform: translateY(1px); }

.meta-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--s4); margin-top: var(--s7);
}
.meta {
  display: flex; gap: var(--s3); align-items: flex-start;
  background: var(--glass-quiet);
  -webkit-backdrop-filter: var(--blur-sm);
  backdrop-filter: var(--blur-sm);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s4) var(--s5);
}
.meta svg { width: 17px; height: 17px; color: var(--blue); flex: none; margin-top: 2px; }
.meta b { display: block; font-size: var(--t-small); color: var(--ink); font-weight: 600; }
.meta span { display: block; font-size: var(--t-micro); color: var(--muted); margin-top: 2px; line-height: 1.5; }

/* ---------- 6. FORM INTRO + STEPPER -------------------------------------- */
.form-intro { max-width: 620px; margin-bottom: var(--s7); }
.form-intro h1 {
  font-size: clamp(1.65rem, 3.4vw, 2.15rem);
  line-height: 1.18; letter-spacing: -.028em; margin: var(--s3) 0 var(--s3);
}
.form-intro p { font-size: var(--t-body); color: var(--muted); line-height: 1.65; }
.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--t-small); color: var(--muted); margin-bottom: var(--s5);
}
.back-link svg { width: 15px; height: 15px; }
.back-link:hover { color: var(--blue-ink); }

.stepper-shell {
  position: sticky; top: 71px; z-index: 30;
  margin-bottom: var(--s6);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-lg);
  box-shadow: var(--e2);
  padding: var(--s4) var(--s5) var(--s3);
}
.stepper-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s4); margin-bottom: var(--s3);
}
.stepper-head b { font-size: var(--t-small); color: var(--ink); font-weight: 600; }
.stepper-head span { font-size: var(--t-micro); color: var(--muted); }
.bar { height: 5px; border-radius: var(--r-pill); background: var(--paper-3); overflow: hidden; }
.bar > i {
  display: block; height: 100%; width: 0%;
  background: var(--blue-grad);
  border-radius: inherit;
  transition: width .5s var(--ease);
}
.stepper { display: flex; list-style: none; padding: 0; margin: var(--s3) 0 0; gap: var(--s1); }
.stepper li { flex: 1; min-width: 0; }
.stepper button {
  width: 100%; display: flex; align-items: center; gap: 9px;
  background: none; border: 0; border-radius: var(--r-sm);
  padding: 7px 8px; cursor: pointer; text-align: left;
  transition: background .2s var(--ease);
}
.stepper button:disabled { cursor: default; }
.stepper button:not(:disabled):hover { background: rgba(19,36,51,.045); }
.step-dot {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: var(--t-micro); font-weight: 600;
  background: var(--white); color: var(--faint);
  border: 1.5px solid var(--line-2);
  transition: all .3s var(--ease);
}
.step-dot svg { width: 12px; height: 12px; }
.step-label {
  font-size: var(--t-micro); color: var(--muted); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stepper li.done .step-dot { background: var(--blue); border-color: var(--blue); color: #fff; }
.stepper li.done .step-label { color: var(--ink-2); }
.stepper li.active .step-dot {
  background: var(--blue-grad); border-color: transparent; color: #fff;
  box-shadow: 0 0 0 4px var(--blue-ring);
}
.stepper li.active .step-label { color: var(--ink); font-weight: 600; }

/* ---------- 7. FORM SECTIONS --------------------------------------------- */
.form-section {
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-xl);
  box-shadow: var(--e2);
  padding: var(--s7);
  border-inline: 1px solid var(--glass-edge);
  animation: rise .4s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.form-section > legend { display: contents; }
.form-section { padding: var(--s7) var(--s8) var(--s8); }

.section-head {
  display: flex; gap: var(--s4); align-items: flex-start;
  padding-bottom: var(--s5); margin-bottom: var(--s6);
  border-bottom: 1px solid var(--line);
}
.section-badge {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600; font-size: var(--t-body);
  background: var(--blue-wash); color: var(--blue-deep);
  border: 1px solid rgba(0,128,221,.16);
}
.section-badge svg { width: 19px; height: 19px; }
.section-head h2 { font-size: 1.1875rem; letter-spacing: -.022em; }
.section-head p { font-size: var(--t-small); color: var(--muted); margin-top: 3px; line-height: 1.55; }

/* ---------- 7b. GROUPS --------------------------------------------------- *
 * Each group states what it is asking for on the left and asks for it on the
 * right, so the form reads as a short list of topics rather than a wall of
 * identical boxes.                                                           */
.group {
  display: grid;
  grid-template-columns: minmax(160px, 200px) minmax(0, 1fr);
  gap: 0 var(--s8);
  padding: var(--s7) 0;
  border-top: 1px solid var(--line);
}
.section-head + .group { padding-top: var(--s6); border-top: 0; }
.group:last-child { padding-bottom: 0; }
.group-aside { position: sticky; top: 168px; align-self: start; }
.group-aside h3 {
  font-family: var(--font-display); font-size: var(--t-lead);
  font-weight: 600; letter-spacing: -.02em; color: var(--ink);
  text-transform: none;
}
.group-aside p {
  font-size: var(--t-micro); color: var(--muted);
  line-height: 1.6; margin-top: 6px;
}

/* ---------- 8. FIELDS ---------------------------------------------------- *
 * A 12-column grid. Every field declares --span, so a postcode is postcode-
 * sized and a street name is street-name-sized.                              */
.group-fields {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s5) var(--s4);
  align-items: start;
}
.group-fields.nested { gap: var(--s5) var(--s4); margin-top: var(--s4); }
.group-fields > * { grid-column: span var(--span, 12); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > .lbl {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  font-size: var(--t-small); font-weight: 600; color: var(--ink);
}
/* Asterisk marks a required field; the legend above each form spells it out. */
.req {
  font-size: 1rem; line-height: 1; font-weight: 700; color: var(--err);
  transform: translateY(2px); display: inline-block;
}
.optional { font-size: var(--t-eyebrow); font-weight: 500; color: var(--faint); }
.req-legend {
  display: flex; align-items: baseline; gap: 7px;
  font-size: var(--t-micro); color: var(--muted);
  margin: 0 0 var(--s5); padding-left: 2px;
}
.hint { font-size: var(--t-micro); color: var(--muted); line-height: 1.5; margin: -1px 0 1px; }

.field input, .field select, .field textarea {
  width: 100%;
  font-size: var(--t-input);
  color: var(--ink);
  background: rgba(255,255,255,.85);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.field textarea { min-height: 84px; resize: vertical; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364717F' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 40px;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(19,36,51,.26); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 4px var(--blue-ring);
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; }

/* Error state */
.field.invalid input, .field.invalid select, .field.invalid textarea {
  border-color: var(--err); background: var(--err-wash);
}
.field.invalid input:focus, .field.invalid select:focus, .field.invalid textarea:focus {
  box-shadow: 0 0 0 4px rgba(192,57,47,.16);
}
.err-msg {
  display: none; align-items: center; gap: 6px;
  font-size: var(--t-micro); font-weight: 500; color: var(--err-ink);
}
.field.invalid .err-msg { display: flex; }
.err-msg svg { width: 13px; height: 13px; flex: none; }

/* Checkbox rows */
.check {
  display: flex; gap: var(--s3); align-items: flex-start;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s4);
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.check:hover { border-color: var(--line-2); }
.check input[type=checkbox] {
  width: 19px; height: 19px; flex: none; margin: 1px 0 0;
  accent-color: var(--blue); cursor: pointer;
}
.check > span { font-size: var(--t-small); color: var(--ink-2); line-height: 1.55; }
.check.consent { background: var(--blue-wash); border-color: rgba(0,128,221,.20); }
.check.invalid { border-color: var(--err); background: var(--err-wash); }

/* Info note */
.note {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--blue-wash); border: 1px solid rgba(0,128,221,.18);
  border-radius: var(--r); padding: var(--s3) var(--s4);
  font-size: var(--t-micro); color: #2C4A63; line-height: 1.55;
}
.note svg { width: 15px; height: 15px; color: var(--blue); flex: none; margin-top: 1px; }
.note.privacy { background: var(--paper-2); border-color: var(--line); color: var(--muted); }
.note.privacy svg { color: var(--muted); }

/* ---------- 9. ERROR SUMMARY --------------------------------------------- */
.err-summary {
  background: var(--err-wash);
  border: 1px solid rgba(192,57,47,.28);
  border-radius: var(--r-lg);
  padding: var(--s5);
  margin-bottom: var(--s5);
  animation: rise .3s var(--ease) both;
}
.err-summary h2 {
  display: flex; align-items: center; gap: 9px;
  font-size: var(--t-body); color: var(--err-ink); margin-bottom: var(--s3);
}
.err-summary h2 svg { width: 17px; height: 17px; flex: none; }
.err-summary ol { margin: 0; padding-left: 18px; display: grid; gap: 5px; }
.err-summary a {
  font-size: var(--t-small); color: var(--err-ink);
  text-decoration: underline; text-underline-offset: 3px;
}
.err-summary a:hover { color: #7E1F18; }

/* ---------- 10. UPLOADS -------------------------------------------------- */
.uploads { display: grid; gap: var(--s4); }
.uploads.two-up { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.upload {
  background: rgba(255,255,255,.6);
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-lg);
  padding: var(--s5);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.upload.dragover { border-color: var(--blue); background: var(--blue-wash); }
.upload.invalid { border-color: var(--err); background: var(--err-wash); }
.upload.filled { border-style: solid; border-color: rgba(15,122,90,.34); background: rgba(230,245,239,.5); }
.upload-head { display: flex; gap: var(--s4); align-items: flex-start; }
.upload-icon {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--blue-wash); color: var(--blue-deep);
  border: 1px solid rgba(0,128,221,.16);
}
.upload.filled .upload-icon { background: var(--ok-wash); color: var(--ok); border-color: rgba(15,122,90,.2); }
.upload-icon svg { width: 18px; height: 18px; }
.upload-copy { flex: 1; min-width: 0; }
.upload-copy b { display: block; font-size: var(--t-small); color: var(--ink); font-weight: 600; line-height: 1.4; }
.upload-copy b .req, .upload-copy b .optional { margin-left: 4px; }
.upload-copy small { display: block; font-size: var(--t-micro); color: var(--muted); margin-top: 3px; line-height: 1.5; }
.upload-btn {
  flex: none; font-size: var(--t-small); font-weight: 600; color: var(--blue-ink);
  background: var(--white); border: 1px solid rgba(0,128,221,.28);
  border-radius: var(--r-sm); padding: 9px 15px; cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.upload-btn:hover { background: var(--blue-wash); border-color: var(--blue); }
.upload input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.file-list { display: grid; gap: var(--s2); margin-top: var(--s4); }
.file-chip {
  display: flex; align-items: center; gap: var(--s3);
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r); padding: 9px 11px;
}
.file-thumb {
  width: 34px; height: 34px; border-radius: var(--r-sm); flex: none;
  object-fit: cover; background: var(--paper-2);
  border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--muted);
}
.file-thumb svg { width: 16px; height: 16px; }
.file-meta { flex: 1; min-width: 0; }
.file-meta b {
  display: block; font-size: var(--t-micro); font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-meta span { font-size: var(--t-eyebrow); color: var(--muted); }
.file-chip.bad { border-color: rgba(192,57,47,.4); background: var(--err-wash); }
.file-chip.bad .file-meta span { color: var(--err-ink); }
.chip-remove {
  flex: none; width: 28px; height: 28px; border-radius: var(--r-sm);
  display: grid; place-items: center; cursor: pointer;
  background: none; border: 1px solid transparent; color: var(--muted);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.chip-remove:hover { background: var(--err-wash); color: var(--err-ink); }
.chip-remove svg { width: 14px; height: 14px; }

/* ---------- 11. DECLARATION + SIGNATURE ---------------------------------- */
.declaration {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: var(--r);
  padding: var(--s5);
  margin-bottom: var(--s6);
}
.declaration b { display: block; font-size: var(--t-small); color: var(--ink); margin-bottom: 7px; }
.declaration p { font-size: var(--t-small); color: var(--ink-2); line-height: 1.7; }

.photo-guide {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.05fr);
  gap: var(--s5); align-items: start;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s5);
  margin-bottom: var(--s6);
}
.photo-guide img {
  width: 100%; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--white);
}
.photo-guide h3 { font-size: var(--t-body); margin: var(--s2) 0 var(--s3); letter-spacing: -.015em; }
.photo-guide ol { padding-left: 18px; display: grid; gap: 6px; }
.photo-guide li { font-size: var(--t-micro); color: var(--ink-2); line-height: 1.55; }
.guide-checks { display: grid; gap: var(--s2); margin-top: var(--s4); }
.guide-checks > div { display: flex; gap: 8px; align-items: flex-start; font-size: var(--t-micro); line-height: 1.5; }
.guide-checks svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.guide-checks .yes svg { color: var(--ok); }
.guide-checks .no svg { color: var(--err); }
.guide-checks span { color: var(--muted); }

.sig-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: var(--s5); align-items: start; }
.sig-side { display: flex; flex-direction: column; gap: var(--s4); }
.sig-panel {
  background: rgba(255,255,255,.6);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s5);
}
.sig-tabs { display: flex; gap: var(--s1); background: var(--paper-2); border-radius: var(--r); padding: 4px; margin-bottom: var(--s4); }
.sig-tabs button {
  flex: 1; border: 0; background: none; cursor: pointer;
  font-size: var(--t-micro); font-weight: 600; color: var(--muted);
  padding: 8px; border-radius: var(--r-sm);
  transition: all .2s var(--ease);
}
.sig-tabs button[aria-selected=true] { background: var(--white); color: var(--ink); box-shadow: var(--e1); }
#signatureCanvas {
  display: block; width: 100%; height: 170px;
  border: 1.5px dashed var(--line-2); border-radius: var(--r);
  background: var(--white); touch-action: none; cursor: crosshair;
}
.sig-panel.invalid #signatureCanvas, .sig-panel.invalid .drop { border-color: var(--err); }
.canvas-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s3); }
.canvas-actions small { font-size: var(--t-micro); color: var(--muted); }
.ghost-btns { display: flex; gap: var(--s2); }
.ghost {
  border: 1px solid var(--line-2); background: var(--white);
  border-radius: var(--r-sm); padding: 6px 12px; cursor: pointer;
  font-size: var(--t-micro); font-weight: 600; color: var(--ink-2);
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.ghost:hover { border-color: var(--blue); color: var(--blue-ink); }
.ghost:disabled { opacity: .45; cursor: not-allowed; }

.drop {
  border: 1.5px dashed var(--line-2); border-radius: var(--r);
  padding: var(--s6) var(--s4); text-align: center;
  background: var(--white); cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.drop:hover, .drop.dragover { border-color: var(--blue); background: var(--blue-wash); }
.drop svg { width: 22px; height: 22px; color: var(--blue); }
.drop b { display: block; font-size: var(--t-small); color: var(--ink); margin-top: var(--s2); }
.drop small { display: block; font-size: var(--t-micro); color: var(--muted); margin-top: 3px; }
.drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* ---------- 12. REVIEW STEP ---------------------------------------------- */
.review-group { margin-bottom: var(--s6); }
.review-group:last-of-type { margin-bottom: 0; }
.review-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4); padding-bottom: 10px; margin-bottom: var(--s3);
  border-bottom: 1px solid var(--line);
}
.review-head h3 { font-size: var(--t-body); letter-spacing: -.015em; text-transform: none; }
.review-edit {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--t-micro); font-weight: 600; color: var(--blue-ink);
  background: none; border: 0; cursor: pointer; padding: 5px 8px; border-radius: var(--r-sm);
}
.review-edit:hover { background: var(--blue-wash); }
.review-edit svg { width: 13px; height: 13px; }
.review-list { display: grid; grid-template-columns: minmax(150px,.6fr) 1fr; gap: 2px var(--s5); }
.review-list dt {
  font-size: var(--t-micro); color: var(--muted); padding: 7px 0;
}
.review-list dd {
  margin: 0; font-size: var(--t-small); color: var(--ink); font-weight: 500;
  padding: 7px 0; word-break: break-word;
}
.review-list dd.empty { color: var(--faint); font-weight: 400; font-style: italic; }
.review-list dd img { max-height: 54px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; padding: 3px; }

/* ---------- 13. ACTIONS -------------------------------------------------- */
.form-actions {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s3);
  margin-top: var(--s5);
  padding: var(--s4);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-lg);
  box-shadow: var(--e2);
}
.form-actions .spacer { flex: 1; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: var(--r); padding: 12px 20px; cursor: pointer;
  font-size: var(--t-small); font-weight: 600;
  transition: transform .2s var(--ease), box-shadow .3s var(--ease), background .2s var(--ease);
  border: 1px solid transparent;
}
.btn svg { width: 15px; height: 15px; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--blue-grad); color: #fff; box-shadow: var(--e-blue);
}
.btn-primary:hover { box-shadow: 0 10px 26px -8px rgba(0,100,220,.55); }
.btn-secondary {
  background: var(--white); color: var(--ink-2); border-color: var(--line-2);
}
.btn-secondary:hover { border-color: var(--blue); color: var(--blue-ink); }
.step-count { font-size: var(--t-micro); color: var(--muted); }

/* ---------- 14. SUCCESS -------------------------------------------------- */
.success-card {
  text-align: center;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-xl);
  box-shadow: var(--e3);
  padding: var(--s10) var(--s7);
  animation: rise .5s var(--ease) both;
}
.success-mark {
  width: 62px; height: 62px; border-radius: 50%; margin-inline: auto;
  display: grid; place-items: center;
  background: var(--ok-wash); color: var(--ok);
  border: 1px solid rgba(15,122,90,.2);
}
.success-mark svg { width: 28px; height: 28px; }
.success-card h2 { font-size: 1.65rem; margin: var(--s5) 0 var(--s3); letter-spacing: -.026em; }
.success-card > p { font-size: var(--t-body); color: var(--muted); max-width: 440px; margin-inline: auto; }
.ref-box {
  display: inline-flex; align-items: center; gap: var(--s3);
  margin: var(--s6) 0;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 10px 10px 10px var(--s5);
}
.ref-box span { font-size: var(--t-eyebrow); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.ref-box b {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: var(--t-body); color: var(--ink); letter-spacing: .04em;
}
.next-steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3);
  text-align: left; margin: var(--s7) 0;
}
.next-steps > div {
  background: rgba(255,255,255,.6); border: 1px solid var(--line);
  border-radius: var(--r); padding: var(--s4);
}
.next-steps i {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--blue-wash); color: var(--blue-deep);
  font-size: var(--t-eyebrow); font-weight: 700; font-style: normal; margin-bottom: 9px;
}
.next-steps b { display: block; font-size: var(--t-small); color: var(--ink); }
.next-steps p { font-size: var(--t-micro); color: var(--muted); margin-top: 3px; line-height: 1.5; }

/* ---------- 15. RESPONSIVE ----------------------------------------------- */
@media (max-width: 900px) {
  .type-grid, .meta-row, .next-steps { grid-template-columns: 1fr; }
  .photo-guide { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  main { width: calc(100% - var(--s6)); }
  .landing-main { padding: var(--s8) 0 var(--s7); }
  .form-page { padding-top: var(--s5); }
  .brandbar { padding: var(--s3) var(--s4); }
  .brand-logo { height: 24px; }
  .brand-divider, .brand-text small { display: none; }
  .brand-text b { font-size: var(--t-small); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand { gap: var(--s2); }
  .section-head h2 { font-size: 1.0625rem; }
  .section-head { gap: var(--s3); }
  .section-badge { width: 34px; height: 34px; border-radius: 11px; }
  .form-intro h1 { font-size: 1.5rem; }
  .secure-badge span { display: none; }
  .secure-badge { padding: 8px; }
  .cols2 { grid-template-columns: 1fr; }
  .sig-grid { grid-template-columns: 1fr; }
  .form-section { padding: var(--s5) var(--s4); border-radius: var(--r-lg); }
  .stepper-shell { top: 59px; }
  .step-label { display: none; }
  .stepper button { justify-content: center; padding: 6px 4px; }
  .review-list { grid-template-columns: 1fr; gap: 0; }
  .review-list dt { padding-bottom: 0; }
  .review-list dd { padding-top: 2px; padding-bottom: 10px; }
  .form-actions { margin-inline: calc(var(--s3) * -1); border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .btn { padding: 12px 15px; }
  .upload-head { flex-wrap: wrap; }
  .upload-btn { width: 100%; }
  .site-footer > div { width: calc(100% - var(--s6)); flex-direction: column; align-items: flex-start; gap: var(--s3); }
  .success-card { padding: var(--s8) var(--s5); }
}

/* ---------- 16. MOTION / PRINT ------------------------------------------- */
@media (max-width: 560px) {
  /* The page heading already names the form — the logo alone is enough up here. */
  .brand-text { display: none; }
  .hero h1 { font-size: 1.75rem; }
  .type-card { padding: var(--s5); }
  .ref-box { flex-wrap: wrap; justify-content: center; padding: var(--s3); }
  .sig-tabs button { font-size: var(--t-eyebrow); }
  .canvas-actions { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
@media print {
  body::before, .brandbar, .stepper-shell, .form-actions, .site-footer { display: none !important; }
  .form-section { box-shadow: none; border: 1px solid #ccc; background: #fff; }
}

/* ---------- 8b. FIELD REFINEMENTS ---------------------------------------- */
/* Leading glyphs on the two field types people most often mistype. */
.field input[type="email"],
.field input[type="tel"] {
  background-repeat: no-repeat;
  background-position: left 13px center;
  padding-left: 40px;
}
.field input[type="email"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%238B95A1' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m2 7 10 6 10-6'/%3E%3C/svg%3E");
}
.field input[type="tel"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%238B95A1' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2 4.2 2 2 0 0 1 4 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.4 2.1L8 9.8a16 16 0 0 0 6 6l1.2-1.2a2 2 0 0 1 2.1-.5c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2Z'/%3E%3C/svg%3E");
}
.field input[type="email"]:focus, .field input[type="tel"]:focus { background-color: var(--white); }
/* The select already carries a chevron on the right — keep its icon slot clear. */
.field select { background-position: right 13px center; }

/* Numeric fields read better right-aligned to their own width. */
.field input[inputmode="numeric"] { font-variant-numeric: tabular-nums; letter-spacing: .01em; }

/* ---------- 8c. GROUP RESPONSIVE ----------------------------------------- */
@media (max-width: 980px) {
  .group { grid-template-columns: 1fr; gap: var(--s4) 0; padding: var(--s6) 0; }
  .group-aside { position: static; }
  .group-aside p { max-width: 60ch; }
}
@media (max-width: 640px) {
  /* One column below this width — splitting a postcode row helps nobody. */
  .group-fields > * { grid-column: 1 / -1 !important; }
  .uploads.two-up { grid-template-columns: 1fr; }
  .sig-grid { grid-template-columns: 1fr; }
}

/* Side-by-side upload cards have no room for a button beside the text —
   stack them so the title gets the full width and the button spans the card. */
.uploads.two-up .upload-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s3); align-items: start;
}
.uploads.two-up .upload-btn { grid-column: 1 / -1; width: 100%; margin-top: var(--s1); }
.uploads.two-up .upload { display: flex; flex-direction: column; }
.uploads.two-up .file-list { margin-top: auto; padding-top: var(--s3); }

/* The animated guide is reference material, not the subject of the step. */
.photo-guide img { max-height: 250px; object-fit: contain; object-position: top; }
.photo-guide { padding: var(--s4); gap: var(--s4); }
