:root {
  --ink: #17130b;
  --ink-soft: #241c10;
  --muted: #6f6653;
  --line: #e9e0cb;
  --line-strong: #d8c8a8;
  --line-input: #ded0b2;
  --bg: #f8f4ea;
  --card: #fffefa;
  --gold: #c9971b;
  --gold-deep: #8a5f0e;
  --gold-light: #f7d873;
  --gold-grad: linear-gradient(135deg, #f9e28f 0%, #eec348 40%, #c9971b 72%, #a97a12 100%);
  --silver: #c3c8cf;
  --error: #c2261f;
  --ok: #0f7b52;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(23, 19, 11, .05), 0 18px 44px rgba(23, 19, 11, .1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: radial-gradient(60rem 40rem at 100% -10%, rgba(247, 216, 115, .18), transparent 60%), var(--bg);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- intro splash ---------- */
html.is-intro, html.is-intro body { overflow: hidden; }

.splash {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background: radial-gradient(65rem 42rem at 50% 42%, #fffdf4 0%, #fff 58%);
  animation: splash-out .55s ease 1.9s forwards;
}
.splash::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(96vw, 640px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 216, 115, .34), rgba(247, 216, 115, 0) 62%);
  animation: splash-glow 1.9s ease-out both;
}
.splash-logo {
  position: relative;
  width: min(80vw, 470px);
  height: auto;
  animation: logo-in 1.05s cubic-bezier(.16, .84, .24, 1) both,
             logo-out .55s ease 1.9s forwards;
}
/* the page waits for the logo, then rises in behind it */
.hero, main { animation: content-in .7s cubic-bezier(.16, .84, .24, 1) 1.95s both; }
body.intro-skip .hero, body.intro-skip main { animation: none; }

@keyframes logo-in {
  0%   { opacity: 0; transform: scale(.55); }
  60%  { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes logo-out {
  to { opacity: 0; transform: scale(1.16); }
}
@keyframes splash-glow {
  0%   { opacity: 0; transform: scale(.6); }
  70%  { opacity: 1; transform: scale(1); }
  100% { opacity: .5; transform: scale(1.06); }
}
@keyframes splash-out {
  55%  { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}
@keyframes content-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .splash { display: none; animation: none; }
  .splash::before, .splash-logo, .hero, main, #done .tick, .quick-submit { animation: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: #f8f1de;
  background:
    radial-gradient(44rem 26rem at 12% -8%, rgba(201, 151, 27, .32), transparent 62%),
    radial-gradient(36rem 22rem at 94% 4%, rgba(195, 200, 207, .16), transparent 60%),
    linear-gradient(155deg, #1d170d 0%, #120e07 56%, #1c1509 100%);
  padding: 40px 16px 92px;
  text-align: center;
}
/* 1px gold crown line */
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--gold-grad);
  z-index: 3;
}
/* the logo's dotted X, ghosted behind the header */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(247, 216, 115, .3) 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: linear-gradient(to bottom, #000 10%, transparent 88%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.eyebrow {
  margin: 0 0 16px;
  font-size: .7rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #f0d489;
}
.hero-logo {
  position: relative;
  margin: 0 auto 14px;
  width: min(84vw, 430px);
}
/* soft spotlight so the silver in the logo has something to sit against */
.hero-logo::before {
  content: "";
  position: absolute;
  inset: -24% -16%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(247, 216, 115, .32), rgba(247, 216, 115, .06) 55%, rgba(247, 216, 115, 0) 74%);
}
.hero-logo img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, .55));
}
.tagline {
  margin: 0;
  font-size: .95rem;
  letter-spacing: .02em;
  color: rgba(248, 241, 222, .78);
}

/* ---------- layout ---------- */
main {
  max-width: 720px;
  margin: -64px auto 0;
  padding: 0 16px 40px;
  position: relative;
  z-index: 2;
}
.card {
  background: var(--card);
  border: 1px solid #f1e8d5;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 20px;
}
@media (min-width: 600px) {
  .card { padding: 34px 38px; }
  .hero { padding: 52px 16px 96px; }
  .hero-logo { width: 460px; }
}

.form-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.form-head h2 {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.55rem;
  letter-spacing: -.01em;
}
.form-head p { margin: 0; font-size: .82rem; color: var(--muted); }
.req { color: var(--error); }

/* ---------- terms ---------- */
.terms {
  margin: 18px 0 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffcf3;
}
.terms summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  font-size: .92rem;
  color: var(--gold-deep);
}
.terms-body {
  padding: 0 16px 16px;
  font-size: .9rem;
  color: var(--muted);
}
@media (min-width: 600px) {
  .terms-body { max-height: 320px; overflow: auto; }
}
.terms-body h4 { margin: 14px 0 2px; color: var(--ink); font-size: .9rem; }
.terms-body p { margin: 0; }

/* ---------- fields ---------- */
.field {
  border: 0;
  margin: 0;
  padding: 22px 0 0;
  min-width: 0;
}
.field > label:not(.opt, .drop), .field > legend {
  display: block;
  padding: 0;
  font-weight: 600;
  margin-bottom: 6px;
}
/* float keeps the legend inside the fieldset's padding like a normal label */
.field > legend { float: left; width: 100%; }
.field > legend + * { clear: both; }
.hint { margin: -2px 0 10px; font-size: .85rem; color: var(--muted); }

input[type="text"], input[type="tel"], input[type="email"], textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;              /* stops iOS zooming on focus */
  color: inherit;
  padding: 13px 14px;
  border: 1.5px solid var(--line-input);
  border-radius: 12px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { resize: vertical; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 151, 27, .16);
}
input::placeholder { color: #b6ab93; }

.options { display: grid; gap: 8px; }
.opt {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 14px;
  min-height: 48px;
  border: 1.5px solid var(--line-input);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.opt:hover { border-color: var(--line-strong); background: #fffdf6; }
.opt input { margin: 2px 0 0; accent-color: var(--gold-deep); width: 19px; height: 19px; flex: none; }
.opt:has(input:checked) {
  border-color: var(--gold);
  background: #fff9e7;
  box-shadow: 0 0 0 3px rgba(201, 151, 27, .12);
}
.agree span { font-size: .95rem; }

/* Standard: a single choice, but drawn as checkboxes instead of radios. */
.checkbox-style .opt input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  border: 2px solid #c3ae86;
  border-radius: 5px;
  background: #fff center / 13px 13px no-repeat;
  transition: border-color .15s, background-color .15s;
}
.checkbox-style .opt:hover input[type="radio"] { border-color: var(--gold); }
.checkbox-style .opt input[type="radio"]:checked {
  border-color: var(--gold-deep);
  background-color: var(--gold);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23241c10' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round' d='M3 8.4l3.3 3.3L13 4.9'/%3E%3C/svg%3E");
}
.checkbox-style .opt input[type="radio"]:focus-visible {
  outline: 3px solid rgba(201, 151, 27, .4);
  outline-offset: 2px;
}

/* event chips */
.events {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(144px, 1fr));
  gap: 8px;
}
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 9px 10px;
  text-align: center;
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.25;
  overflow-wrap: anywhere;
  border: 1.5px solid var(--line-input);
  border-radius: 12px;
  background: #fff;
  transition: all .15s;
}
.chip:hover span { border-color: var(--line-strong); }
.chip input:checked + span {
  color: var(--ink-soft);
  border-color: transparent;
  background: var(--gold-grad);
  box-shadow: 0 10px 22px rgba(201, 151, 27, .3);
}
.chip input:focus-visible + span { outline: 3px solid rgba(201, 151, 27, .45); outline-offset: 2px; }
.chip input:active + span { transform: scale(.98); }
.chip input:disabled { cursor: not-allowed; }
.chip input:disabled + span {
  color: #a99e88;
  background: #f6f1e3;
  border-style: dashed;
}
.chip span small {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .09em;
  color: var(--error);
}
.chip span small.tag { color: var(--gold-deep); font-size: .62rem; }
.chip input:checked + span small.tag { color: rgba(36, 28, 16, .72); }
.events-msg { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .9rem; }
.events-msg button {
  padding: 0;
  margin-left: 6px;
  background: none;
  color: var(--gold-deep);
  text-decoration: underline;
}

/* file drop */
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 130px;
  padding: 16px;
  border: 2px dashed var(--line-strong);
  border-radius: 14px;
  background: #fffcf3;
  color: var(--muted);
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover { border-color: var(--gold); background: #fff9e7; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop img { max-width: 100%; max-height: 200px; border-radius: 10px; }

/* errors */
.err { margin: 6px 0 0; font-size: .85rem; color: var(--error); min-height: 0; }
.err:empty { display: none; }
.invalid input[type="text"], .invalid input[type="tel"], .invalid input[type="email"],
.invalid textarea, .invalid .drop, .invalid .opt, .invalid .chip span { border-color: var(--error); }
.form-error {
  margin: 20px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fdf1ef;
  border: 1px solid #f6d5cf;
  color: #9c1d17;
  font-size: .9rem;
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* buttons */
.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 28px;
}
button {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border-radius: 999px;
  border: 0;
  padding: 15px 28px;
  min-height: 50px;
}
button[type="submit"] {
  color: var(--ink-soft);
  background: var(--gold-grad);
  box-shadow: 0 10px 24px rgba(201, 151, 27, .38);
  transition: transform .1s, filter .15s, opacity .15s;
}
button[type="submit"]:hover { filter: brightness(1.04); }
button[type="submit"]:active { transform: translateY(1px) scale(.995); }
button[type="submit"]:disabled { opacity: .65; cursor: progress; }
.ghost { background: transparent; color: var(--gold-deep); padding: 15px 10px; font-weight: 600; }

button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(201, 151, 27, .5);
  outline-offset: 2px;
}

/* success */
.done { text-align: center; padding-top: 40px; padding-bottom: 40px; }
.done h2 { font-family: "Bricolage Grotesque", sans-serif; font-size: 1.7rem; margin: 14px 0 6px; }
.done p { color: var(--muted); margin: 0 auto 20px; max-width: 440px; }
.tick {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 2rem;
  background: linear-gradient(135deg, var(--ok), #34d399);
}
#done .tick {
  color: var(--ink-soft);
  background: var(--gold-grad);
  box-shadow: 0 0 0 8px rgba(247, 216, 115, .22), 0 12px 26px rgba(201, 151, 27, .32);
  animation: tick-in .55s cubic-bezier(.16, .84, .24, 1) both;
}
@keyframes tick-in {
  0%   { transform: scale(.6); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.closed-icon { background: var(--ink); color: var(--gold-light); }

footer {
  text-align: center;
  padding: 8px 16px calc(28px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .02em;
}

/* ---------- steps ---------- */
#reg { counter-reset: step; }
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 30px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.15rem;
  letter-spacing: -.01em;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--ink-soft);
  font-size: .88rem;
  font-weight: 700;
  background: var(--gold-grad);
  box-shadow: 0 4px 12px rgba(201, 151, 27, .3);
}
.step-hint { margin: 8px 0 0; font-size: .9rem; color: var(--muted); }

/* labels that switch between solo and team wording */
.team-only { display: none; }
#reg.is-team .team-only { display: revert; }
#reg.is-team .solo-only { display: none; }

.grid-2 { display: grid; gap: 0 16px; }
@media (min-width: 600px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

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

/* ---------- team members ---------- */
.member {
  margin-top: 14px;
  padding: 2px 14px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fffcf3;
}
.member .field { padding-top: 12px; }
.member-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  color: var(--gold-deep);
  font-size: .9rem;
}
.remove-member {
  padding: 6px 14px;
  min-height: 36px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--error);
  background: #fff;
  border: 1.5px solid #f1d3ce;
  border-radius: 999px;
}
.remove-member:hover { background: #fdf1ef; }

.team-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.team-bar p { margin: 0; font-size: .9rem; color: var(--muted); }
.team-bar b { color: var(--ink); }
.add-member {
  padding: 11px 20px;
  color: var(--gold-deep);
  background: #fff9e7;
  border: 1.5px dashed var(--line-strong);
}
.add-member:hover { border-color: var(--gold); background: #fff4d6; }
[hidden] { display: none !important; }

/* option grids (gender, standard, solo/team) */
.options.cols-2 { grid-template-columns: 1fr 1fr; }
.options.cols-3 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 480px) { .options.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.options.cols-2 .opt, .options.cols-3 .opt { align-items: center; }

/* phone-only floating submit, shown once the real buttons are off screen */
.quick-submit {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 20px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 700;
  background: var(--gold-grad);
  box-shadow: 0 16px 36px rgba(201, 151, 27, .45), 0 4px 14px rgba(23, 19, 11, .18);
  animation: quick-in .22s ease both;
}
@media (max-width: 600px) {
  .quick-submit:not([hidden]) { display: flex; }
}
@keyframes quick-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- phones ---------- */
@media (max-width: 600px) {
  .hero { padding: 34px 14px 84px; }
  .eyebrow { font-size: .64rem; letter-spacing: .18em; margin-bottom: 14px; }
  .hero-logo { width: min(88vw, 380px); }
  .tagline { font-size: .88rem; }
  main { margin-top: -58px; padding: 0 12px 28px; }
  .card { padding: 22px 16px 26px; border-radius: 14px; }
  .form-head h2 { font-size: 1.35rem; }
  .terms summary { font-size: .88rem; padding: 13px 14px; }
  .step { font-size: 1.08rem; margin-top: 26px; padding-top: 20px; }
  .field { padding-top: 20px; }
  .events { grid-template-columns: repeat(2, 1fr); }
  .chip span { min-height: 50px; font-size: .79rem; padding: 7px 6px; }
  .opt { padding: 12px 12px; gap: 10px; }
  .drop { min-height: 118px; }
  .actions { flex-direction: column; align-items: stretch; gap: 6px; }
  button[type="submit"] { width: 100%; }
  .ghost { width: 100%; justify-self: center; text-align: center; }
  .team-bar { flex-direction: column; align-items: stretch; }
  .add-member { width: 100%; }
  .member-head { font-size: .85rem; }
}

/* ---------- very small phones (iPhone SE and down) ---------- */
@media (max-width: 360px) {
  .hero-logo { width: 88vw; }
  .tagline { font-size: .84rem; }
  .form-head { gap: 6px; }
  .form-head h2 { font-size: 1.2rem; }
  .form-head p { font-size: .76rem; white-space: nowrap; }
  .step { font-size: 1rem; }
  .chip span { font-size: .74rem; }
}
