/* AMSCA 2026 registration.
   Mobile first. The registrant is most likely standing up, on a phone, on a
   duty day, with one hand free. Everything below serves completion. */

:root {
  color-scheme: light dark;

  /* AMEDD maroon against warm paper and ink.
     Two distinct roles, because they move in opposite directions between
     themes. --maroon is the accent ON paper: it must lighten in dark mode to
     stay legible. --brand-* are maroon AS a surface, carrying --on-brand text:
     those must stay dark in both themes or the masthead ends up near-white on
     pink. Collapsing the two is how that bug happens. */
  --maroon: #6b1d2c;
  --maroon-deep: #4e131f;
  --maroon-tint: #f3e6e8;

  --brand-deep: #4e131f;
  --brand-solid: #6b1d2c;
  --brand-solid-hover: #4e131f;
  --on-brand: #fdf6f7;

  --ink: #17181c;
  --ink-soft: #4a4d57;
  --ink-faint: #676c78;

  --paper: #faf8f6;
  --surface: #ffffff;
  --line: #ddd8d2;
  --line-strong: #bdb6ae;

  --good: #1f6a4d;
  --good-tint: #e6f2ec;
  --bad: #97241d;
  --bad-tint: #fbeae8;

  --focus: #1b5fa8;

  --phone-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");

  --radius: 10px;
  --radius-sm: 6px;

  --shadow-sm: 0 1px 2px rgba(23, 24, 28, 0.06), 0 2px 6px rgba(23, 24, 28, 0.05);
  --shadow-md: 0 2px 4px rgba(23, 24, 28, 0.06), 0 8px 24px rgba(23, 24, 28, 0.08);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  /* System serif, deliberately. A third-party font host is render-blocking on
     the critical path, its swap was reflowing the whole page, and .mil networks
     commonly block fonts.googleapis.com outright - which would have left this
     audience waiting on a request that never returns. */
  --serif: ui-serif, Georgia, Cambria, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --maroon: #d2798a;
    --maroon-deep: #e5a3af;
    --maroon-tint: #2c1a1f;

    /* Brand surfaces stay dark; only the accent inverts. */
    --brand-deep: #3d1019;
    --brand-solid: #8c2e40;
    --brand-solid-hover: #a3374c;
    --on-brand: #fdf6f7;

    --ink: #eceaf0;
    --ink-soft: #b3b0bb;
    --ink-faint: #8b8894;

    --paper: #16171b;
    --surface: #1d1f24;
    --line: #33353d;
    --line-strong: #4a4d57;

    --good: #6cc39c;
    --good-tint: #17251f;
    --bad: #f08a80;
    --bad-tint: #2a1917;

    --focus: #74aeef;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  /* Old-style numerals look wrong in prices and dates. */
  font-variant-numeric: tabular-nums;
}

/* Browser surfaces belong to the design too. */
::selection {
  background: var(--brand-solid);
  color: var(--on-brand);
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

a {
  color: var(--maroon);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--maroon-deep);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.011em;
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
}

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

.masthead {
  background: var(--brand-deep);
  color: var(--on-brand);
  padding: 1.25rem 1.25rem 1.4rem;
}

.masthead__inner,
.shell {
  margin-inline: auto;
  max-width: 40rem;
}

.masthead__brand {
  align-items: center;
  display: flex;
  gap: 0.7rem;
}

.masthead__mark {
  display: block;
  flex: none;
  /* The official seal carries ring text and a caduceus. The flat mark it
     replaced read fine at 2.5rem; this one needs the room to be a medallion
     rather than a smudge. */
  height: 3.5rem;
  width: 3.5rem;

  /* The seal is drawn for a white field: its deep red interior measures 1.12:1
     against this masthead, so on bare maroon it dissolves and leaves the silver
     rim floating. The light disc is the standard treatment for a seal on a dark
     header, and gives it back the background it was designed for. */
  background: var(--on-brand);
  border-radius: 50%;
  padding: 0.2rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 3px 10px rgba(0, 0, 0, 0.18);
}

.masthead__mark img {
  display: block;
  height: 100%;
  width: 100%;
}

.masthead__org {
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  margin: 0;
  opacity: 0.82;
  text-transform: uppercase;
}

.masthead__title {
  color: var(--on-brand);
  font-size: 1.35rem;
  margin: 0;
}

.masthead__facts {
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0.85rem 0 0;
}

.masthead__facts li {
  font-size: 0.9rem;
  opacity: 0.93;
}

.shell {
  padding: 1.5rem 1.25rem 4rem;
}

/* ------------------------------------------------------------------- forms */

fieldset {
  border: none;
  margin: 0 0 2rem;
  padding: 0;
}

legend {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.011em;
  margin-bottom: 0.15rem;
  padding: 0;
}

.hint {
  color: var(--ink-soft);
  font-size: 0.875rem;
  margin: 0 0 1rem;
}

.field {
  margin-bottom: 1.1rem;
}

.field > label,
.field__label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.field__optional {
  color: var(--ink-faint);
  font-weight: 400;
}

input[type='text'],
input[type='email'],
select {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  /* 16px minimum, or iOS zooms the page on focus. */
  font-size: 1rem;
  min-height: 2.85rem;
  padding: 0.55rem 0.7rem;
  width: 100%;
}

select {
  /* Authored chevron: a unicode arrow would be a glyph standing in for an icon. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236f7480' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5 8 10.5 12 6.5'/%3E%3C/svg%3E");
  background-position: right 0.65rem center;
  background-repeat: no-repeat;
  background-size: 1rem;
  padding-right: 2.4rem;
}

@media (prefers-color-scheme: dark) {
  select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238b8894' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5 8 10.5 12 6.5'/%3E%3C/svg%3E");
  }
}

input:hover,
select:hover {
  border-color: var(--ink-faint);
}

input[aria-invalid='true'],
select[aria-invalid='true'] {
  border-color: var(--bad);
  border-width: 2px;
}

.error {
  color: var(--bad);
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.3rem;
}

.error:empty {
  display: none;
}

/* --------------------------------------------------------- tier radio cards */

.tiers {
  display: grid;
  gap: 0.6rem;
}

.tier {
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  display: grid;
  gap: 0 0.75rem;
  grid-template-columns: auto 1fr auto;
  padding: 0.85rem 0.9rem;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.tier:hover {
  border-color: var(--ink-faint);
}

.tier:has(input:checked) {
  background: var(--maroon-tint);
  border-color: var(--maroon);
  box-shadow: inset 0 0 0 1px var(--maroon);
}

.tier:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.tier input {
  accent-color: var(--maroon);
  height: 1.15rem;
  margin: 0.2rem 0 0;
  width: 1.15rem;
}

.tier__name {
  font-weight: 600;
}

.tier__when {
  color: var(--ink-soft);
  font-size: 0.875rem;
  grid-column: 2;
}

.tier__price {
  font-weight: 600;
  grid-row: 1;
  text-align: right;
  white-space: nowrap;
}

.tier__price[data-free='true'] {
  color: var(--good);
}

/* ------------------------------------------------------------- attestation */

.attest {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  margin-top: 1rem;
  padding: 0.9rem;
}

.attest[hidden] {
  display: none;
}

.attest__row {
  align-items: flex-start;
  cursor: pointer;
  display: flex;
  gap: 0.7rem;
}

.attest input[type="checkbox"] {
  accent-color: var(--maroon);
  flex: none;
  height: 1.15rem;
  margin: 0.2rem 0 0;
  width: 1.15rem;
}

/* A text field inside an attest box (the Luau guest's name) is a normal
   full-width input, not a checkbox-sized sliver. */
.attest .field {
  margin-top: 0.8rem;
}

.attest .field input[type="text"] {
  display: block;
  width: 100%;
  min-height: 2.6rem;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink, #1f1a17);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.attest .field input[type="text"]:focus {
  outline: 2px solid var(--maroon);
  outline-offset: 1px;
}

.attest__text {
  font-size: 0.925rem;
}

.attest__note {
  color: var(--ink-soft);
  font-size: 0.825rem;
  margin: 0.5rem 0 0 1.85rem;
}

/* ----------------------------------------------------------------- summary */

.summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
}

.summary__row {
  align-items: baseline;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.summary__label {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.summary__amount {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.summary__amount[data-free='true'] {
  color: var(--good);
  font-size: 1.5rem;
}

.summary__breakdown {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 0.15rem 0 0;
}

.summary__breakdown:empty {
  display: none;
}

.summary__why {
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.875rem;
  margin: 0.75rem 0 0;
  padding-top: 0.75rem;
}

.summary__why:empty {
  display: none;
}

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

.button {
  background: var(--brand-solid);
  border: 1px solid var(--brand-solid);
  border-radius: var(--radius-sm);
  color: var(--on-brand);
  cursor: pointer;
  display: block;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  min-height: 3rem;
  padding: 0.75rem 1.25rem;
  transition: background-color 0.12s ease;
  width: 100%;
}

.button:hover:not(:disabled) {
  background: var(--brand-solid-hover);
  border-color: var(--brand-solid-hover);
}

.button:disabled {
  cursor: progress;
  opacity: 0.62;
}

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

.notice {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 0.925rem;
  margin-bottom: 1.5rem;
  padding: 0.85rem 1rem;
}

.notice--info {
  background: var(--maroon-tint);
  border-color: var(--maroon);
}

.notice--bad {
  background: var(--bad-tint);
  border-color: var(--bad);
  color: var(--ink);
}

.notice[hidden] {
  display: none;
}

.notice p {
  margin: 0;
}

/* ----------------------------------------------------------------- success */

.done {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.75rem 1.35rem;
  text-align: center;
}

.done__eyebrow {
  color: var(--good);
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.done__title {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.done__idlabel {
  color: var(--ink-soft);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  margin: 0 0 0.2rem;
  text-transform: uppercase;
}

.done__id {
  background: var(--maroon-tint);
  border: 1px solid var(--maroon);
  border-radius: var(--radius-sm);
  display: inline-block;
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.5rem 1rem;
}

.done__amount {
  font-size: 1.05rem;
  margin: 1rem 0;
}

.done__amount strong {
  font-family: var(--serif);
  font-size: 1.35rem;
}

/* The pay control is an anchor; give it the button's full presentation. */
a.button {
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
}

.done__body {
  margin: 1.25rem 0 0;
  text-align: left;
}

.done__body dt {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin-top: 0.9rem;
}

.done__body dd {
  margin: 0.1rem 0 0;
}

.done[hidden],
.form[hidden] {
  display: none;
}

/* ------------------------------------------------------------------- panel */

.masthead__jump {
  color: inherit;
  text-decoration-color: rgba(255, 255, 255, 0.55);
}

.masthead__jump:hover {
  color: inherit;
  text-decoration-color: currentColor;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-top: 2.5rem;
  padding: 1.35rem 1.25rem 1.5rem;
  /* Anchored from the masthead, so keep the heading clear of a sticky bar and
     of the very top edge when jumped to. */
  scroll-margin-top: 1rem;
}

.panel__title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.panel__lede {
  color: var(--ink);
  margin: 0 0 1.1rem;
}

.panel__facts {
  display: grid;
  gap: 0.85rem;
  margin: 0 0 1.25rem;
}

.panel__facts dt {
  color: var(--ink-soft);
  font-size: 0.8rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.panel__facts dd {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0.15rem 0 0;
}

.button--secondary {
  background: transparent;
  border: 2px solid var(--brand-solid);
  color: var(--maroon);
  text-align: center;
  text-decoration: none;
}

.button--secondary:hover:not(:disabled) {
  background: var(--maroon-tint);
  border-color: var(--brand-solid);
  color: var(--maroon-deep);
}

.button--secondary[hidden] {
  display: none;
}

.callout {
  background: var(--maroon-tint);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  padding: 0.9rem 1rem 1rem;
}

.callout[hidden] {
  display: none;
}

.callout__lede {
  color: var(--ink);
  font-size: 0.925rem;
  margin: 0 0 0.7rem;
}

/* The number is a control, not a footnote: at the point someone reaches for it
   they are usually already holding the phone. */
.callout__tel {
  align-items: center;
  display: flex;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  gap: 0.5rem;
  letter-spacing: 0.01em;
  min-height: 2.75rem;
  text-decoration: none;
}

.callout__tel::before {
  background: currentColor;
  content: '';
  flex: none;
  height: 1.1rem;
  width: 1.1rem;
  /* Authored handset, masked from currentColor so it inherits link and hover. */
  -webkit-mask: var(--phone-icon) center / contain no-repeat;
  mask: var(--phone-icon) center / contain no-repeat;
}

.callout__tel:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.panel__note {
  color: var(--ink-soft);
  font-size: 0.875rem;
  margin: 1rem 0 0;
}

@media (min-width: 34rem) {
  .panel {
    padding: 1.75rem 1.75rem 1.9rem;
  }

  .panel__facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ------------------------------------------------------------------- prose */

.prose {
  max-width: 34rem;
}

.prose h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.5rem;
}

.prose p {
  margin: 0 0 1rem;
}

.footnote {
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.875rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
}

.footnote p {
  margin: 0 0 0.5rem;
}

/* A button that reads as a link, for actions that live in running text. */
.linklike {
  background: none;
  border: none;
  color: var(--maroon);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.linklike:hover {
  color: var(--maroon-deep);
}

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

.spinner {
  animation: spin 0.7s linear infinite;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-right-color: transparent;
  display: inline-block;
  height: 0.85em;
  margin-right: 0.45em;
  vertical-align: -0.08em;
  width: 0.85em;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Roomier once there is room; the phone case stays the default. */
@media (min-width: 34rem) {
  .masthead {
    padding: 1.75rem 2rem 1.9rem;
  }

  .masthead__mark {
    height: 4.25rem;
    width: 4.25rem;
  }

  .masthead__title {
    font-size: 1.6rem;
  }

  .shell {
    padding: 2.25rem 2rem 4rem;
  }

  .done {
    padding: 2.25rem 2rem;
  }
}
