/* VP Health — shared styles for index.html and payment.html */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-hyperlegible-next.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  src: url("fonts/atkinson-hyperlegible-mono.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --navy: #0a2364;
  --navy-deep: #07194a;
  --black: #060709;
  --paper: #ffffff;
  --wash: #f1f3f8;
  --rule: #ccd2de;
  --edge: #5c657a;
  --muted: #474f66;
  --on-navy-soft: #d3dbee;
  --on-black-soft: #b9bdc9;
  --error: #a1161b;
  --error-wash: #fdf3f3;
  --ok: #135c37;

  --sans: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(1.25rem, 5vw, 3.5rem);
  --max: 70rem;
  --radius: 2px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--black);
  font: 400 1.125rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--navy);
  color: #fff;
}

.on-dark ::selection {
  background: #fff;
  color: var(--navy);
}

h1,
h2,
h3,
p,
dl,
dd,
ul {
  margin: 0;
}

a {
  color: var(--navy);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.15s var(--ease);
}

a:hover {
  color: var(--black);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
}

.on-dark a:not(.btn):hover {
  color: #fff;
}

.on-dark :focus-visible {
  outline-color: #fff;
}

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--black);
  color: #fff;
  font-weight: 600;
}

.skip:focus {
  top: 0.75rem;
  color: #fff;
}

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

/* ---------- Masthead ---------- */

.masthead {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  display: block;
  width: auto;
  height: 3rem;
}

.masthead nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
}

.navlink {
  color: var(--black);
  font-weight: 500;
  text-decoration: none;
}

.navlink:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 3.25rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--navy);
  border-radius: var(--radius);
  background: var(--navy);
  color: #fff;
  font: 600 1.0625rem/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.btn:hover {
  background: var(--black);
  border-color: var(--black);
  color: #fff;
}

.btn:active {
  transform: translateY(1px);
}

.btn svg {
  flex: none;
  transition: transform 0.25s var(--ease);
}

.btn:hover svg.arrow {
  transform: translateX(3px);
}

.btn--small {
  min-height: 2.75rem;
  padding: 0.5rem 1.125rem;
  font-size: 1rem;
}

.btn--light {
  border-color: #fff;
  background: #fff;
  color: var(--navy);
}

.btn--light:hover {
  border-color: var(--on-navy-soft);
  background: var(--on-navy-soft);
  color: var(--navy-deep);
}

.btn--outline {
  background: var(--paper);
  color: var(--navy);
}

.btn[disabled] {
  border-color: var(--rule);
  background: var(--wash);
  color: var(--muted);
  cursor: progress;
  transform: none;
}

/* ---------- Opening field (navy) ---------- */

.opening__field {
  background: var(--navy);
  color: #fff;
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 7vw, 5.5rem);
}

.opening h1 {
  max-width: 17ch;
  font-size: clamp(2.5rem, 1.1rem + 5.6vw, 4.75rem);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.03;
  text-wrap: balance;
}

.opening .lede {
  max-width: 46ch;
  margin-top: 1.5rem;
  color: var(--on-navy-soft);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
  line-height: 1.5;
}

.opening .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2.25rem;
}

.opening .actions a:not(.btn) {
  color: #fff;
}

.opening--slim .opening__field {
  padding-block: clamp(2.5rem, 6vw, 4rem);
}

.opening--slim h1 {
  max-width: none;
  font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.5rem);
}

.opening--slim .lede {
  margin-top: 1rem;
}

/* The identity strip sits on the lower edge of the navy field. */
.opening__edge {
  background: linear-gradient(to bottom, var(--navy) 50%, var(--paper) 50%);
}

.idstrip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.6fr;
  border: 1px solid var(--black);
  background: var(--paper);
  color: var(--black);
}

.idstrip > div {
  padding: 1.25rem 1.5rem 1.375rem;
  border-left: 1px solid var(--rule);
}

.idstrip > div:first-child {
  border-left: 0;
}

.idstrip dt {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.3;
}

.idstrip dd {
  margin-top: 0.25rem;
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.3;
}

.idstrip dd span {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .idstrip {
    animation: settle 0.9s var(--ease) 0.1s both;
  }

  @keyframes settle {
    from {
      opacity: 0;
      transform: translateY(1rem);
    }
  }
}

/* ---------- About ---------- */

.about {
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(4rem, 9vw, 7rem);
  scroll-margin-top: 1rem;
}

.about h2 {
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.rows > section {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 0.75rem clamp(1.5rem, 5vw, 4rem);
  padding-block: clamp(1.75rem, 3.5vw, 2.5rem);
  border-top: 1px solid var(--rule);
}

.rows > section:first-child {
  border-top-color: var(--black);
}

.rows > section:last-child {
  padding-bottom: 0;
}

.rows h3 {
  font-size: 1.3125rem;
  font-weight: 650;
  letter-spacing: -0.005em;
  line-height: 1.25;
}

.rows p {
  max-width: 62ch;
}

.rows p + p {
  margin-top: 1em;
}

.places {
  max-width: 62ch;
  margin-top: 1.25rem;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--rule);
}

.places li {
  padding-block: 0.75rem;
  border-top: 1px solid var(--rule);
  font-weight: 650;
}

/* ---------- Closing band and footer (black) ---------- */

.closing {
  background: var(--black);
  color: #fff;
}

.closing .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.75rem 3rem;
  padding-block: clamp(3.5rem, 8vw, 5.5rem);
}

.closing h2 {
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.closing p {
  max-width: 44ch;
  margin-top: 0.75rem;
  color: var(--on-black-soft);
}

.colophon {
  background: var(--black);
  color: var(--on-black-soft);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.colophon .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 3rem;
  padding-block: 2rem 2.25rem;
}

.colophon img {
  display: block;
  width: auto;
  height: 2.375rem;
}

.closing + .colophon .wrap {
  border-top: 1px solid #2b2e39;
}

.colophon p {
  max-width: 60ch;
}

.colophon a {
  color: #fff;
}

/* ---------- Payment page ---------- */

.pay {
  display: grid;
  grid-template-columns: minmax(0, 36rem) minmax(0, 21rem);
  align-items: start;
  justify-content: space-between;
  gap: 3rem clamp(2rem, 6vw, 5rem);
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(4rem, 9vw, 6rem);
}

.group {
  margin-bottom: 2.75rem;
}

.group > h2 {
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--black);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.field {
  margin-bottom: 1.5rem;
}

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

.field label {
  display: block;
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.35;
}

.optional {
  color: var(--muted);
  font-weight: 400;
}

.hint {
  display: block;
  margin-top: 0.125rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.control {
  display: block;
  width: 100%;
  min-height: 3.25rem;
  margin-top: 0.5rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--black);
  font: 400 1.125rem/1.3 var(--sans);
  caret-color: var(--navy);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.control::placeholder {
  color: var(--edge);
  opacity: 1;
}

.control:hover {
  border-color: var(--black);
}

.control:focus-visible {
  border-color: var(--navy);
  outline-offset: 1px;
}

.control[aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: inset 0 0 0 1px var(--error);
}

.control--id {
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.money {
  position: relative;
  max-width: 16rem;
}

.money .prefix {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  color: var(--muted);
  font: 600 1.5rem/1 var(--mono);
  transform: translateY(-50%);
  pointer-events: none;
}

.money .control {
  min-height: 4rem;
  padding-left: 2.375rem;
  font: 600 1.5rem/1.2 var(--mono);
  font-variant-numeric: tabular-nums;
}

.error {
  margin-top: 0.5rem;
  color: var(--error);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.45;
}

.alert {
  margin-bottom: 2rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--error);
  border-radius: var(--radius);
  background: var(--error-wash);
  color: #7a1014;
  font-weight: 500;
  line-height: 1.5;
}

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

[hidden] {
  display: none !important;
}

/* Honeypot: real people never see or fill this. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

#card-container:empty {
  display: none;
}

.card-status {
  margin-top: 0.5rem;
  padding: 1rem 1.125rem;
  border: 1px dashed var(--edge);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.card-status[data-state="failed"] {
  border: 1px solid var(--error);
  background: var(--error-wash);
  color: #7a1014;
}

.note {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-top: 0.875rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.note svg {
  flex: none;
  margin-top: 0.1875rem;
  color: var(--navy);
}

.btn--pay {
  width: 100%;
  min-height: 3.75rem;
  font-size: 1.1875rem;
  font-variant-numeric: tabular-nums;
}

.spinner {
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.after-pay {
  margin-top: 0.875rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Help column */

.help h2 {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--black);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.help dl > div {
  padding-block: 1.125rem;
  border-bottom: 1px solid var(--rule);
}

.help dt {
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.35;
}

.help dd {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

/* Receipt */

.receipt h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.receipt h2:focus {
  outline: none;
}

.receipt h2 svg {
  flex: none;
  color: var(--ok);
}

.receipt > p {
  max-width: 46ch;
  margin-top: 0.75rem;
}

.receipt dl {
  margin-top: 2rem;
  border: 1px solid var(--black);
}

.receipt dl > div {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  gap: 0.25rem 1.5rem;
  padding: 0.9375rem 1.25rem;
  border-top: 1px solid var(--rule);
}

.receipt dl > div:first-child {
  border-top: 0;
}

.receipt dt {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.receipt dd {
  font-weight: 650;
  overflow-wrap: anywhere;
}

.receipt dd.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.receipt dd#r-id {
  font-size: 0.9375rem;
  letter-spacing: 0;
  line-height: 1.8;
}

.receipt .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2rem;
}

@media (prefers-reduced-motion: no-preference) {
  .receipt {
    animation: settle 0.7s var(--ease) both;
  }
}

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

@media (max-width: 60rem) {
  .pay {
    grid-template-columns: minmax(0, 36rem);
    justify-content: start;
  }
}

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

  .idstrip > div:nth-child(3) {
    border-left: 0;
  }

  .idstrip > div:nth-child(n + 3) {
    border-top: 1px solid var(--rule);
  }

  .rows > section {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 30rem) {
  body {
    font-size: 1.0625rem;
  }

  .masthead .wrap {
    min-height: 4.25rem;
  }

  .masthead .navlink--extra {
    display: none;
  }

  .brand img {
    height: 2.5rem;
  }

  .idstrip {
    grid-template-columns: 1fr;
  }

  .idstrip > div {
    padding: 1rem 1.125rem 1.125rem;
    border-left: 0;
  }

  .idstrip > div + div {
    border-top: 1px solid var(--rule);
  }

  .receipt dl > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .opening .actions .btn,
  .closing .btn {
    width: 100%;
  }
}

/* ---------- Print (receipt) ---------- */

@media print {
  .masthead nav,
  .closing,
  .help,
  .receipt .actions,
  .skip {
    display: none !important;
  }

  .opening__field {
    padding-block: 1.5rem;
    background: none;
    color: #000;
  }

  .opening .lede {
    color: #000;
  }

  .colophon {
    background: none;
    color: #000;
  }

  .pay {
    padding-block: 1rem;
  }
}
