/* Public booking site. Mobile-first; breakpoints: 560 / 960 */

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top, 0px);
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 1080px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand img { height: 40px; width: auto; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--soft); border-radius: var(--pill); }
.seg button {
  min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--pill); background: transparent; color: var(--brand);
  font-weight: 700; font-size: .875rem; white-space: nowrap; transition: background var(--t-fast), color var(--t-fast);
}
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; box-shadow: 0 4px 10px rgba(34, 85, 154, .25); }
@media (min-width: 560px) { .seg button { padding: 0 20px; font-size: .92rem; } .brand img { height: 46px; } }

/* ---------- hero ---------- */
.hero {
  color: #fff; text-align: center; padding: 28px 16px 64px;
  background:
    radial-gradient(700px 360px at 85% -5%, rgba(255, 255, 255, .3), transparent 65%),
    radial-gradient(500px 300px at 0% 100%, rgba(201, 226, 74, .25), transparent 60%),
    linear-gradient(160deg, #173f7c 0%, #22559a 45%, #5b95e0 100%);
  border-radius: 0 0 32px 32px;
}
.hero-in { max-width: 640px; margin: 0 auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--pill); background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); font-size: .8125rem; font-weight: 600; }
.hero h1 { margin: 14px 0 8px; font-size: clamp(1.85rem, 7.5vw, 3rem); line-height: 1.1; letter-spacing: -.03em; font-weight: 800; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--lime); }
.hero p { margin: 0 auto; max-width: 420px; opacity: .92; }
.rates { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rates li { background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .3); border-radius: 18px; padding: 12px 4px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.rates b { display: block; font-size: 1.4rem; letter-spacing: -.02em; line-height: 1.2; }
.rates span { font-size: .75rem; opacity: .92; }
@media (min-width: 560px) { .hero { padding: 48px 24px 84px; } .rates { gap: 12px; } .rates b { font-size: 1.7rem; } .rates span { font-size: .8125rem; } }

/* ---------- layout ---------- */
main { max-width: 1080px; margin: -36px auto 0; padding: 0 16px 40px; position: relative; outline: 0; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.flow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.narrow { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
body.has-bar { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
  body.has-bar { padding-bottom: 0; }
  main { margin-top: -48px; }
}

.step h2, h2.plain { display: flex; align-items: center; gap: 12px; font-size: 1.2rem; letter-spacing: -.02em; margin-bottom: 16px; }
h2.plain { display: block; margin-bottom: 6px; }
.stepno { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: .95rem; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.lead { color: var(--mut); margin-bottom: 20px; }

/* ---------- date strip ---------- */
.dates { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 2px 8px; margin: 0 -2px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.dbtn {
  flex: none; scroll-snap-align: start; width: 68px; min-height: 82px; padding: 8px 0; border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: #fff; color: var(--ink); display: grid; gap: 0; justify-items: center; align-content: center;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.dbtn:hover { background: var(--soft); }
.dbtn:active { transform: scale(.96); }
.dbtn small { font-size: .75rem; font-weight: 600; color: var(--mut); }
.dbtn b { font-size: 1.4rem; line-height: 1.2; letter-spacing: -.02em; }
.dbtn[aria-pressed="true"] { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; box-shadow: 0 8px 18px rgba(34, 85, 154, .28); }
.dbtn[aria-pressed="true"] small { color: #e3eefc; }
.datepick { margin-top: 12px; }
.datepick .input { max-width: 260px; }
.nice { margin-top: 12px; font-weight: 700; color: var(--brand); min-height: 1.5em; }

/* ---------- hours ---------- */
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -4px 0 14px; padding: 0; font-size: .8125rem; color: var(--mut); }
.legend li { display: flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 5px; border: 1.5px solid var(--line); background: #fff; }
.sw.on { background: var(--brand); border-color: var(--brand); }
.sw.tk { background: var(--busy); border-color: var(--busy); }
.band + .band { margin-top: 18px; }
.band-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: .875rem; font-weight: 700; }
.band-h span { color: var(--mut); font-weight: 600; }
.band-h b { color: var(--brand); }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 560px) { .slots { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; } }
.slot {
  position: relative; min-height: 62px; padding: 8px 4px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff;
  display: grid; align-content: center; justify-items: center; line-height: 1.25;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.slot b { font-size: .98rem; }
.slot small { font-size: .75rem; color: var(--mut); font-weight: 500; }
.slot:not(:disabled):hover { border-color: var(--brand-2); background: var(--soft); }
.slot:not(:disabled):active { transform: scale(.96); }
.slot[aria-pressed="true"] { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; box-shadow: 0 8px 18px rgba(34, 85, 154, .28); }
.slot[aria-pressed="true"] small { color: #e3eefc; }
.slot .tick { position: absolute; top: 5px; right: 6px; display: none; }
.slot[aria-pressed="true"] .tick { display: block; color: var(--lime); }
.slot:disabled { background: var(--busy); border-color: var(--busy); color: #7a869b; cursor: not-allowed; }
.slot:disabled b { text-decoration: line-through; }
.slot:disabled small { color: #66728a; }
.hint-line, .formerr { color: var(--err); font-weight: 600; font-size: .9rem; margin-top: 12px; }
.hint-line:empty, .formerr:empty { display: none; }

/* ---------- form ---------- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
fieldset.paying { border: 0; padding: 0; margin: 20px 0 0; min-width: 0; }
.paying .lbl { font-size: .875rem; font-weight: 700; padding: 0; margin-bottom: 8px; display: block; }
.paygrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay { position: relative; display: block; cursor: pointer; }
.pay input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.paybox { display: grid; gap: 2px; justify-items: start; padding: 14px; min-height: 92px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: #fff; transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast); }
.paybox .ico { color: var(--brand); margin-bottom: 4px; }
.paybox small { color: var(--mut); font-size: .78rem; line-height: 1.3; }
.pay input:checked + .paybox { border-color: var(--brand-2); background: var(--soft); box-shadow: 0 0 0 2px var(--brand-2); }
.pay input:focus-visible + .paybox { outline: 3px solid var(--brand-2); outline-offset: 2px; }
.qrbox { margin-top: 16px; padding: 16px; background: var(--soft); border-radius: var(--r-md); }
.steps { margin: 0 0 14px; padding-left: 20px; font-size: .92rem; }
.steps li + li { margin-top: 4px; }
.qrimg { display: block; width: fit-content; margin: 0 auto 16px; background: #fff; padding: 8px; border-radius: var(--r-md); border: 1px solid var(--line); }
.qrimg img { width: auto; height: auto; max-height: 340px; max-width: 100%; border-radius: 8px; }
.qrbox .field { margin-top: 0; }
.qrbox .input { background: #fff; }

/* ---------- summary ---------- */
.summary {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .95); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(20, 41, 74, .06);
}
.summary[hidden] { display: none; }
.sum-full { display: none; }
.sum-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 640px; margin: 0 auto; }
.sum-total { display: grid; line-height: 1.25; min-width: 0; }
.sum-total span { font-size: .8125rem; color: var(--mut); }
.sum-total strong { font-size: 1.4rem; letter-spacing: -.02em; color: var(--brand); }
@media (min-width: 960px) {
  .summary { position: sticky; top: 88px; left: auto; right: auto; bottom: auto; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--sh-1); backdrop-filter: none; }
  .sum-full { display: block; }
  .sum-full h2 { font-size: 1.15rem; margin-bottom: 12px; }
  .sumlist { margin: 0 0 16px; display: grid; gap: 10px; }
  .sumlist div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
  .sumlist dt { color: var(--mut); font-size: .9rem; }
  .sumlist dd { margin: 0; font-weight: 700; text-align: right; }
  .sum-row { display: grid; gap: 14px; max-width: none; }
  .sum-total { display: flex; justify-content: space-between; align-items: baseline; }
  .sum-total strong { font-size: 1.7rem; }
  .sum-row .btn { width: 100%; }
}

/* ---------- confirmation + lookup ---------- */
.done { text-align: center; }
.okmark { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); animation: pop var(--t-med) var(--ease); }
.okmark .ico { width: 32px; height: 32px; stroke-width: 2.5; }
.done h2 { font-size: 1.5rem; letter-spacing: -.02em; }
.done .lead { margin: 6px 0 18px; }
.codebox { display: inline-block; padding: 10px 22px; border-radius: var(--r-md); background: var(--soft); border: 1.5px dashed var(--brand-2); }
.codebox small { display: block; color: var(--mut); font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.codebox b { font-size: 1.7rem; letter-spacing: .06em; color: var(--brand); font-variant-numeric: tabular-nums; }
.facts { text-align: left; margin: 20px 0 0; display: grid; gap: 0; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--mut); }
.facts dd { margin: 0; font-weight: 700; text-align: right; }
.callout { margin-top: 18px; text-align: left; padding: 14px 16px; border-radius: var(--r-md); background: var(--soft); font-size: .92rem; display: flex; gap: 10px; }
.callout .ico { color: var(--brand); margin-top: 2px; }
.callout.warn { background: var(--warn-bg); color: var(--warn); }
.callout.warn .ico { color: var(--warn); }
.btnrow { display: grid; gap: 10px; margin-top: 22px; }
@media (min-width: 560px) { .btnrow { grid-template-columns: 1fr 1fr; } }
.code { text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
#findGo { margin-top: 20px; }
.field, .formerr, .hint-line { scroll-margin-top: 96px; }
.found-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.found-h h2 { font-size: 1.15rem; }

/* ---------- footer ---------- */
.foot { text-align: center; color: var(--mut); font-size: .875rem; padding: 16px 16px 40px; display: grid; gap: 6px; justify-items: center; }
.foot img { opacity: .9; }
.foot a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.stafflink a { color: var(--mut); font-weight: 600; font-size: .8125rem; }
body.has-bar .foot { padding-bottom: 24px; }

/* Compact hero on the confirmation and lookup screens so the content starts higher */
body[data-view="done"] .hero p, body[data-view="done"] .rates,
body[data-view="find"] .hero p, body[data-view="find"] .rates { display: none; }
body[data-view="done"] .hero, body[data-view="find"] .hero { padding-bottom: 56px; }
body[data-view="done"] .hero h1, body[data-view="find"] .hero h1 { font-size: clamp(1.5rem, 6vw, 2.2rem); margin-bottom: 0; }
@media (max-width: 559px) {
  .hero { padding: 20px 16px 56px; }
  .rates { margin-top: 16px; }
  .rates b { font-size: 1.25rem; }
}
.sum-total .sum-date { font-size: .8125rem; color: var(--mut); }
@media (min-width: 960px) { .sum-total .sum-date { display: none; } .sum-total span:first-child { font-weight: 600; } }
.sum-total { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.sum-total strong { flex-basis: 100%; }
@media (min-width: 960px) { .sum-total strong { flex-basis: auto; } }

/* fully booked days */
.dbtn.full { background: var(--busy); border-color: var(--busy); }
.dbtn.full b { text-decoration: line-through; color: #66728a; }
.dbtn.full small:last-child { color: var(--err); font-weight: 800; }
.dbtn.full[aria-pressed="true"] { background: linear-gradient(135deg, #7a869b, #5d6b83); }
.dbtn.full[aria-pressed="true"] b, .dbtn.full[aria-pressed="true"] small:last-child { color: #fff; }
.fullnote { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--warn-bg); color: var(--warn); font-weight: 600; font-size: .9rem; }
.fullnote:empty { display: none; }

/* ---------- space picker (court / room) ---------- */
fieldset.spaces { border: 0; padding: 0; margin: 0; min-width: 0; }
.rates { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .rates { grid-template-columns: repeat(4, 1fr); } }
.rates li.room { background: rgba(201, 226, 74, .22); border-color: rgba(201, 226, 74, .7); }
.rates li.room b { color: var(--lime); }

/* ---------- day / week / month switch ---------- */
.step-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.step-top h2 { margin-bottom: 0; }
.vseg { display: inline-flex; gap: 4px; padding: 4px; background: var(--soft); border-radius: var(--pill); }
.vseg button { min-height: 40px; padding: 0 16px; border: 0; border-radius: var(--pill); background: transparent; color: var(--brand); font-weight: 700; font-size: .875rem; transition: background var(--t-fast), color var(--t-fast); }
.vseg button[aria-pressed="true"] { background: var(--brand); color: #fff; box-shadow: 0 4px 10px rgba(34, 85, 154, .25); }
@media (max-width: 420px) { .step-top .vseg { width: 100%; } .vseg button { flex: 1; } }

.calnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.callabel { flex: 1; text-align: center; font-weight: 800; letter-spacing: -.01em; }
.calnav .iconbtn:disabled { opacity: .35; cursor: not-allowed; }
.legend.lvl { margin: 0 0 12px; }
.sw.l0 { background: #fff; } .sw.l1 { background: #dce9fb; border-color: #b9d1f4; } .sw.l2 { background: #ffe9a8; border-color: #f0cd5e; } .sw.l3 { background: #f7b9b2; border-color: #e58b82; }

.meter { display: block; height: 6px; border-radius: 3px; background: rgba(20, 41, 74, .09); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--brand-2); }
.l2 .meter i { background: #d9a400; } .l3 .meter i { background: var(--err); }

.gday { position: relative; border: 1.5px solid var(--line); background: #fff; color: var(--ink); text-align: left; transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast); }
.gday:not(:disabled):hover { border-color: var(--brand-2); }
.gday:not(:disabled):active { transform: scale(.98); }
.gday.l1 { background: #f3f8ff; } .gday.l2 { background: #fff8e0; } .gday.l3 { background: #fdebe9; border-color: #f0c4c0; }
.gday.today { box-shadow: 0 0 0 2px var(--brand-2); }
.gday.off { opacity: .5; cursor: not-allowed; background: var(--busy); }
.gday[aria-pressed="true"] { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; box-shadow: 0 8px 18px rgba(34, 85, 154, .28); }
.gday[aria-pressed="true"] .meter { background: rgba(255, 255, 255, .3); }
.gday[aria-pressed="true"] .meter i { background: var(--lime); }
.gday[aria-pressed="true"] small, .gday[aria-pressed="true"] .mt, .gday[aria-pressed="true"] .wk-t { color: #fff; }

/* week: a tidy list on phones, seven columns on wider screens */
.gweek { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.gday.wk { display: grid; grid-template-columns: 84px minmax(0, 1fr) 96px; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; border-radius: var(--r-md); }
.wk-d { display: grid; line-height: 1.2; }
.wk-d small { color: var(--mut); font-weight: 600; font-size: .75rem; }
.wk-d b { font-size: .95rem; }
.wk-t { font-size: .8125rem; font-weight: 700; text-align: right; white-space: nowrap; }
.gday.l3 .wk-t { color: var(--err); }
.gday.off .wk-t { color: var(--mut); }
@media (min-width: 720px) {
  .gweek { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
  .gday.wk { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 8px; min-height: 108px; padding: 12px 10px; }
  .wk-t { text-align: left; white-space: normal; }
}

/* month */
.gmonth { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mh { text-align: center; font-size: .6875rem; font-weight: 800; color: var(--mut); padding: 2px 0 4px; text-transform: uppercase; letter-spacing: .03em; }
.mblank { min-height: 1px; }
.gday.mo { display: grid; align-content: space-between; gap: 4px; min-height: 58px; padding: 6px 4px; border-radius: 12px; text-align: center; }
.mo .dn { font-weight: 800; font-size: .95rem; }
.mo .mt { font-size: .625rem; font-weight: 700; color: var(--mut); line-height: 1.1; min-height: 1.1em; }
.gday.l3 .mt { color: var(--err); }
@media (max-width: 479px) { .mo .mt { display: none; } .gday.l3 .mt { display: block; } }
@media (min-width: 560px) { .gmonth { gap: 6px; } .gday.mo { min-height: 72px; padding: 8px 6px; text-align: left; } .mo .mt { font-size: .75rem; } }

/* ---------- cancellation note ---------- */
.policy { margin-top: 16px; display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); background: var(--soft); color: var(--ink); font-size: .875rem; line-height: 1.45; }
.policy .ico { color: var(--brand); margin-top: 2px; }
.step { scroll-margin-top: 84px; }
.found .callout { margin-top: 16px; }

/* softer "N free" text and the room add-on step */
.mo .mt { font-weight: 500; opacity: .55; letter-spacing: .01em; }
.gday.l3 .mt { opacity: 1; font-weight: 700; }
.gday[aria-pressed="true"] .mt { opacity: .85; }
.lead.tight { margin-bottom: 14px; }
.lead.tight b { color: var(--brand); }
.pay input:disabled + .paybox { opacity: .5; cursor: not-allowed; }
.pay:has(input:disabled) { cursor: not-allowed; }
#roomNote { margin-top: 12px; }

/* hero + equal rate tiles */
.rates { align-items: stretch; }
.rates li { display: grid; align-content: center; justify-items: center; gap: 2px; min-height: 92px; padding: 12px 6px; text-wrap: balance; }
.rates span { white-space: nowrap; }
.rates-note { margin: 10px auto 0 !important; font-size: .8125rem; opacity: .85 !important; }
@media (max-width: 380px) { .rates span { font-size: .6875rem; } }

/* downpayment notice */
.depbox { margin-top: 20px; display: flex; gap: 10px; padding: 14px 16px; border-radius: var(--r-md); background: var(--warn-bg); color: var(--warn); font-size: .9rem; line-height: 1.45; }
.depbox .ico { margin-top: 2px; flex: none; }
.depbox b { display: block; font-size: 1rem; }
.depbox[hidden] { display: none; }

/* payment screenshot upload */
.pfbtn { width: 100%; justify-content: center; background: #fff; }
.pfprev { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 8px; background: #fff; border-radius: var(--r-md); box-shadow: inset 0 0 0 1.5px var(--line); }
.pfprev img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex: 0 0 auto; background: var(--soft); }
.pfprev span { flex: 1; min-width: 0; font-size: .88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfx { border: 0; background: transparent; color: var(--brand); font-weight: 700; font-size: .88rem; min-height: 44px; padding: 0 10px; }
