/* AccsPremium order page. Colours come from the logo: navy running into blue. */

@font-face {
  font-family: "Nunito";
  src: url("fonts/nunito-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy-deep: #17234f;
  --navy: #2c427e;
  --blue: #248dc6;
  --blue-dark: #1c7aa8;
  --blue-soft: rgba(36, 141, 198, 0.1);
  --blue-ring: rgba(36, 141, 198, 0.25);

  --ground: #f3f6fb;
  --card: #ffffff;
  --well: #f8fafc;
  --line: #dee2e6;
  --ink: #212529;
  --text: #495057;
  --muted: #5b6370;

  --ok-bg: #f0fdf4;
  --ok-line: #bbf7d0;
  --ok-text: #166534;
  --wait-bg: #fffbeb;
  --wait-line: #fde68a;
  --wait-text: #92400e;
  --bad-bg: #fff5f5;
  --bad-line: #fecaca;
  --bad-text: #991b1b;

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

  --radius: 6px;
  --radius-card: 10px;
  --shadow-card: 0 4px 16px rgba(23, 35, 79, 0.1);
  --shadow-blue: 0 2px 8px rgba(36, 141, 198, 0.25);

  --page: min(100% - 2.5rem, 47rem);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--blue-dark);
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--blue-ring);
}

.offscreen {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.quiet {
  color: var(--muted);
}

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

.site-head {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: var(--page);
  margin-inline: auto;
  padding-block: 0.85rem;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 42px;
  height: 42px;
}

/* The name is set in type, not in a picture: "Accs" in the logo's navy, "Premium" in its blue. */
.wordmark {
  color: var(--navy);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1;
}

.wordmark b {
  color: var(--blue);
  font-weight: 800;
}

/* ------------------------------------------------------------ hero with the lookup */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(120deg, var(--navy-deep) 0%, var(--navy) 58%, #2a6fae 100%);
}

/* Faint grid, fading out towards the edges, and one soft glow behind the lookup. */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
}

.hero::after {
  background: radial-gradient(38rem 22rem at 85% 110%, rgba(36, 141, 198, 0.55), transparent 70%);
}

.hero-inner {
  width: var(--page);
  margin-inline: auto;
}

.lookup {
  padding-block: clamp(2.5rem, 9vh, 5rem) clamp(4rem, 12vh, 6.5rem);
  transition: padding-block 240ms ease;
}

body[data-view="order"] .lookup {
  padding-block: 1.75rem 4.75rem;
}

.lookup h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 1.3rem + 3.2vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

body[data-view="order"] .lookup h1 {
  font-size: 1.5rem;
}

.lead {
  margin: 0.85rem 0 1.75rem;
  max-width: 34rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.125rem;
  line-height: 1.45;
}

body[data-view="order"] .lead {
  display: none;
}

body[data-view="order"] .lookup-row {
  margin-top: 1rem;
}

/* One white bar holding the field and its button. */
.lookup-row {
  display: flex;
  gap: 0.375rem;
  max-width: 38rem;
  padding: 0.375rem;
  border-radius: calc(var(--radius) + 2px);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.2s ease;
}

.lookup-row:focus-within {
  box-shadow: 0 12px 48px rgba(36, 141, 198, 0.4), 0 0 0 2px var(--blue);
}

#order-id {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.75rem 0.85rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.95rem;
}

#order-id::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

#order-id:focus-visible {
  box-shadow: none;
}

.lookup-hint {
  min-height: 1.5rem;
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

.lookup-hint[data-kind="error"] {
  display: inline-block;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--bad-line);
  border-radius: var(--radius);
  background: var(--bad-bg);
  color: var(--bad-text);
  font-weight: 600;
}

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

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, border-color 0.2s ease;
}

.button:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue-dark);
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow-blue);
}

.button.primary:hover:not(:disabled) {
  color: #fff;
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(36, 141, 198, 0.35);
}

.button.plain {
  border-color: transparent;
  background: transparent;
  color: var(--blue-dark);
  padding-inline: 0.6rem;
}

.button.plain:hover:not(:disabled) {
  border-color: transparent;
  background: var(--blue-soft);
}

.button.small {
  flex: none;
  padding: 0.3rem 0.7rem;
  font-size: 0.8125rem;
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.lookup-row .button {
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
}

/* ------------------------------------------------------------ page body */

main {
  flex: 1;
  width: var(--page);
  margin-inline: auto;
}

/* The order card sits over the lower edge of the hero. */
.slip {
  position: relative;
  margin-top: -3.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.slip:focus-visible {
  box-shadow: var(--shadow-card);
}

.slip[aria-busy="true"] {
  opacity: 0.6;
}

.slip-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem 2rem;
  padding: 1.5rem 1.75rem;
}

.product {
  display: flex;
  gap: 1rem;
  align-items: center;
  min-width: 0;
}

.product h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
}

.order-id {
  margin: 0.25rem 0 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.facts {
  display: flex;
  gap: 0.75rem;
  margin: 0;
}

.facts > div {
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--well);
}

.facts dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.facts dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.facts dd .quiet {
  font-weight: 500;
}

.notices {
  display: grid;
  gap: 0.6rem;
  padding: 0 1.75rem 1.5rem;
}

.notice {
  margin: 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--well);
  color: var(--ink);
  font-weight: 600;
}

.notice[data-tone="waiting"] {
  border-color: var(--wait-line);
  background: var(--wait-bg);
  color: var(--wait-text);
}

.notice[data-tone="done"] {
  border-color: var(--ok-line);
  background: var(--ok-bg);
  color: var(--ok-text);
}

.notice[data-tone="problem"] {
  border-color: var(--bad-line);
  background: var(--bad-bg);
  color: var(--bad-text);
}

main > noscript .notice {
  margin-top: 1.5rem;
}

.how-to {
  margin: 0 1.75rem 1.5rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  background: var(--blue-soft);
}

.how-to summary {
  width: fit-content;
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
  border-radius: 4px;
}

.how-to-body {
  max-width: 38rem;
  margin-top: 0.6rem;
  overflow-wrap: anywhere;
}

.how-to-body :where(p, ul, ol, h3, h4, h5) {
  margin: 0 0 0.6rem;
}

.how-to-body > :last-child {
  margin-bottom: 0;
}

.how-to-body :where(h3, h4, h5) {
  font-size: 1rem;
  color: var(--ink);
}

.tear {
  height: 0;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------ delivered items */

.items {
  padding: 1.5rem 1.75rem 1.75rem;
}

.items-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1rem;
}

.items-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 700;
}

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

.select-help,
.replacement-reason,
.empty {
  margin: 0.75rem 0 0;
  max-width: 38rem;
}

.select-help {
  color: var(--ink);
  font-weight: 600;
}

.item-list {
  list-style: none;
  display: grid;
  gap: 0.75rem;
  margin: 1.1rem 0 0;
  padding: 0;
}

.item {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  align-items: start;
  gap: 0.5rem 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.item.solo {
  grid-template-columns: minmax(0, 1fr);
}

.item.solo .item-state {
  grid-column: 1;
}

.item:hover,
.item:focus-within {
  border-color: rgba(36, 141, 198, 0.45);
  box-shadow: 0 2px 10px rgba(36, 141, 198, 0.1);
}

.item-number {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pick {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
}

.pick input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--blue);
  cursor: pointer;
}

.fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.75rem;
  min-width: 0;
}

.field {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.field.wide {
  flex: 1 1 100%;
}

.label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.value {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
  text-align: left;
}

span.value {
  padding: 0.3rem 0;
  font-family: var(--sans);
  font-weight: 600;
}

a.value {
  color: var(--blue-dark);
  font-family: var(--sans);
  font-weight: 700;
}

.value-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.copyable {
  appearance: none;
  margin: 0;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--well);
  cursor: copy;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.copyable:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.copyable:active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.value.clipped {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-help {
  font-size: 0.8125rem;
  max-width: 36rem;
}

.item-state {
  grid-column: 2;
  justify-self: start;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--wait-line);
  border-radius: 4px;
  background: var(--wait-bg);
  color: var(--wait-text);
  font-size: 0.75rem;
  font-weight: 700;
}

/* ------------------------------------------------------------ before an order is shown */

.assurances {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin: -2.5rem 0 0;
  padding: 0;
  position: relative;
}

body[data-view="order"] .assurances {
  display: none;
}

.assurances li {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-card);
  font-size: 0.875rem;
}

.assurances strong {
  color: var(--navy);
  font-size: 1rem;
  font-weight: 700;
}

/* ------------------------------------------------------------ footer, toast */

.site-foot {
  width: var(--page);
  margin-inline: auto;
  padding-block: 2.5rem 2rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.site-foot p {
  margin: 0 0 0.35rem;
}

.copyright {
  font-size: 0.8125rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 0.75rem);
  max-width: calc(100% - 2rem);
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius);
  background: var(--navy-deep);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(23, 35, 79, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.toast[data-show="true"] {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------------------------------------ small screens, motion, print */

@media (max-width: 40rem) {
  .assurances {
    grid-template-columns: 1fr;
  }

  .lookup-row {
    flex-direction: column;
  }

  .slip-head,
  .items {
    padding-inline: 1.1rem;
  }


  .notices {
    padding-inline: 1.1rem;
  }

  .how-to {
    margin-inline: 1.1rem;
  }

  .facts {
    flex-wrap: wrap;
  }

  .item {
    grid-template-columns: 1.9rem minmax(0, 1fr);
    padding: 0.9rem;
  }
}

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

@media print {
  .hero,
  .site-foot,
  .actions,
  .assurances,
  .toast {
    display: none;
  }

  body {
    background: #fff;
  }

  .slip {
    margin-top: 1rem;
    box-shadow: none;
  }
}
