/*
 * The club's « Courtside » charter, as on the Performance Center: black header
 * with the yellow accent, content on a light background. Light theme only: the
 * pages are read on a phone, in a gym as often as outdoors. Self-hosted Urbanist.
 */

@font-face {
  font-family: Urbanist;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/urbanist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Urbanist;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/urbanist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --yellow: #ffd24d;
  --ink: #121212;
  --bg: #f4f3ef;
  --card: #fff;
  --muted: #5f5f59;
  --rule: #e3e1d9;
  --line: #c9c6bb;
  --red: #b3261e;
  --green: #1d7c32;
  --selected: #fffbea;
  --notice: #fff3c4;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Urbanist, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
}

/* ---- Header ---- */
.header { background: #000; color: #fff; position: sticky; top: 0; z-index: 2; }
.header-inner {
  max-width: 600px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}
.logo { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.brand { font-weight: 800; font-size: 1.05rem; letter-spacing: 0.01em; }
.brand span { color: var(--yellow); }

/* ---- Content ---- */
main { max-width: 600px; margin: 0 auto; padding: 20px 16px 56px; }
h1 { font-size: 1.65rem; line-height: 1.2; margin: 0 0 1rem; font-weight: 800; }
h1::after { content: ""; display: block; width: 3.2rem; height: 4px; background: var(--yellow); margin-top: 0.4rem; }
h2 { font-size: 1.15rem; line-height: 1.3; margin: 2rem 0 0.5rem; font-weight: 800; }
p { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; padding-left: 1.2rem; }
li + li { margin-top: 0.25rem; }
.muted { color: var(--muted); }
.intro { color: var(--muted); }

/* ---- Fields ---- */
.field { margin: 1.25rem 0; }
.field > label:not(.option), legend { display: block; font-weight: 700; margin: 0 0 0.4rem; padding: 0; }
.help { color: var(--muted); font-size: 0.93rem; margin: -0.2rem 0 0.5rem; }
fieldset { border: 0; padding: 0; margin: 1.25rem 0; min-width: 0; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="password"], input[type="search"], textarea {
  font: inherit;
  /* 16 px or more: below that, iOS zooms into the field. */
  font-size: 17px;
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  appearance: none;
}
input[type="date"] { display: block; }
textarea { min-height: 100px; resize: vertical; }
input:disabled, textarea:disabled { background: var(--bg); color: var(--muted); }
input:focus-visible, textarea:focus-visible { outline: 3px solid var(--yellow); outline-offset: 0; border-color: var(--ink); }

.options { display: grid; gap: 8px; }
.options.grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.option {
  display: flex; align-items: center; gap: 12px;
  min-height: 50px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; font-weight: 600;
}
.option input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: #000; }
.option:has(input:checked) { border-color: #000; box-shadow: inset 0 0 0 1px #000; background: var(--selected); }
.option:has(input:focus-visible) { outline: 3px solid var(--yellow); outline-offset: 1px; }
.option.inline { margin-top: 8px; min-height: 44px; font-weight: 600; }
.option-help { display: block; font-weight: 500; color: var(--muted); font-size: 0.92rem; }
/* Short answers (sizes, yes or no) as chips: without the radio circle, « 10/12 ans »
   fits three to a row on a phone. The input stays, hidden, for keyboard and
   screen readers. */
.options.grid .option { position: relative; justify-content: center; text-align: center; padding: 10px 6px; }
.options.grid .option input { position: absolute; opacity: 0; pointer-events: none; }
.options.grid .option:has(input:checked) { background: #000; color: var(--yellow); }

.consent { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 16px; margin: 1rem 0; }
.consent p, .consent ul { font-size: 0.95rem; }
.consent .option { margin-top: 0.75rem; }

.notice {
  background: var(--notice); border-left: 5px solid var(--yellow); border-radius: 8px;
  padding: 12px 14px; margin: 1rem 0; font-size: 0.97rem;
}
.error-text { color: var(--red); font-size: 0.93rem; font-weight: 700; margin: 0.4rem 0 0; }
.has-error input[type="text"], .has-error input[type="email"], .has-error input[type="tel"],
.has-error input[type="date"], .has-error textarea, .has-error .option { border-color: var(--red); }

.total { background: #000; color: #fff; border-radius: 12px; padding: 16px; margin: 1.5rem 0; }
.total .label { color: #bdbdb6; font-size: 0.92rem; font-weight: 700; }
.total strong { display: block; color: var(--yellow); font-size: 1.7rem; line-height: 1.2; }
.total p { margin: 0.5rem 0 0; font-size: 0.95rem; }

/* ---- Buttons ---- */
.actions { display: flex; gap: 10px; margin-top: 2.25rem; }
.button {
  font: inherit; font-weight: 800; cursor: pointer;
  min-height: 52px; padding: 12px 22px;
  border: 2px solid #000; border-radius: 999px;
}
.button.primary { background: #000; color: var(--yellow); flex: 1; }
.button.secondary { background: transparent; color: #000; }
.button:disabled { opacity: 0.55; cursor: default; }
.button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
a.button { display: inline-flex; align-items: center; text-decoration: none; color: #000; }
.link { font: inherit; background: none; border: 0; padding: 8px 0; color: var(--ink); text-decoration: underline; cursor: pointer; }

.alert { background: #fde8e6; color: var(--red); border-radius: 10px; padding: 12px 14px; margin: 1rem 0; font-weight: 600; }
.done-mark {
  width: 56px; height: 56px; border-radius: 50%; background: var(--yellow);
  display: grid; place-items: center; font-size: 1.8rem; font-weight: 900; margin-bottom: 1rem;
}

/* ---- Waiting: a ball dribbling, in the club's yellow ---- */
.loader {
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  margin: 2rem 0; color: var(--muted); font-weight: 700; text-align: center;
}
.dribble { position: relative; width: 52px; height: 96px; }
/* Its shadow on the floor, wider and darker as the ball comes down. */
.dribble::after {
  content: ""; position: absolute; left: 2px; right: 2px; bottom: 0; height: 8px;
  border-radius: 50%; background: var(--ink); opacity: 0.3;
  animation: ball-shadow 0.9s infinite;
}
.ball {
  position: absolute; left: 0; bottom: 4px; width: 52px; height: 52px;
  transform-origin: 50% 100%; animation: ball-bounce 0.9s infinite;
}
/* Apart from the bounce, so that the seams turn while the ball squashes. */
.ball::before {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='46' fill='%23ffd24d' stroke='%23121212' stroke-width='5'/%3E%3Cpath d='M50 4v92M4 50h92M17 18q27 32 0 64M83 18q-27 32 0 64' fill='none' stroke='%23121212' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: ball-spin 2.7s linear infinite;
}
@keyframes ball-bounce {
  0%, 100% { transform: translateY(-40px) scale(1, 1); animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  46% { transform: translateY(0) scale(1, 1); animation-timing-function: ease-out; }
  54% { transform: translateY(0) scale(1.15, 0.82); animation-timing-function: ease-in; }
  62% { transform: translateY(-6px) scale(0.95, 1.05); animation-timing-function: cubic-bezier(0, 0.55, 0.45, 1); }
}
@keyframes ball-shadow {
  0%, 100% { transform: scaleX(0.45); opacity: 0.1; animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  46%, 54% { transform: scaleX(1); opacity: 0.3; }
  62% { transform: scaleX(0.9); opacity: 0.26; animation-timing-function: cubic-bezier(0, 0.55, 0.45, 1); }
}
@keyframes ball-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ball, .ball::before, .dribble::after { animation: none; }
}


/* ---- Cards ---- */
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 16px; margin: 1rem 0; }
.card.narrow { max-width: 420px; margin: 2rem auto; }
.card > h2:first-child { margin-top: 0; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h2 { display: inline; margin: 0; }
details.card > summary::before { content: "▸ "; font-weight: 800; }
details.card[open] > summary::before { content: "▾ "; }
.feedback { font-weight: 700; margin: 0.75rem 0 0; min-height: 1.5em; }
.unsaved { color: #6d5400; background: var(--notice); border-radius: 8px; padding: 6px 12px; margin: 0.75rem 0 0; font-weight: 700; max-width: 640px; }
.small { font-size: 0.85rem; }
.button.small { min-height: 40px; padding: 6px 16px; font-size: 0.9rem; }
.button.small.secondary { background: var(--card); }
select {
  font: inherit; font-size: 16px; min-height: 44px; padding: 8px 12px; max-width: 100%;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink);
}
.add-file {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 10px 14px; margin-top: 0.5rem;
  border: 2px dashed var(--line); border-radius: 10px; font-weight: 700; cursor: pointer;
}
.add-file:has(input:focus-visible) { outline: 3px solid var(--yellow); }
.add-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---- Back office ---- */
.admin main { max-width: 1180px; }
.admin .header-inner { max-width: 1180px; }
.admin form .field, .admin form fieldset, .admin form .actions { max-width: 640px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 1rem; }
.toolbar h1 { margin: 0; }
.toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.switch {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px;
  background: var(--card); border: 1px solid var(--rule); border-left: 6px solid var(--red);
  border-radius: 12px; padding: 12px 16px; margin: 0 0 1rem;
}
.switch.open { border-left-color: var(--green); }
.switch.draft { border-left-color: var(--line); }
.switch-state { font-weight: 800; }
.variants { list-style: none; padding: 0; margin: 0 0 0.75rem; display: grid; gap: 8px; }
.variant { display: flex; align-items: center; gap: 8px; margin: 0; }
.variant input { flex: 1; min-height: 44px; }
.icon {
  font: inherit; font-weight: 800; width: 40px; height: 40px; flex: none;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); cursor: pointer;
}
.icon:disabled { opacity: 0.35; cursor: default; }
.visuals-admin { display: flex; flex-wrap: wrap; gap: 12px; margin: 0.5rem 0; }
.visuals-admin figure { margin: 0; width: 160px; display: grid; gap: 6px; }
.visuals-admin img { width: 160px; height: 200px; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule); background: var(--bg); }

/* ---- Public page ---- */
.pre-line { white-space: pre-line; }
.posters { display: grid; gap: 10px; margin: 0 0 1.5rem; }
/* Two posters or more side by side, even on a phone: the evening's details
   stay within reach, a tap opens a poster full size. */
.posters.several { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.posters a { display: block; }
.poster { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--card); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 0 0 1.5rem; }
.facts dt { font-weight: 800; color: var(--muted); }
.facts dd { margin: 0; display: grid; gap: 2px; }
.counters { display: grid; gap: 8px; }
.counter {
  display: grid; grid-template-columns: 1fr 52px 44px 52px; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 14px;
}
.counter-label { font-weight: 700; }
.step {
  font: inherit; font-size: 1.5rem; font-weight: 800; line-height: 1;
  width: 52px; height: 52px; border-radius: 50%; border: 2px solid #000; background: var(--card); color: #000; cursor: pointer;
}
.step:last-child { background: #000; color: var(--yellow); }
.step:disabled { opacity: 0.3; cursor: default; }
.step:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.count { text-align: center; font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.has-error .counter { border-color: var(--red); }
.recap-items { list-style: none; padding: 0; margin: 0; }
.recap-items li { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--rule); }
.preparation { text-align: center; padding-top: 1rem; }
.preparation h1::after { margin-left: auto; margin-right: auto; }
.preparation-logo { width: 160px; height: 160px; border-radius: 50%; margin: 1rem auto 1.5rem; display: block; }
.preparation .poster { margin-bottom: 1.5rem; }
.summary { font-weight: 700; color: var(--muted); }
.search { flex: 1; min-width: 180px; min-height: 44px !important; padding: 8px 12px !important; }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 12px; margin-top: 1rem; }
table.reservations, table.totals { border-collapse: collapse; font-size: 0.95rem; }
table.reservations { width: 100%; min-width: 760px; }
table.totals { margin: 0 0 1rem; min-width: 280px; }
.reservations th, .reservations td, .totals th, .totals td { text-align: left; vertical-align: middle; padding: 8px 12px; border-bottom: 1px solid var(--rule); }
.reservations thead th, .totals thead th { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--bg); }
.totals tfoot th { border-bottom: 0; }
.reservations tbody tr:last-child > * { border-bottom: 0; }
.reservations .name { font-weight: 800; }
.reservations td.paid { color: var(--green); font-weight: 800; }
.reservations tr.cancelled td { color: var(--muted); }
.reservations tr.cancelled .name { text-decoration: line-through; }
.dialog { width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 24px); border: 0; border-radius: 14px; padding: 20px; }
.dialog::backdrop { background: rgb(0 0 0 / 0.55); }
.dialog h2 { margin-top: 0; }
.quantities { display: grid; gap: 8px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.quantity-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; }
.quantity { font: inherit; font-size: 17px; width: 90px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }

/* ---- Service ---- */
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--yellow); }
.link.light { color: #fff; font-size: 0.9rem; }
.offline { background: var(--red); color: #fff; font-weight: 700; text-align: center; padding: 8px 16px; font-size: 0.95rem; }
.search-bar { position: sticky; top: 60px; z-index: 1; background: var(--bg); padding: 8px 0; margin: 0 -2px; }
.list-head h1 { margin-bottom: 0.25rem; }
.results { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 8px; }
.results li + li { margin-top: 0; }
.result {
  font: inherit; color: var(--ink); text-align: left; cursor: pointer; width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 64px;
}
.result:focus-visible { outline: 3px solid var(--yellow); }
.result-main { display: grid; gap: 6px; min-width: 0; }
.result-name { font-weight: 800; font-size: 1.05rem; }
.phone-end { color: var(--muted); font-weight: 600; }
.result.cancelled .result-name { text-decoration: line-through; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 0.85rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--rule); }
.chip.done { background: #dcefdf; color: var(--green); border-color: #dcefdf; }
.pill { flex: none; font-size: 0.85rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--rule); white-space: nowrap; }
.pill.done { background: #dcefdf; color: var(--green); }
.pill.due { background: var(--notice); color: #6d5400; }
.pay-lines { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 8px; }
.pay-lines li + li { margin-top: 0; }
.pay-line {
  display: grid; grid-template-columns: 1fr 56px 56px; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 10px 10px 14px;
}
.pay-line.done { border-color: var(--green); box-shadow: inset 4px 0 0 var(--green); }
.pay-text { display: grid; }
.pay-line .step { width: 56px; height: 56px; }
.button.wide { display: block; width: 100%; margin-top: 10px; }
.pay-all { min-height: 60px; font-size: 1.1rem; }
.detail .chips { margin: 0 0 1rem; }
.detail .help { margin: 1rem 0 0; }
.paid-all { background: #dcefdf; color: var(--green); font-weight: 800; font-size: 1.15rem; border-radius: 12px; padding: 16px; margin: 1.5rem 0 0.5rem; }
.toast {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px)); background: #000; color: #fff; font-weight: 700;
  border-radius: 12px; padding: 12px 16px; z-index: 3; box-shadow: 0 6px 24px rgb(0 0 0 / 0.25);
}
