/* MSL3 — shared styles (public form + admin) */
:root {
  --pitch: #0E3B2E;
  --pitch-2: #185C45;
  --leather: #B3122E;
  --leather-dark: #8C0D23;
  --willow: #E6CF9C;
  --chalk: #EEF2ED;
  --paper: #FFFFFF;
  --ink: #13211B;
  --muted: #56665E;
  --line: #CFD8D1;
  --focus: rgba(24, 92, 69, .35);
  --display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font: 400 17px/1.5 var(--body);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; }

/* ---------- Masthead ---------- */
.masthead {
  position: relative;
  overflow: hidden;
  background: var(--pitch);
  color: #fff;
  padding: calc(26px + env(safe-area-inset-top, 0px)) 20px 96px;
}
.masthead__inner { max-width: 640px; margin: 0 auto; position: relative; z-index: 1; }
.masthead__league { margin: 0; font-weight: 600; font-size: 1rem; color: var(--willow); }
.masthead__title {
  margin: .05em 0 0 -.04em;
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(6rem, 30vw, 10rem);
  line-height: .8;
  letter-spacing: -.025em;
}
.masthead__sub { margin: .7em 0 0; font-size: 1.15rem; font-weight: 500; color: #D5E3DA; }

/* the ball seam: one red stitched line across the pitch */
.seam { position: absolute; left: 0; bottom: 34px; width: 100%; height: 64px; }
.seam__line   { fill: none; stroke: var(--leather); stroke-width: 5; vector-effect: non-scaling-stroke; }
.seam__stitch { fill: none; stroke: #F3E6E3; stroke-width: 15; stroke-dasharray: 2 9; vector-effect: non-scaling-stroke; opacity: .9; }

/* ---------- Sheet & card ---------- */
.sheet { position: relative; max-width: 640px; margin: -60px auto 0; padding: 0 12px 32px; }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 18px 26px;
}
@media (min-width: 560px) { .card { padding: 32px 32px 34px; } }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.block + .block { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
legend { float: left; width: 100%; padding: 0; margin-bottom: 14px; font: 700 1.65rem/1.1 var(--display); color: var(--pitch); }

/* ---------- Fields ---------- */
.field { margin-bottom: 18px; }
legend + * { clear: both; }
.field:last-child { margin-bottom: 0; }
.field > label, .field__label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .98rem; }
.field__hint { margin: 6px 0 0; font-size: .88rem; color: var(--muted); }
.field__error { margin: 6px 0 0; font-size: .9rem; font-weight: 500; color: var(--leather); }
.field__error:empty { display: none; }

input[type="text"], input[type="tel"], input[type="password"], input[type="search"], select {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font: inherit;
  font-size: 17px;               /* >=16px stops iOS zoom */
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  appearance: none;
}
select {
  padding-right: 34px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2356665E' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center / 12px;
}
input:focus, select:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--pitch-2); }
.field.has-error input, .field.has-error select, .field.has-error .upload { border-color: var(--leather); }
#city_other { margin-top: 8px; }

/* searchable city dropdown (Tom Select) */
.ts-wrapper.single .ts-control {
  min-height: 50px; padding: 12px 34px 12px 14px;
  font: inherit; font-size: 17px; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px; box-shadow: none;
}
.ts-wrapper.single .ts-control::after { right: 14px; border-top-color: var(--muted); }
.ts-wrapper.focus .ts-control { outline: 3px solid var(--focus); border-color: var(--pitch-2); box-shadow: none; }
.ts-control input { font-size: 17px !important; }                  /* >=16px stops iOS zoom */
.ts-dropdown { font-size: 17px; border: 1.5px solid var(--line); border-radius: 10px; margin-top: 4px; overflow: hidden; }
.ts-dropdown .ts-dropdown-content { max-height: 280px; }
.ts-dropdown .option, .ts-dropdown .create, .ts-dropdown .no-results { padding: 11px 14px; }
.ts-dropdown .optgroup-header { padding: 8px 14px 4px; font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: #F6F8F5; }
.ts-dropdown .active { background: var(--chalk); color: var(--ink); }
.ts-dropdown .selected { font-weight: 600; color: var(--pitch); }
.field.has-error .ts-control { border-color: var(--leather); }

/* option chips (radio buttons) */
.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.chips--3 { grid-template-columns: repeat(3, 1fr); }
.chip { position: relative; display: flex; }
.chip--wide { grid-column: 1 / -1; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  flex: 1; display: flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 8px 10px;
  text-align: center; line-height: 1.2; font-weight: 600;
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
  cursor: pointer; user-select: none;
  transition: background-color .12s, border-color .12s, color .12s;
}
.chip input:checked + span { background: var(--pitch); border-color: var(--pitch); color: #fff; }
.chip small { display: block; margin-top: 3px; font-size: .74rem; font-weight: 400; line-height: 1.25; color: var(--muted); }
.chip span.has-hint { flex-direction: column; padding: 10px 6px; }
.chip input:checked + span small { color: #D5E3DA; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.field.has-error .chip span { border-color: #E3A9B3; }

/* picture uploads */
.uploads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.uploads .field { margin: 0; }
.upload {
  position: relative; overflow: hidden;
  aspect-ratio: 3 / 4;
  display: flex; align-items: center; justify-content: center;
  background: #F6F8F5; border: 2px dashed var(--line); border-radius: 14px;
}
.upload:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.upload input { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload__empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px; text-align: center; font-size: .9rem; color: var(--muted); }
.upload__empty strong { color: var(--ink); font-size: 1rem; }
.upload__empty svg { width: 44px; height: 44px; margin-bottom: 4px; fill: none; stroke: var(--pitch-2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.upload img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.upload__change {
  display: none; position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 8px; text-align: center; font-size: .85rem; font-weight: 600; color: #fff;
  background: rgba(14, 59, 46, .82);
}
.upload.has-file { border-style: solid; border-color: var(--pitch-2); }
.upload.has-file .upload__empty { visibility: hidden; }
.upload.has-file .upload__change { display: block; }
.upload.is-busy::after {
  content: "Preparing…"; position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.85); font-weight: 600; color: var(--pitch);
}

.payinfo { margin: 0 0 14px; padding: 12px 14px; background: #F7EFD9; border-radius: 10px; font-weight: 500; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Buttons & states ---------- */
.submit {
  display: block; width: 100%; min-height: 58px; margin-top: 26px;
  font: 700 1.4rem/1 var(--display); letter-spacing: .01em;
  color: #fff; background: var(--leather);
  border: 0; border-radius: 12px; cursor: pointer;
}
.submit:hover { background: var(--leather-dark); }
.submit:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.submit:disabled { opacity: .7; cursor: progress; }
.submit--ghost { background: transparent; color: var(--pitch); border: 1.5px solid var(--pitch); }
.submit--ghost:hover { background: var(--chalk); }

.progress { height: 6px; margin-top: 12px; background: var(--chalk); border-radius: 3px; overflow: hidden; }
.progress span { display: block; width: 0; height: 100%; background: var(--pitch-2); transition: width .2s; }
.form-error { margin: 14px 0 0; padding: 12px 14px; background: #FBEAEC; color: var(--leather-dark); border-radius: 10px; font-weight: 500; }

.done h2, .closed h2 { margin: 0 0 18px; font-size: 2rem; color: var(--pitch); }
.done__label { margin: 0; color: var(--muted); font-weight: 600; }
.done__regno { margin: 0 0 14px; font: italic 800 clamp(3rem, 16vw, 4.5rem)/1 var(--display); color: var(--leather); }
.done__note { padding: 12px 14px; background: var(--chalk); border-radius: 10px; font-size: .95rem; }

.foot { padding: 0 20px 28px; text-align: center; font-size: .85rem; color: var(--muted); }
.foot p { margin: 0; }
.foot__credit { margin-top: 4px !important; font-size: .8rem; }
.foot__credit strong { font-weight: 600; color: var(--pitch); }

@media (max-width: 350px) {
  .chips--3 { grid-template-columns: 1fr 1fr; }
  .uploads { grid-template-columns: 1fr; }
  .upload { aspect-ratio: 4 / 3; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
