:root {
  color-scheme: light;
  /* Brand accents from humanoidrobot.club (navy, gold, peach) on a light, clean base. */
  --navy: #000080;
  --gold: #ffbd59;
  --paper: #f7f7fb;
  --surface: #ffffff;
  --ink: #16163a;
  --muted: #5a5870;
  --line: #e3e3ee;
  --ok: #1f6a45;
  --ok-soft: #e6f3ea;
  --error: #b0232a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 Poppins, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

main, .club {
  max-width: 44rem;
  margin-inline: auto;
  padding-inline: 1rem;
}
main:focus { outline: none; }

.masthead {
  margin: 0 0 1.5rem;
  padding: 1.5rem 0 1.25rem;
  border-bottom: 4px solid var(--gold);
}
.club { display: flex; align-items: center; gap: 0.6rem; padding-top: 1.5rem; color: var(--navy); font-weight: 600; font-size: 1.05rem; }
.club img { border-radius: 50%; }
h1 { margin: 0 0 0.75rem; font-size: clamp(1.9rem, 7vw, 2.75rem); font-weight: 600; line-height: 1.12; letter-spacing: -0.015em; color: var(--navy); }
.lede { margin: 0 0 0.75rem; max-width: 36em; color: var(--muted); }

section {
  margin: 0 0 1rem;
  padding: 1.25rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  scroll-margin-top: 1rem;
}
@media (min-width: 40rem) { section { padding: 1.5rem; } }

h2 {
  color: var(--navy);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem;
  font-size: 1.25rem;
  line-height: 1.2;
}
.step {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.grid { display: grid; gap: 0 1rem; }
@media (min-width: 34rem) {
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.city-row { grid-template-columns: 1.4fr 1fr 0.8fr; }
}
.field { margin: 0 0 1rem; min-width: 0; }
label { display: block; margin: 0 0 0.3rem; font-weight: 600; font-size: 0.95rem; }
.optional { color: var(--muted); font-weight: 400; }
.help { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.9rem; }
section > .help { margin: -0.4rem 0 1rem; }

input, select {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
input::placeholder { color: var(--muted); opacity: 0.7; }
input:focus-visible, select:focus-visible, .button:focus-visible, .link-button:focus-visible,
.visually-hidden:focus-visible + .button {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

fieldset { margin: 0.5rem 0 0; padding: 1rem 0 0; border: 0; border-top: 1px dashed var(--line); }
legend { padding: 0; margin-bottom: 1rem; font-weight: 600; font-size: 1.05rem; }

.note {
  margin: 0.25rem 0 0;
  padding: 0.7rem 0.9rem;
  border-radius: 9px;
  background: var(--ok-soft);
  color: var(--ok);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.6rem 1.1rem;
  border: 0;
  border-radius: 9px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.button.primary { background: var(--gold); color: var(--navy); border: 1.5px solid var(--navy); }
.button.secondary { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.button:disabled { opacity: 0.55; cursor: progress; }
.link-button {
  padding: 0.35rem 0.2rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.pdf-help { margin: 0 0 1rem; font-size: 0.92rem; }
.pdf-help summary { cursor: pointer; color: var(--navy); font-weight: 600; }
.pdf-help p { margin: 0.4rem 0 0; color: var(--muted); }

.file-errors { margin: 0.75rem 0 0; padding: 0; list-style: none; color: var(--error); font-size: 0.95rem; }
.file-errors:empty { display: none; }

.receipt-list { margin: 0; padding: 0; list-style: none; }
.receipt { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 0.75rem; padding: 0.5rem 0.9rem; border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 10px; }
.receipt-name { min-width: 0; overflow-wrap: anywhere; }
.file-name { color: var(--muted); font-size: 0.9rem; }
.receipt.uploading { border-left-color: var(--gold); }
.receipt.failed { border-left-color: var(--error); }
.receipt-status { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; color: var(--muted); }
.receipt-status.ok { color: var(--ok); font-weight: 600; }
.receipt-status.failed { color: var(--error); font-weight: 600; }
.receipt-status progress { flex: 1; max-width: 12rem; height: 0.5rem; accent-color: var(--navy); }
.receipt-actions { display: flex; flex: none; gap: 0.5rem; }
.link-button.retry { color: var(--navy); font-weight: 600; }

.total-field input { max-width: 14rem; font-variant-numeric: tabular-nums; }

.submit-error { margin: 0.5rem 0 0; padding: 0 0 2rem; color: var(--error); font-weight: 600; }
.submit-error:empty { display: none; }

.turnstile:empty { display: none; }
.turnstile { margin: 0 0 1rem; }
#session-status:empty { display: none; }

/* Total stays next to the send button. */
.totalbar {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem -1rem 0;
  padding: 0.8rem 1rem calc(0.8rem + env(safe-area-inset-bottom));
  background: var(--surface);
  color: var(--navy);
  border-top: 3px solid var(--gold);
  box-shadow: 0 -6px 16px rgb(0 0 128 / 0.06);
}
@media (min-width: 46rem) { .totalbar { margin: 1.5rem 0 0; border-radius: 14px; bottom: 1rem; } }
.total { display: grid; line-height: 1.1; }
.total-label { font-size: 0.85rem; color: var(--muted); }
.total-amount { font-size: clamp(1.75rem, 7vw, 2.25rem); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

#done-view .masthead { padding-bottom: 2rem; border-bottom: 0; }
#done-view .button { margin-top: 1rem; }

/* Desktop: use the width. Details and receipts side by side. */
@media (min-width: 64rem) {
  main, .club { max-width: 76rem; padding-inline: 2rem; }
  .lede { max-width: 48em; }
  #form { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1.25rem; align-items: start; }
  #form > * { grid-column: 1 / -1; }
  #form > #details { grid-column: 1; }
  #form > #receipts { grid-column: 2; }
  #form > #details, #form > #receipts { align-self: stretch; }
}
