/* ═══════════════════════════════════════════════════════════
   Ambient Services Group — New Customer Details form
   Palette sampled from the ATS letterhead artwork:
     magenta #E6007E · cyan #009FE3 · reflex blue #312783
   ═══════════════════════════════════════════════════════════ */

:root {
  --magenta:  #E6007E;
  --cyan:     #009FE3;
  --blue:     #312783;
  --ink:      #1D1D1B;
  --ink-2:    #55554F;
  --ink-3:    #86867F;
  --line:     #DFDFDB;
  --line-2:   #EFEFEC;
  --paper:    #FFFFFF;
  --ground:   #F7F7F4;
  --ok:       #0E7A4F;
  --ok-bg:    #E8F5EE;
  --warn:     #A65200;
  --warn-bg:  #FDF2E4;
  --err:      #C0182B;
  --err-bg:   #FCEDEE;

  --r:      10px;
  --r-lg:   16px;
  --shadow: 0 1px 2px rgba(29,29,27,.05), 0 8px 24px -12px rgba(29,29,27,.14);

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* The UA's [hidden] rule loses to any author `display`, and plenty of things
   here set one (.btn, .check …). Every hidden/step toggle depends on
   this, so it goes first. */
[hidden] { display: none !important; }

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

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding-inline: 20px; }

.skip {
  position: absolute; left: -9999px;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r); z-index: 50;
}
.skip:focus { left: 16px; top: 16px; }

/* ── Masthead ───────────────────────────────────────────── */
.masthead { background: var(--paper); border-bottom: 1px solid var(--line); }
.masthead-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; padding-block: 22px;
}
.logo { height: 52px; width: auto; }
.masthead-meta {
  display: flex; flex-direction: column; text-align: right;
  font-size: 12.5px; line-height: 1.5; color: var(--ink-2);
}
.masthead-meta strong { color: var(--blue); font-size: 13px; }
.masthead-meta a { color: var(--ink-2); }

/* ── Intro ──────────────────────────────────────────────── */
.intro { padding-block: 40px 8px; }
h1 {
  font-size: clamp(28px, 5vw, 38px); line-height: 1.12;
  letter-spacing: -.02em; margin: 0 0 12px;
}
.intro p { margin: 0; max-width: 56ch; color: var(--ink-2); font-size: 17px; }

/* ── Step nav ───────────────────────────────────────────── */
.steps { padding-block: 28px 4px; }
.steps ol {
  display: flex; gap: 4px 18px; flex-wrap: wrap;
  list-style: none; margin: 0 0 14px; padding: 0;
  font-size: 13px; color: var(--ink-3);
}
.steps li { display: flex; align-items: center; gap: 7px; }
.steps li .dot {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--line-2); color: var(--ink-3);
  font-size: 11px; font-weight: 600; flex: none;
}
.steps li[data-state="current"] { color: var(--ink); font-weight: 600; }
.steps li[data-state="current"] .dot { background: var(--magenta); color: #fff; }
.steps li[data-state="done"] { color: var(--ink-2); }
.steps li[data-state="done"] .dot { background: var(--cyan); color: #fff; }
.steps li[data-state="done"] button { color: inherit; }
.steps button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.steps button:hover { text-decoration: underline; }
.steps li[data-state="todo"] button { cursor: default; }
.steps li[data-state="todo"] button:hover { text-decoration: none; }

.progress { height: 3px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.progress-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  border-radius: 99px; transition: width .3s cubic-bezier(.4,0,.2,1);
}

/* ── Step panels ────────────────────────────────────────── */
.step {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 30px; margin-block: 22px;
}
.step > h2 { font-size: 21px; letter-spacing: -.01em; margin: 0 0 6px; }
.step > h2 + .lede { margin: 0 0 24px; color: var(--ink-2); font-size: 15px; }
.step > h2:last-of-type { margin-bottom: 24px; }

/* ── Fields ─────────────────────────────────────────────── */
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }

label, legend { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
legend { padding: 0; }
.hint { font-weight: 400; color: var(--ink-3); font-size: 13px; }
.req { color: var(--magenta); margin-left: 1px; }

input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input:not([type]), select, textarea {
  width: 100%; padding: 11px 13px;
  font-family: inherit; font-size: 15.5px; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: var(--r); transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: none; cursor: pointer; }

input:hover:not([readonly]), select:hover, textarea:hover { border-color: #C9C9C4; }

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0,159,227,.18);
}

input[readonly] { background: var(--ground); color: var(--ink-2); border-style: dashed; cursor: default; }
::placeholder { color: #B4B4AE; }

.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--err); }
.field.invalid > .msg { display: block; }
.msg { display: none; margin: 6px 0 0; font-size: 13px; color: var(--err); font-weight: 500; }

.help { margin: 6px 0 0; font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.help a, .linkish {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--blue); text-decoration: underline;
  text-decoration-color: rgba(49,39,131,.35); text-underline-offset: 2px; cursor: pointer;
}
.linkish:hover { text-decoration-color: var(--blue); }
.linkish.danger { color: var(--err); text-decoration-color: rgba(192,24,43,.35); }

/* autofilled-from-ABR marker */
.field.autofilled > label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.field.autofilled > label::after {
  content: "from the ABR";
  flex: none; font-weight: 500; font-size: 11.5px; letter-spacing: .01em;
  color: var(--cyan); text-transform: none; white-space: nowrap;
}

.grid-2, .grid-3 { display: grid; gap: 0 18px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── ABN block ──────────────────────────────────────────── */
.field-abn { margin-bottom: 24px; }
.field-abn > label { font-size: 15px; }
.abn-row { display: flex; gap: 10px; }
.abn-row input {
  font-size: 20px; font-weight: 600; letter-spacing: .06em;
  font-variant-numeric: tabular-nums; padding-block: 12px;
}
.abn-row .btn { flex: none; }

.status { margin: 8px 0 0; font-size: 13.5px; font-weight: 500; min-height: 1.2em; }
.status[data-tone="ok"]      { color: var(--ok); }
.status[data-tone="err"]     { color: var(--err); }
.status[data-tone="warn"]    { color: var(--warn); }
.status[data-tone="working"] { color: var(--ink-3); }

.abr-card {
  background: linear-gradient(180deg, #F4FBFE, #FBFDFF);
  border: 1px solid #CDEAF8; border-radius: var(--r);
  padding: 16px 18px; margin-bottom: 24px;
}
.abr-card-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px;
}
.abr-card dl {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14px;
}
.abr-card dt { color: var(--ink-3); }
.abr-card dd { margin: 0; font-weight: 500; }

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em; text-transform: none;
}
.pill-ok   { background: var(--ok-bg);   color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }

/* ── Address suggest ───────────────────────────────────── */
.addr {
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px; margin: 0 0 20px; min-inline-size: 0;
}
.addr > legend { margin-left: -4px; padding-inline: 4px; }
.addr .field:last-child { margin-bottom: 0; }
.addr-parts { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); }

.suggest {
  list-style: none; margin: 6px 0 0; padding: 5px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--paper); box-shadow: var(--shadow);
  max-height: 260px; overflow-y: auto;
}
.suggest li {
  padding: 9px 11px; border-radius: 7px; font-size: 14.5px; cursor: pointer;
}
.suggest li:hover, .suggest li[aria-selected="true"] { background: var(--line-2); }
.suggest li .sub { display: block; font-size: 12.5px; color: var(--ink-3); }
.suggest li.empty { color: var(--ink-3); cursor: default; }
.suggest li.empty:hover { background: none; }

/* ── Radios & checks ───────────────────────────────────── */
.radios { display: flex; gap: 10px 22px; flex-wrap: wrap; }
.radios-stack { flex-direction: column; gap: 9px; }
.radio, .check {
  display: flex; align-items: flex-start; gap: 9px;
  font-weight: 400; font-size: 15px; margin: 0; cursor: pointer; line-height: 1.45;
}
.radio input, .check input {
  width: 18px; height: 18px; margin: 2px 0 0; flex: none;
  accent-color: var(--magenta); cursor: pointer;
}
.checks { display: flex; flex-direction: column; gap: 11px; margin-bottom: 22px; }
fieldset.field { border: 0; padding: 0; margin: 0 0 20px; min-inline-size: 0; }

/* ── Sites ─────────────────────────────────────────────── */
.card {
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; margin: 0 0 18px; background: #FDFDFC; min-inline-size: 0;
}
.site-legend {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; width: 100%; margin-bottom: 16px; padding: 0;
}
.site-title { font-size: 15px; font-weight: 700; color: var(--blue); }
.site:only-of-type .site-remove { display: none; }
.same-as-billing {
  padding: 11px 13px; background: var(--line-2);
  border-radius: var(--r); margin-bottom: 18px;
}

/* ── Review ────────────────────────────────────────────── */
.review { margin-bottom: 26px; }
.review-group { border-top: 1px solid var(--line); padding-block: 16px; }
.review-group:first-child { border-top: 0; padding-top: 0; }
.review-group h3 {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 10px;
}
.review dl { display: grid; grid-template-columns: minmax(150px, auto) 1fr; gap: 7px 20px; margin: 0; font-size: 14.5px; }
.review dt { color: var(--ink-3); }
.review dd { margin: 0; white-space: pre-line; }
.review dd.blank { color: var(--ink-3); font-style: italic; }

/* ── Buttons & nav ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 22px; font: inherit; font-size: 15px; font-weight: 600;
  border-radius: var(--r); border: 1.5px solid transparent;
  cursor: pointer; transition: background-color .12s, border-color .12s, color .12s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary   { background: var(--magenta); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #C80070; }
.btn-secondary { background: var(--paper); color: var(--blue); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--blue); background: #FAFAFF; }
.btn-ghost     { background: none; color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); background: var(--line-2); }
.btn:disabled  { opacity: .5; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.formnav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding-block: 4px 44px;
}
.formnav-right { display: flex; align-items: center; gap: 16px; margin-left: auto; flex-wrap: wrap; }
.errsum { margin: 0; font-size: 13.5px; color: var(--err); font-weight: 500; text-align: right; }

.turnstile { margin-block: 20px; }
.privacy { font-size: 13px; color: var(--ink-3); margin: 20px 0 0; }

/* ── Done ──────────────────────────────────────────────── */
.done {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 48px 34px; margin-block: 22px 60px; text-align: center;
}
.tick {
  width: 62px; height: 62px; margin: 0 auto 20px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--cyan), var(--magenta)); color: #fff;
}
.done h2 { font-size: 25px; margin: 0 0 10px; letter-spacing: -.01em; }
.done p { margin: 0 auto; max-width: 46ch; color: var(--ink-2); }
.done .ref {
  margin-block: 20px; font-size: 14px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.done .ref strong { color: var(--ink); letter-spacing: .04em; }

/* ── Footer ────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--line); background: var(--paper);
  padding-block: 24px; text-align: center;
  font-size: 12.5px; color: var(--ink-3);
}
.footer p { margin: 0 0 4px; }
.footer .tagline { font-weight: 600; color: var(--blue); letter-spacing: .01em; }
.footer a { color: var(--ink-3); }

/* ── Narrow ────────────────────────────────────────────── */
@media (max-width: 620px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .step { padding: 22px 18px; border-radius: var(--r); }
  .masthead-inner { justify-content: center; }
  .masthead-meta { text-align: center; align-items: center; }
  .logo { height: 42px; }
  .intro { padding-top: 28px; }
  .abn-row { flex-direction: column; }
  .abn-row .btn { width: 100%; }
  .review dl { grid-template-columns: 1fr; gap: 2px; }
  .review dt { margin-top: 8px; }
  .formnav { flex-direction: column-reverse; align-items: stretch; }
  .formnav-right { flex-direction: column; align-items: stretch; margin-left: 0; }
  .errsum { text-align: center; }
  .btn { width: 100%; }
  .steps ol { font-size: 12px; gap: 4px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .steps, .formnav, .masthead-meta { display: none; }
  .step { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}
