/* CP handover tablet — design system.
 *
 * Built for one device: a tablet held in a showroom, in daylight, by someone
 * standing up. Everything follows from that. Touch targets are 56px+, contrast
 * is high enough to read next to a window, and nothing depends on a hover state
 * or a font that has to download first.
 *
 * Two voices: a mono face for machine values a person reads back aloud (stock
 * numbers, plates), and the system UI stack for language. No webfonts — on
 * showroom wifi a font that fails to load is a broken handover.
 *
 * Tasks 10 and 11 build the customer screens on these tokens.
 */

:root {
  /* Navy is the ground, not an accent. Amber marks a confirmed vehicle and
   * nothing else — Cyprus rear plates are amber, so it is borrowed from the
   * subject rather than picked. Red is reserved for unsent work; a red primary
   * button would read as destructive on the one action that must feel safe. */
  --ink: #0b0e1c;
  --navy: #202759;
  --navy-lift: #2c3574;
  --navy-deep: #141a44;
  --paper: #eef0f7;
  --surface: #ffffff;
  --line: #dde1ee;
  --line-strong: #c3c9de;
  --muted: #5f6785;
  --red: #d62229;
  /* The same red taken down for small text on white — see .field__error. */
  --red-ink: #b01b21;
  --amber: #f2b705;
  --green: #197a4e;

  --radius: 14px;
  --radius-lg: 22px;
  --tap: 3.5rem;

  /* Emil's stronger curves; the CSS built-ins are too weak to read as
   * intentional at these durations. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", Menlo,
    Consolas, monospace;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

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

/* The `hidden` attribute has to win. The UA rule for it is `[hidden]`, which
 * any class setting `display` outranks — so `.field { display: block }` was
 * quietly showing every conditional field: the company name on an individual's
 * form, and "where did you hear about us" with nothing selected. Anything
 * toggled by `hidden` in JS depends on this line. */
[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--ui);
  color: var(--ink);
  background: var(--navy-deep);
  -webkit-font-smoothing: antialiased;
  /* A kiosk should not rubber-band or offer to select the furniture. */
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

/* The ground: a navy field with a soft light source top-left and a fine
 * diagonal weave. Both are gradients — no image to fail to load. */
.stage {
  min-height: 100%;
  padding: clamp(1rem, 3vw, 2.5rem);
  display: grid;
  place-items: center;
  background:
    radial-gradient(
      120% 90% at 12% 0%,
      rgba(90, 106, 190, 0.55) 0%,
      rgba(32, 39, 89, 0) 60%
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.022) 0 2px,
      rgba(255, 255, 255, 0) 2px 9px
    ),
    linear-gradient(168deg, var(--navy) 0%, var(--navy-deep) 100%);
}

/* --- type ---------------------------------------------------------------- */

h1,
h2,
h3 {
  margin: 0;
  font-weight: 640;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

/* --- brand mark ---------------------------------------------------------- */

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.mark__badge {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 10px;
  background: linear-gradient(150deg, var(--navy-lift), var(--navy));
  color: #fff;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.mark__text {
  font-size: 0.95rem;
  line-height: 1.25;
}

.mark__text small {
  display: block;
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0;
}

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

.card {
  width: 100%;
  max-width: 62rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 24px 60px -20px rgba(6, 10, 32, 0.55),
    0 2px 8px rgba(6, 10, 32, 0.18);
  overflow: hidden;
}

.card--narrow {
  max-width: 27rem;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1.25rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcff, #f3f5fb);
}

.card__body {
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

/* --- fields -------------------------------------------------------------- */

.field {
  display: block;
  margin-bottom: 1.5rem;
}

.field__label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  font-weight: 620;
}

.field__hint {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

/* Not the brand red and not semibold. #d62229 is tuned for a large surface;
   set in 14px type on white it vibrates and reads as shouting, which is the
   wrong tone for "check this field". Darker, calmer, normal weight. */
.field__error {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--red-ink);
  line-height: 1.45;
}

.field__error:empty {
  display: none;
}

/* Not an error: the handover carries on either way. Amber says "look at this
   before you move on", which is exactly the weight a missing vehicle type
   deserves — the default is right most of the time and silently wrong the
   rest. */
.field__warn {
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 0.55rem;
  border: 1px solid #f0d08a;
  background: #fdf6e6;
  color: #7a5a12;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
}

.input {
  width: 100%;
  min-height: var(--tap);
  padding: 0.85rem 1rem;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: #fbfcfe;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  transition:
    border-color 160ms var(--ease-out),
    box-shadow 160ms var(--ease-out),
    background-color 160ms var(--ease-out);
}

.input:focus-visible {
  outline: none;
  background: #fff;
  border-color: var(--navy-lift);
  box-shadow: 0 0 0 4px rgba(44, 53, 116, 0.16);
}

/* The signature: the stock number is entered on something that looks like the
 * asset plate on the vehicle, because that is exactly what is being read off
 * the windscreen. Mono, tracked out, recessed. */
.plate {
  position: relative;
  display: flex;
  align-items: stretch;
  border-radius: var(--radius);
  border: 1.5px solid var(--line-strong);
  background: linear-gradient(180deg, #f7f8fc, #fff);
  box-shadow: inset 0 2px 4px rgba(11, 14, 28, 0.06);
  overflow: hidden;
  transition:
    border-color 180ms var(--ease-out),
    box-shadow 180ms var(--ease-out);
}

.plate:focus-within {
  border-color: var(--navy-lift);
  box-shadow:
    inset 0 2px 4px rgba(11, 14, 28, 0.05),
    0 0 0 4px rgba(44, 53, 116, 0.16);
}

.plate__tab {
  display: grid;
  place-items: center;
  padding: 0 0.9rem;
  background: linear-gradient(180deg, var(--navy-lift), var(--navy));
  color: #fff;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.plate__input {
  flex: 1;
  min-width: 0;
  min-height: 4.25rem;
  padding: 0 1rem;
  border: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.plate__input:focus {
  outline: none;
}

.plate__input::placeholder {
  color: #b9bfd4;
  letter-spacing: 0.1em;
}

.plate[data-state="invalid"] {
  border-color: var(--red);
}

/* --- choice (vehicle type) ----------------------------------------------- */

.choice {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.choice__option {
  position: relative;
}

.choice__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice__face {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: var(--tap);
  padding: 0.9rem 1rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fbfcfe;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 160ms var(--ease-out),
    background-color 160ms var(--ease-out),
    transform 160ms var(--ease-out);
}

.choice__face svg {
  flex: none;
  color: var(--navy-lift);
  transition: color 160ms var(--ease-out);
}

/* Solid fill, not a tint. A customer glancing at this has to see which one is
 * chosen without comparing two nearly-identical boxes. */
.choice__option input:checked + .choice__face {
  border-color: var(--navy);
  background: linear-gradient(180deg, var(--navy-lift), var(--navy));
  color: #fff;
}

.choice__option input:checked + .choice__face svg {
  color: #fff;
}

.choice__option input:focus-visible + .choice__face {
  box-shadow: 0 0 0 4px rgba(44, 53, 116, 0.16);
}

.choice__face:active {
  transform: scale(0.985);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: var(--tap);
  padding: 0.9rem 1.4rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 640;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  /* Named properties only — `all` would sweep up colour and layout too. */
  transition:
    transform 160ms var(--ease-out),
    background-color 160ms var(--ease-out),
    border-color 160ms var(--ease-out),
    opacity 160ms var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(44, 53, 116, 0.22);
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  width: 100%;
  min-height: 4rem;
  font-size: 1.1rem;
  color: #fff;
  background: linear-gradient(180deg, var(--navy-lift), var(--navy));
  box-shadow: 0 8px 20px -10px rgba(32, 39, 89, 0.9);
}

.btn--quiet {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--link {
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  background: none;
  border: 0;
  color: var(--muted);
  font-weight: 600;
}

/* Quiet text links, deliberately not buttons: one vehicle is the ordinary
   handover and needs neither of them. Still a 44px touch target, because a
   link nobody can hit on a tablet is worse than no link. */
.addrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-top: 0.35rem;
}

.addrow__link {
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.addrow__link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(44, 53, 116, 0.22);
  border-radius: 4px;
}

/* --- vehicles in this handover ------------------------------------------ */

.vehicles {
  margin-top: 1.1rem;
}

.vehicles__title {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.vehicles__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.vehicles__item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.55rem 0.7rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: calc(var(--radius) - 4px);
  background: #fff;
}

.vehicles__item.is-unknown {
  border-style: dashed;
}

.vehicles__stock {
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--navy);
}

.vehicles__detail {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vehicles__remove {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.vehicles__remove:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(44, 53, 116, 0.22);
}

.vehicles__empty {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}

@media (hover: hover) and (pointer: fine) {
  .addrow__link:hover {
    color: var(--ink);
  }
  .vehicles__remove:hover {
    background: #f1f3f9;
    color: var(--ink);
  }
}

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover {
    background: linear-gradient(180deg, #35408a, #262e69);
  }
  .btn--quiet:hover {
    border-color: var(--navy-lift);
  }
  .btn--link:hover {
    color: var(--ink);
  }
  .choice__face:hover {
    border-color: var(--navy-lift);
  }
}

/* --- language toggle ----------------------------------------------------- */

.lang {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: #e9ecf6;
  border-radius: 999px;
}

.lang__btn {
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 680;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  transition:
    background-color 160ms var(--ease-out),
    color 160ms var(--ease-out);
}

.lang__btn[aria-pressed="true"] {
  background: var(--surface);
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(11, 14, 28, 0.16);
}

/* --- vehicle read-back --------------------------------------------------- */

.readback {
  margin-top: 1.25rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: #fbfcfe;
  padding: 1.15rem 1.25rem;
  min-height: 8.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.readback[hidden] {
  display: none;
}

/* The reveal: the vehicle wipes in rather than blinking on, so the moment of
 * confirmation reads as the machine resolving something. Clip-path and opacity
 * only — no layout properties. */
.readback__result {
  clip-path: inset(0 0 0 0);
  opacity: 1;
  transition:
    clip-path 260ms var(--ease-out),
    opacity 200ms var(--ease-out);
}

.readback__result[data-entering="true"] {
  clip-path: inset(0 100% 0 0);
  opacity: 0;
}

.readback--found {
  border-color: rgba(242, 183, 5, 0.55);
  background: linear-gradient(180deg, #fffdf5, #fffaf0);
}

.readback--warn {
  border-color: rgba(214, 34, 41, 0.35);
  background: #fff8f8;
}

.readback__status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 680;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.readback__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--line-strong);
}

.readback--found .readback__dot {
  background: var(--amber);
}

.readback--warn .readback__dot {
  background: var(--red);
}

.readback__vehicle {
  margin: 0.6rem 0 0;
  font-size: clamp(1.35rem, 3.4vw, 1.75rem);
  font-weight: 660;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.readback__id {
  margin: 0.55rem 0 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.readback__id span {
  font-family: var(--ui);
  font-size: 0.72rem;
  font-weight: 680;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.readback__message {
  margin: 0.5rem 0 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink);
}

.readback__idle {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
  margin: 0;
}

/* Deliberately not a spinner: three dots that pulse read as "working" without
 * implying a progress bar's promise of completion. */
.dots {
  display: inline-flex;
  gap: 0.28rem;
  margin-left: 0.15rem;
}

.dots i {
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  animation: dot 1s var(--ease-in-out) infinite;
}

.dots i:nth-child(2) {
  animation-delay: 0.14s;
}

.dots i:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes dot {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

/* --- outbox banner ------------------------------------------------------- */

.outbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
  background: #fdeced;
  color: #8f1519;
  font-size: 0.88rem;
  font-weight: 640;
  transition:
    opacity 200ms var(--ease-out),
    transform 200ms var(--ease-out);
}

.outbox[hidden] {
  display: none;
}

.outbox__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--red);
}

@starting-style {
  .outbox {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* --- form ---------------------------------------------------------------- */

.field--flush {
  border: 0;
  padding: 0;
  margin: 0 0 1.5rem;
}

fieldset.field {
  border: 0;
  padding: 0;
  /* Not the `margin` shorthand: that sets margin-top to 0, which outranks
   * `.stack > * + *` on specificity and collapses the gap above a fieldset. */
  margin-bottom: 1.5rem;
}

.field__note {
  font-style: normal;
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--muted);
  margin-left: 0.4rem;
}

.field__note--right {
  display: block;
  margin: 0.4rem 0 0;
  text-align: right;
}

.input--area {
  min-height: 6rem;
  resize: vertical;
  line-height: 1.5;
}

/* Two columns on a landscape tablet, one in portrait. The pairs are chosen so
 * neither half is ever orphaned: name/company, phone/email, district/area. */
.grid2 {
  display: grid;
  gap: 0 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 46rem) {
  .grid2 {
    grid-template-columns: 1fr 1fr;
  }

  /* An individual has no company field, which would otherwise leave a dead
   * half-row beside their name. `:has` is supported everywhere this runs. */
  .grid2:has(> [hidden]) > .field:not([hidden]) {
    grid-column: 1 / -1;
  }
}

/* The dial code sits inside the field rather than beside it, so it reads as
 * one phone number and not two questions. */
.phone {
  display: flex;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fbfcfe;
  /* Not hidden: the dial code's dropdown is positioned inside this row and
     clipping it left only the search box visible. The code cell rounds its own
     left corners instead. */
  overflow: visible;
  transition:
    border-color 160ms var(--ease-out),
    box-shadow 160ms var(--ease-out);
}

.phone:focus-within {
  border-color: var(--navy-lift);
  box-shadow: 0 0 0 4px rgba(44, 53, 116, 0.16);
}

/* Just wide enough for a flag and the longest dial code. The country name
   lives in the open list — a name rendered here gets clipped mid-word, which
   reads as a typo on the field the customer is about to check. */
.phone__code {
  flex: none;
  width: 7.5rem;
  border-right: 1.5px solid var(--line);
  border-radius: calc(var(--radius) - 2px) 0 0 calc(var(--radius) - 2px);
  background: #f3f5fb;
}

/* --- picker (dial code, district) --------------------------------------- */

.picker {
  position: relative;
}

.picker__button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  width: 100%;
  min-height: var(--tap);
  padding: 0 0.75rem 0 0.9rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

/* Standing alone (district) it needs the field's own frame; inside the phone
   row the frame belongs to .phone. */
.field > .picker .picker__button,
[data-district-mount] .picker__button {
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fbfcfe;
  font-weight: 500;
  font-size: 1.05rem;
}

.picker__button:focus-visible {
  outline: none;
  border-radius: var(--radius);
  box-shadow: 0 0 0 4px rgba(44, 53, 116, 0.16);
}

.picker__value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker__chevron {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.picker__panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.4rem);
  left: 0;
  min-width: 100%;
  /* The dial control is narrow; its list is not. */
  width: max(100%, 20rem);
  max-width: min(24rem, 86vw);
  padding: 0.5rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 40px -16px rgba(6, 10, 32, 0.45);
}

.picker__search {
  width: 100%;
  min-height: 3rem;
  margin-bottom: 0.4rem;
  padding: 0 0.85rem;
  border: 1.5px solid var(--line-strong);
  border-radius: calc(var(--radius) - 4px);
  background: #fbfcfe;
  font: inherit;
  font-size: 1rem;
}

.picker__search:focus-visible {
  outline: none;
  border-color: var(--navy-lift);
}

.picker__list {
  max-height: min(19rem, 50vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.picker__option {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.6rem 0.75rem;
  border: 0;
  border-radius: calc(var(--radius) - 6px);
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.picker__option[aria-selected="true"] {
  font-weight: 650;
  background: #eef1fa;
}

.picker__option.is-active {
  background: #e4e9f8;
}

.picker__empty {
  margin: 0;
  padding: 0.85rem 0.75rem;
  font-size: 0.92rem;
  color: var(--muted);
}

/* The country code on its own. The + is furniture, not input, so it cannot be
   typed in front of — and the box is too small to invite a whole number. */
.codebox {
  display: inline-flex;
  align-items: stretch;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fbfcfe;
  overflow: hidden;
}

.codebox:focus-within {
  border-color: var(--navy-lift);
  box-shadow: 0 0 0 4px rgba(44, 53, 116, 0.16);
}

.codebox__plus {
  display: grid;
  place-items: center;
  padding: 0 0.6rem 0 0.85rem;
  background: #f3f5fb;
  border-right: 1.5px solid var(--line);
  font-weight: 700;
  color: var(--muted);
}

.codebox__input {
  width: 5.5rem;
  min-height: var(--tap);
  padding: 0 0.85rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.codebox__input:focus-visible {
  outline: none;
}

@media (hover: hover) and (pointer: fine) {
  .picker__option:hover {
    background: #eef1fa;
  }
}

.phone__number {
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  padding: 0 1rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.phone__code:focus,
.phone__number:focus {
  outline: none;
}

.phone[data-state="invalid"],
.input[data-state="invalid"] {
  border-color: var(--red);
}

/* --- chips (multi-select) ------------------------------------------------ */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip__face {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 3rem;
  padding: 0.6rem 1rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: #fbfcfe;
  font-size: 0.95rem;
  font-weight: 580;
  cursor: pointer;
  transition:
    border-color 160ms var(--ease-out),
    background-color 160ms var(--ease-out),
    color 160ms var(--ease-out),
    transform 160ms var(--ease-out);
}

.chip__face::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background-color 160ms var(--ease-out);
}

.chip input:checked + .chip__face {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.chip input:checked + .chip__face::before {
  background: #fff;
}

.chip input:focus-visible + .chip__face {
  box-shadow: 0 0 0 4px rgba(44, 53, 116, 0.16);
}

.chip__face:active {
  transform: scale(0.97);
}

/* --- review list --------------------------------------------------------- */

.review {
  margin: 1.5rem 0 0;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.review__row {
  display: grid;
  grid-template-columns: 8.5rem 1fr auto;
  gap: 0.6rem;
  align-items: baseline;
  width: 100%;
  padding: 0.5rem 0.9rem;
  font-size: 0.94rem;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out);
}

.review__row:first-child {
  border-top: 0;
}

.review__row:active {
  background: #f3f5fb;
}

.review__key {
  color: var(--muted);
  font-size: 0.9rem;
}

.review__value {
  font-weight: 580;
  overflow-wrap: anywhere;
}

.review__value[data-empty="true"] {
  color: var(--muted);
  font-weight: 500;
}

.review__edit {
  color: var(--navy-lift);
  font-size: 0.85rem;
  font-weight: 640;
}

@media (max-width: 34rem) {
  .review__row {
    grid-template-columns: 1fr auto;
  }
  .review__key {
    grid-column: 1 / -1;
  }
}

/* --- GDPR notice --------------------------------------------------------- */

/* Quiet, not hidden. This is a notice, not a checkbox — it must be legible on
 * a tablet held at arm's length, but it is not the thing being decided. */
.notice {
  margin-top: 1.5rem;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #f7f8fc;
}

.notice__title {
  font-size: 0.95rem;
  font-weight: 660;
  margin-bottom: 0.55rem;
}

.notice__body {
  margin: 0 0 0.6rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #3d4463;
}

.notice__body:last-child {
  margin-bottom: 0;
}

/* --- consent ------------------------------------------------------------- */

/* Stacked and tight, at Andrea's direction (2026-09-25).
 *
 * They were side by side for an hour and it cost height rather than saving it:
 * equal-height columns meant the shorter box was padded out to match the
 * taller one, so the required tick sat in a mostly empty rectangle. One under
 * the other, each only as tall as its own text, is smaller than either.
 *
 * They remain two different things and still read as two — the required one is
 * marked Required, the optional one Optional, and neither starts ticked. What
 * changed is that nothing sits between them any more: the notice opens from
 * the link instead of separating them with a wall of text. */
.consents {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.consents .consent {
  margin-top: 0;
  padding: 0.8rem 0.95rem;
  gap: 0.7rem;
}

.consents .consent__label {
  line-height: 1.35;
}

.consents .consent__benefit {
  margin-top: 0.2rem;
  line-height: 1.45;
}

.consents .consent__hint {
  margin-top: 0.15rem;
}

.consent--offer {
  border-color: var(--navy-lift);
  background: linear-gradient(180deg, #f4f6ff, #eef1fb);
}

.consent--terms {
  background: #fbfcfe;
}

/* Sits inside a <label>, so it is a button rather than an anchor: a click has
   to open the notice without also toggling the tick it is nested in. */
.consent__link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--navy-lift);
  font-weight: 640;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* "Required" against the tick that blocks the handover, so the difference
   between the two boxes is stated rather than implied by styling. */
.consent__req {
  font-weight: 640;
  color: var(--ink);
}

.consent__req::after {
  content: " · ";
  color: var(--muted);
  font-weight: 400;
}

.consent__benefit {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}

/* --- marketing consent --------------------------------------------------- */

.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fbfcfe;
  cursor: pointer;
  transition:
    border-color 160ms var(--ease-out),
    background-color 160ms var(--ease-out);
}

.consent input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.consent__box {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  margin-top: 0.1rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: #fff;
  transition:
    background-color 160ms var(--ease-out),
    border-color 160ms var(--ease-out);
}

.consent__box svg {
  opacity: 0;
  transform: scale(0.8);
  transition:
    opacity 140ms var(--ease-out),
    transform 140ms var(--ease-out);
}

.consent input:checked + .consent__box {
  background: var(--navy);
  border-color: var(--navy);
}

.consent input:checked + .consent__box svg {
  opacity: 1;
  transform: none;
}

.consent input:focus-visible + .consent__box {
  box-shadow: 0 0 0 4px rgba(44, 53, 116, 0.16);
}

.consent input:checked ~ .consent__text {
  color: var(--ink);
}

.consent__label {
  display: block;
  font-weight: 600;
  line-height: 1.4;
}

.consent__hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

/* --- thank you ----------------------------------------------------------- */

.thanks {
  text-align: center;
  padding-block: clamp(2rem, 5vw, 3rem);
  display: flex;
  flex-direction: column;
}

/* Dissolved in portrait: the children become the flex items directly, so the
   column reads exactly as it did before the wrappers existed — thank you,
   code, hand it back, in DOM order, with nothing reordered. */
.thanks__col {
  display: contents;
}

.thanks h1 {
  margin-top: 1.25rem;
}

/* The second half of the heading's sentence, so it is sized between the
   heading and the body rather than looking like a paragraph that happens to
   follow one. Tight to the h1 above it for the same reason. */
.thanks__trust {
  margin: 0.15rem 0 0;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 560;
  line-height: 1.3;
  color: var(--ink);
  text-wrap: balance;
}

.thanks .lede {
  margin-left: auto;
  margin-right: auto;
  max-width: 24rem;
}

.thanks__handback {
  margin: 1.5rem auto 1.75rem;
  max-width: 22rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.review-ask {
  margin-top: 2rem;
  padding: 1.5rem 1.25rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: linear-gradient(180deg, #fbfcff, #f5f7fd);
}

.review-ask__title {
  font-size: 1.02rem;
  font-weight: 640;
  margin-bottom: 0.75rem;
}

/* The mark does the explaining the paragraph underneath was doing, for someone
   who will not read a paragraph. Set as a quiet pill so it reads as a label on
   the code rather than a button competing with it. */
/* `width: max-content` with auto margins, not `inline-flex`: the code below is
   inline-grid, so an inline pill shares its line and shunts the code sideways
   — which is what it did. This takes a line of its own and centres on it. */
.review-ask__brand {
  display: flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 0.45rem;
  margin: 0 auto 0.9rem;
  padding: 0.3rem 0.7rem 0.3rem 0.45rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}

.review-ask__g {
  width: 1rem;
  height: 1rem;
  flex: none;
}

/* Sized to scan from arm's length, which is where a phone actually is. Boxed
 * in white so the code keeps its quiet zone against the tinted panel. */
.review-ask__code {
  display: inline-grid;
  place-items: center;
  padding: 0.9rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(11, 14, 28, 0.12);
  position: relative;
}

/* A slow ring out of the code, once every few seconds.
 *
 * This screen asks for something after the customer has finished and has no
 * reason left to look at the tablet, so the code has to earn a glance. A ring
 * that leaves and fades reads as "come here" where a blink reads as an error,
 * and at this pace it is noticeable without being a thing to endure — the
 * screen now sits for two minutes, and anything faster would be nagging. */
.review-ask__code::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid var(--navy-lift);
  opacity: 0;
  pointer-events: none;
  animation: scan-ping 2800ms var(--ease-out) infinite;
}

@keyframes scan-ping {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  65% {
    transform: scale(1.13);
    opacity: 0;
  }
  100% {
    transform: scale(1.13);
    opacity: 0;
  }
}

/* Someone who has asked their device to stop animating things has asked for a
 * reason, and this is decoration. The code is still there. */
@media (prefers-reduced-motion: reduce) {
  .review-ask__code::after {
    animation: none;
  }
}

.review-ask__code svg {
  display: block;
  width: clamp(9rem, 34vw, 13rem);
  height: auto;
}

.review-ask__body {
  margin: 1rem auto 0;
  max-width: 22rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
}

/* The tablet lives on a counter in landscape, and this screen was a narrow
 * portrait column down the middle of it — the customer's phone is out, and the
 * code they need to scan was the smallest thing on the widest screen in the
 * building.
 *
 * Side by side above this width: the thank-you on the left, the code on the
 * right at the size it deserves. Portrait keeps the stacked version, which is
 * right for a phone and for the iPad held upright.
 */
@media (min-width: 46rem) and (orientation: landscape) {
  /* Wider than the other screens: three columns need the room, and the two
     outer ones were narrow enough that a four-word sentence wrapped to four
     lines. */
  [data-screen="thanks"].card--narrow {
    max-width: 62rem;
  }

  /* Two items side by side, never six.
   *
   * The first attempt kept the six children flat and had the code span every
   * row of the left column. A spanning item taller than the rows it covers has
   * its surplus height shared out between them, so the tick, the heading and
   * the button were pushed to the far corners of a mostly empty screen. The
   * wrapper stops being `display: contents` here, which gives the grid exactly
   * two things to place and nothing to span.
   */
  /* Three columns, the code in the middle.
   *
   * `1fr auto 1fr` sizes the middle to the code and splits what is left
   * equally, so the code sits in the true centre of the card rather than
   * wherever the text happens to end. The wrappers stop being
   * `display: contents` here, which gives the grid three items and nothing to
   * span — an item spanning rows taller than their content has its surplus
   * shared between them, which is what scattered this layout the first time.
   */
  /* `minmax(0, …)`, not `1fr`.
   *
   * A bare `1fr` has an automatic minimum of min-content, so a single long
   * word can force its track wider — and Greek has them. "Ευχαριστούμε"
   * inflated the left column and shoved the code off centre, which is exactly
   * the thing the middle column exists to prevent. With a zero minimum the
   * tracks stay equal whatever the language, so the code is centred in the
   * card in EN and EL alike. */
  .thanks {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    column-gap: clamp(1.25rem, 3vw, 2.5rem);
    align-items: center;
    text-align: left;
  }

  .thanks__col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    container-type: inline-size;
  }

  .thanks .lede,
  .thanks__trust,
  .thanks__handback {
    margin-left: 0;
    margin-right: 0;
    max-width: none;
    /* Breaks the line where the sentence wants to break rather than wherever
       the box ends, which is what turned "hand the tablet back" into four
       ragged lines. */
    text-wrap: balance;
  }

  /* One line, always — in both languages.
   *
   * "Thank you" was breaking after "Thank", which reads as a mistake on the
   * last thing a customer sees. Kept on one line and allowed to *shrink*
   * instead, because the alternative — a wider column — is what pushed the
   * code off centre in Greek.
   *
   * The vw rule is the fallback; a browser without container queries keeps it
   * and simply wraps, which is what happens today. */
  .thanks h1 {
    margin-top: 1rem;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
  }

  @supports (font-size: 1cqi) {
    .thanks h1 {
      /* Sized against its own column, so the longest word sets the size and
         the column never has to grow to hold it. */
      font-size: clamp(1.25rem, 15cqi, 2.1rem);
      white-space: nowrap;
    }
  }

  .thanks__handback {
    margin: 0 0 1rem;
  }

  .thanks .review-ask {
    margin-top: 0;
    text-align: center;
  }

  .review-ask__body {
    margin-left: auto;
    margin-right: auto;
  }

  .review-ask__code svg {
    width: clamp(11rem, 20vw, 15rem);
  }
}

.tick {
  display: grid;
  place-items: center;
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--navy-lift), var(--navy));
  color: #fff;
  animation: tick-in 420ms var(--ease-out) both;
}

@keyframes tick-in {
  from {
    opacity: 0;
    /* Never from scale(0) — nothing in the world appears out of nothing. */
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Headings are focused programmatically on every screen change so a keyboard
 * user is not left where the last screen was. They are tabindex="-1", so they
 * are never focused by tabbing — and a ring drawn around a heading nobody
 * clicked just looks like a bug. */
[data-focus]:focus {
  outline: none;
}

/* --- dialog -------------------------------------------------------------- */

/* Native <dialog>: focus trapping, Escape and the backdrop come free, and there
 * is no library to load on showroom wifi. */
.sheet {
  width: min(30rem, calc(100vw - 2rem));
  padding: clamp(1.25rem, 4vw, 1.75rem);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px -20px rgba(6, 10, 32, 0.6);
}

.sheet::backdrop {
  background: rgba(11, 14, 28, 0.55);
}

.sheet[open] {
  animation: sheet-in 220ms var(--ease-out) both;
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.sheet h2 {
  font-size: 1.15rem;
}

.sheet__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

/* The notice is longer than the other sheets, so it scrolls inside itself
   rather than growing past the screen and taking the close button with it. */
.sheet--notice {
  max-width: 34rem;
}

.sheet--notice .notice {
  max-height: min(55vh, 26rem);
  overflow-y: auto;
  margin: 0.75rem 0 1rem;
  padding-right: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

/* The plate is read off the vehicle, so it gets the same mono voice as the
 * stock number without the full asset-tag treatment. */
.input--plateish {
  font-family: var(--mono);
  font-size: 1.3rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --- screens ------------------------------------------------------------- */

.screen[hidden] {
  display: none;
}

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

.handover {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
}

/* Landscape tablet: the form and the confirmation sit side by side, so the
 * vehicle is visible while the stock number is being typed. Portrait stacks,
 * which is also the phone fallback. */
@media (min-width: 62rem) {
  .handover {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .handover__confirm {
    position: sticky;
    top: 0;
  }
}

.stack > * + * {
  margin-top: 1.25rem;
}

/* --- entrance ------------------------------------------------------------ */

.rise {
  animation: rise 420ms var(--ease-out) both;
}

.rise-1 {
  animation-delay: 40ms;
}
.rise-2 {
  animation-delay: 80ms;
}
.rise-3 {
  animation-delay: 120ms;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

/* Reduced motion means gentler, not none: opacity still carries meaning, and
 * removing it entirely would make states change with no cue at all. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 120ms !important;
  }

  .rise {
    animation: none;
  }

  .readback__result[data-entering="true"] {
    clip-path: none;
  }

  .btn:active,
  .choice__face:active {
    transform: none;
  }
}
