/* King V in Practice: registration page
   Palette: navy #0a2a57, deep navy #071d3d, gold #c9a227, dark gold #8a6d08,
            ivory #faf7ef, sand #efe9d8, ink #1b2430 */

:root {
  --navy: #0a2a57;
  --navy-deep: #071d3d;
  --gold: #c9a227;
  --gold-dark: #8a6d08;
  --ivory: #faf7ef;
  --sand: #efe9d8;
  --line: #d9d2bf;
  --ink: #1b2430;
  --muted: #5a6472;
  --error: #b3261e;
  --error-bg: #fdecea;
  --ok: #1e7b4b;
  --radius: 10px;
  --font-body: "Segoe UI", "Helvetica Neue", Calibri, Arial, sans-serif;
  --font-head: Georgia, "Times New Roman", serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--ivory);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-underline-offset: 2px; }
a:hover { color: var(--gold-dark); }

.wrap { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }

/* ---------- header ---------- */
.site-header { background: #fff; border-bottom: 3px solid var(--gold); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .7rem; flex-wrap: wrap;
}
.brand img { width: 150px; height: auto; }
.site-header__help { margin: 0; font-size: .9rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.site-header__help a { font-weight: 600; text-decoration: none; }
.site-header__help a:hover { text-decoration: underline; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--navy-deep); }
.hero::before {                       /* soft blurred copy fills the sides on wide screens */
  content: ""; position: absolute; inset: -30px;
  background: url("../assets/king-v-hero.jpg") center / cover no-repeat;
  filter: blur(28px) brightness(.85);
}
.hero img { position: relative; width: 100%; max-width: 1100px; height: auto; margin-inline: auto; }

/* ---------- intro ---------- */
.intro { padding-block: 2.4rem 1.2rem; }
.intro h1 {
  margin: 0 0 .5rem;
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.15;
  color: var(--navy);
  letter-spacing: -.01em;
}
.intro__lead { margin: 0; max-width: 62ch; font-size: 1.12rem; color: var(--ink); }
.deadline {
  display: inline-block; margin: 1rem 0 0; padding: .5rem .9rem;
  border-left: 4px solid var(--gold); background: var(--sand);
  font-weight: 600; font-size: .95rem; color: var(--navy);
}
.deadline:empty { display: none; }

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 2rem;
  align-items: start;
  padding-bottom: 4rem;
}
.layout__summary { position: sticky; top: 1rem; display: grid; gap: 1.25rem; }

/* ---------- cards / steps ---------- */
.card {
  margin: 0 0 1.5rem;
  padding: 1.6rem 1.6rem 1.7rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-inline-size: 0;
}
.card > legend {
  float: left; width: 100%;           /* keeps the legend inside the card padding */
  padding: 0; margin: 0 0 1rem;
  font-family: var(--font-head);
  font-size: 1.35rem; font-weight: 700; color: var(--navy);
  display: flex; align-items: center; gap: .7rem;
}
.card > legend + * { clear: both; }
.step {
  display: inline-grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--navy); color: var(--gold);
  font: 700 1rem var(--font-head);
  flex: none;
}

/* ---------- form fields ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem 1.2rem; }
.field { min-width: 0; }
.field--full { grid-column: 1 / -1; }

label { display: block; margin-bottom: .3rem; font-weight: 600; font-size: .95rem; }
.req { color: var(--error); }
.opt { font-weight: 400; color: var(--muted); font-size: .85rem; }

input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%;
  padding: .7rem .8rem;
  font: inherit; color: inherit;
  background: #fff;
  border: 1.5px solid #bdb59f;
  border-radius: 7px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 5.5rem; }
input[readonly] { background: var(--ivory); color: var(--muted); }
input:hover, select:hover, textarea:hover { border-color: var(--navy); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(201, 162, 39, .45);
}
[aria-invalid="true"] { border-color: var(--error) !important; background: var(--error-bg); }

.error { margin: .35rem 0 0; color: var(--error); font-size: .88rem; font-weight: 600; }
.error::before { content: "\26A0\FE0E\00a0"; }
.hint { margin: .6rem 0 0; font-size: .9rem; color: var(--muted); }
.hint--tight { margin-top: .3rem; font-size: .84rem; }
.hint--top { margin: 0 0 1.1rem; }

/* honeypot: keep off-screen but present in DOM */
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- attendance choices ---------- */
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.choice { position: relative; display: block; margin: 0; cursor: pointer; font-weight: 400; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice__body {
  display: grid; gap: .3rem; height: 100%;
  padding: 1rem 1.1rem 1rem 3rem;
  border: 2px solid var(--line); border-radius: var(--radius);
  background: var(--ivory);
  position: relative;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.choice__body::before {
  content: ""; position: absolute; left: 1rem; top: 1.15rem;
  width: 1.15rem; height: 1.15rem; border-radius: 50%;
  border: 2px solid #8b8470; background: #fff;
}
.choice__title { font-weight: 700; font-size: 1.08rem; color: var(--navy); }
.choice__text { font-size: .92rem; color: var(--muted); }
.choice__price { margin-top: .35rem; font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--gold-dark); }
.choice:hover .choice__body { border-color: var(--navy); }
.choice input:checked + .choice__body { border-color: var(--navy); background: #fff; box-shadow: 0 0 0 1px var(--navy); }
.choice input:checked + .choice__body::before { border-color: var(--navy); background: radial-gradient(circle, var(--navy) 0 45%, #fff 50%); }
.choice input:focus-visible + .choice__body { outline: 3px solid rgba(201, 162, 39, .7); outline-offset: 2px; }

/* ---------- delegates ---------- */
.delegates { display: grid; gap: 1.1rem; }
.delegate { padding: 1.1rem 1.1rem 1.3rem; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 8px; background: var(--ivory); }
.delegate__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.delegate__title { margin: 0; font-size: 1.02rem; font-family: var(--font-head); color: var(--navy); }
.delegate input[type="text"], .delegate input[type="email"], .delegate input[type="tel"] { background: #fff; }
.delegates__foot { display: flex; align-items: center; gap: 1rem; margin-top: 1.1rem; flex-wrap: wrap; }
.delegates__foot .hint { margin: 0; }

.link-btn {
  background: none; border: 0; padding: .2rem .1rem; font: inherit; font-size: .9rem; font-weight: 600;
  color: var(--error); text-decoration: underline; cursor: pointer;
}
.link-btn:focus-visible { outline: 3px solid rgba(201, 162, 39, .7); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .85rem 1.5rem; border-radius: 8px;
  font: 700 1rem var(--font-body); text-decoration: none; cursor: pointer;
  border: 2px solid transparent;
  transition: background .15s, color .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(201, 162, 39, .8); outline-offset: 3px; }
.btn--primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn--primary:hover { background: var(--navy-deep); color: var(--gold); }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn--ghost:hover { background: var(--navy); color: #fff; }
.btn--small { padding: .55rem 1rem; font-size: .92rem; }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn__spinner {
  display: none; width: 1.1rem; height: 1.1rem; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: var(--gold);
  animation: spin .8s linear infinite;
}
.btn.is-loading .btn__spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.submit-row { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.submit-row .hint { margin: 0; max-width: 46ch; }

/* ---------- terms + checkbox ---------- */
.terms { margin: 1.4rem 0 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--ivory); }
.terms summary { padding: .8rem 1rem; font-weight: 600; color: var(--navy); cursor: pointer; }
.terms summary:focus-visible { outline: 3px solid rgba(201, 162, 39, .7); outline-offset: -3px; border-radius: 8px; }
.terms__body { padding: 0 1.1rem 1rem; max-height: 320px; overflow: auto; font-size: .92rem; }
.terms__body h3 { margin: .9rem 0 .3rem; font-size: .98rem; color: var(--navy); font-family: var(--font-head); }
.terms__body ul { margin: 0; padding-left: 1.2rem; }
.terms__body li { margin-bottom: .3rem; }

.field--check { margin-top: .4rem; }
.check { display: grid; grid-template-columns: auto 1fr; gap: .7rem; align-items: start; font-weight: 400; cursor: pointer; margin: 0; }
.check input { width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; accent-color: var(--navy); }
.check input:focus-visible { outline: 3px solid rgba(201, 162, 39, .8); outline-offset: 2px; }

/* ---------- banners ---------- */
.banner { margin: 0 0 1.5rem; padding: 1rem 1.2rem; border-radius: var(--radius); font-weight: 600; }
.banner[hidden] { display: none; }
.banner--error { background: var(--error-bg); border: 1px solid var(--error); color: #7f1a14; }
.banner--error:focus-visible { outline: 3px solid rgba(179, 38, 30, .5); outline-offset: 2px; }
.banner ul { margin: .5rem 0 0; padding-left: 1.2rem; font-weight: 400; }
.banner a { color: inherit; }

/* ---------- success ---------- */
.success { text-align: center; padding: 2.4rem 1.6rem 2.2rem; border-top: 5px solid var(--gold); }
.success[hidden] { display: none; }
.success:focus { outline: none; }
.success__mark {
  display: inline-grid; place-items: center; width: 3.4rem; height: 3.4rem; border-radius: 50%;
  background: var(--navy); color: var(--gold); margin-bottom: .8rem;
}
.success h2 { margin: 0 0 .4rem; font-family: var(--font-head); font-size: 1.9rem; color: var(--navy); }
.success__ref { margin: 0 0 .6rem; font-size: 1.1rem; }
.success__ref strong { font-family: var(--font-head); color: var(--gold-dark); letter-spacing: .03em; font-size: 1.3rem; }
.success__facts { display: grid; gap: 0; margin: 1.4rem auto; max-width: 28rem; text-align: left; border-top: 1px solid var(--line); }
.success__facts div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.success__facts dt { color: var(--muted); }
.success__facts dd { margin: 0; font-weight: 700; text-align: right; }

/* ---------- ticket summary ---------- */
.ticket { filter: drop-shadow(0 6px 14px rgba(10, 42, 87, .18)); }
.ticket__top {
  position: relative; padding: 1.2rem 1.4rem 1.3rem;
  background: var(--navy); color: #fff; border-radius: var(--radius) var(--radius) 0 0;
}
.ticket__top img { background: #fff; padding: .35rem .55rem; border-radius: 6px; margin-bottom: .8rem; }
.ticket__top h2 { margin: 0 0 .3rem; font-family: var(--font-head); font-size: 1.45rem; color: var(--gold); }
.ticket__top p { margin: 0; font-size: .95rem; color: #dfe6f1; }
.ticket__tear {
  height: 18px; position: relative;
  background:
    radial-gradient(circle at 0 50%, transparent 0 9px, var(--navy) 9.5px) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, transparent 0 9px, var(--navy) 9.5px) right / 51% 100% no-repeat;
}
.ticket__tear::after {
  content: ""; position: absolute; left: 18px; right: 18px; top: 50%;
  border-top: 2px dashed rgba(255, 255, 255, .35);
}
.ticket__body { padding: 1.1rem 1.4rem 1.3rem; background: #fff; border-radius: 0 0 var(--radius) var(--radius); }
.lines, .totals { margin: 0; }
.lines__row, .totals > div { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; }
.lines dt, .totals dt { color: var(--muted); }
.lines dd, .totals dd { margin: 0; font-weight: 600; text-align: right; white-space: nowrap; }
.lines { padding-bottom: .5rem; border-bottom: 1px dashed var(--line); margin-bottom: .5rem; }
.lines__row dt { color: var(--ink); }
.totals__grand { margin-top: .3rem; padding-top: .7rem !important; border-top: 2px solid var(--navy); }
.totals__grand dt { color: var(--navy); font-weight: 700; font-size: 1.05rem; }
.totals__grand dd { font-family: var(--font-head); font-size: 1.5rem; color: var(--navy); }
.ticket__note { margin: .7rem 0 0; font-size: .85rem; color: var(--muted); }

.aside-note { padding: 1.1rem 1.3rem; background: var(--sand); border-radius: var(--radius); }
.aside-note h3 { margin: 0 0 .5rem; font-family: var(--font-head); color: var(--navy); font-size: 1.1rem; }
.aside-note ul { margin: 0; padding-left: 1.1rem; font-size: .92rem; }
.aside-note li { margin-bottom: .3rem; }

/* ---------- mobile total bar ---------- */
.totalbar {
  display: none; position: fixed; inset: auto 0 0 0; z-index: 20;
  align-items: center; justify-content: space-between; gap: 1rem;
  padding: .65rem 1.1rem calc(.65rem + env(safe-area-inset-bottom));
  background: var(--navy-deep); color: #fff; border-top: 3px solid var(--gold);
}
.totalbar__label { display: block; font-size: .78rem; color: #c8d0dc; }
.totalbar strong { font-family: var(--font-head); font-size: 1.25rem; color: var(--gold); }
.totalbar .btn--primary { background: var(--gold); border-color: var(--gold); color: var(--navy-deep); }
.totalbar .btn--primary:hover { background: #fff; border-color: #fff; color: var(--navy-deep); }

/* ---------- footer ---------- */
.site-footer { padding: 1.4rem 0 1.8rem; background: var(--navy-deep); color: #c8d0dc; font-size: .9rem; text-align: center; }
.site-footer p { margin: 0; }
.site-footer strong { color: var(--gold); }
.site-footer a { color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .layout__summary { position: static; order: 2; }
  .totalbar { display: flex; }
  body { padding-bottom: 4.6rem; }
}
@media (max-width: 640px) {
  .wrap { width: min(1160px, 100% - 1.6rem); }
  .card { padding: 1.2rem 1rem 1.3rem; }
  .grid, .choice-grid { grid-template-columns: minmax(0, 1fr); }
  .site-header__inner { justify-content: center; text-align: center; }
  .site-header__help { justify-content: center; }
  .submit-row .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
