:root {
  --red: #ea0015;          /* Volenti emblem */
  --red-strong: #c80012;   /* text and buttons: 6.0:1 on white */
  --red-tint: #fdecee;
  --ink: #14171c;
  --muted: #525a66;
  --line: #d9dde3;
  --bg: #f4f5f7;
  --card: #ffffff;
  --ok: #0d6e3a;
  --ok-tint: #e7f4ec;
  --warn: #8a4b00;
  --warn-tint: #fff4e0;
  --focus: #1a56db;
  --radius: 14px;
  --head: "Barlow Semi Condensed", "Arial Narrow", Arial, sans-serif;
  --body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--body);
}
img { max-width: 100%; }
h1, h2 { font-family: var(--head); font-weight: 700; line-height: 1.15; margin: 0 0 .5rem; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; margin-top: 1.75rem; }
p { margin: 0 0 .75rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1:focus, main:focus { outline: none; }

.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 16px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip { position: absolute; left: 16px; top: -48px; padding: .5rem .75rem; background: var(--ink); color: #fff; border-radius: 8px; z-index: 10; }
.skip:focus { top: 8px; }

/* Header and footer */
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top__inner { display: flex; align-items: center; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.top__logo { width: 44px; height: 44px; flex: none; }
.top__name { margin: 0; font: 700 1.2rem/1.1 var(--head); letter-spacing: .02em; text-transform: uppercase; }
.top__sub { margin: 0; color: var(--muted); font-size: .875rem; }

main.wrap { flex: 1; padding-top: 24px; padding-bottom: 32px; }
.foot { border-top: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: .8125rem; padding: 16px 0 20px; }
.foot p { margin: 0 0 .25rem; }

/* Panels */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel + .panel, .panel--gap { margin-top: 16px; }
.panel--center { text-align: center; padding: 40px 20px; color: var(--muted); }
.lead { color: var(--muted); }
.icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 12px; font-weight: 700; font-size: 1.5rem; }
.icon--ok { background: var(--ok-tint); color: var(--ok); }
.icon--info { background: var(--red-tint); color: var(--red-strong); }
.icon--neutral { background: #eef0f3; color: var(--ink); }

.spinner {
  display: inline-block; width: 32px; height: 32px; margin-bottom: 12px;
  border: 3px solid var(--line); border-top-color: var(--red); border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* Alerts */
.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid; }
.alert p { margin: 0; }
.alert--warn { background: var(--warn-tint); border-color: #f0c98a; color: var(--warn); }
.alert--error { background: var(--red-tint); border-color: #f3b3ba; color: #8f000d; }

/* Booked summary */
.booked { border: 2px solid var(--ok); background: var(--ok-tint); border-radius: var(--radius); padding: 16px 18px; }
.booked__label { margin: 0 0 .25rem; color: var(--ok); font-weight: 600; font-size: .875rem; text-transform: uppercase; letter-spacing: .04em; }
.booked__when { margin: 0; font: 700 1.25rem/1.2 var(--head); }
.booked__slot { margin: .15rem 0 .75rem; color: var(--ink); }

/* Proposed date (series links) */
.proposal { margin: 16px 0 0; border: 2px solid var(--red-strong); border-radius: var(--radius); padding: 16px 18px; background: #fffafa; }
.proposal__label { margin: 0 0 .25rem; color: var(--red-strong); font-weight: 600; font-size: .875rem; text-transform: uppercase; letter-spacing: .04em; }
.proposal__when { margin: 0; font: 700 1.5rem/1.15 var(--head); }
.proposal__time { margin: .1rem 0 0; font: 700 1.25rem/1.2 var(--head); }
.proposal__venue { margin: .5rem 0 0; color: var(--muted); }
.proposal .proposal__places { display: inline-block; margin: .75rem 0 0; }
.h2--flush { margin-top: 0; }

/* Session list */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
.options { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.option { position: relative; }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option label {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; min-height: 64px;
}
.option label:hover { border-color: #aab1bb; }
.option input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.option input:checked + label { border-color: var(--red-strong); box-shadow: 0 0 0 1px var(--red-strong); background: #fffafa; }
.radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #8a929c; grid-column: 1; grid-row: 1 / span 3; display: grid; place-items: center; }
.option input:checked + label .radio { border-color: var(--red-strong); }
.option input:checked + label .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--red-strong); }
.option__when { font-weight: 600; grid-column: 2; grid-row: 1; }
.option__slot { color: var(--muted); font-size: .9375rem; grid-column: 2; grid-row: 2; }
.places { grid-column: 2; grid-row: 3; justify-self: start; margin-top: 2px; font-size: .8125rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #eef0f3; color: var(--ink); white-space: nowrap; }
.places--low { background: var(--warn-tint); color: var(--warn); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn {
  appearance: none; border: 2px solid transparent; border-radius: 10px; cursor: pointer;
  font: 600 1rem/1.2 var(--body); padding: 13px 20px; min-height: 48px; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn--primary { background: var(--red-strong); color: #fff; }
.btn--primary:hover { background: #a8000f; }
.btn--secondary { background: var(--card); color: var(--ink); border-color: #9aa1ab; }
.btn--secondary:hover { border-color: var(--ink); }
.btn--danger { background: var(--card); color: var(--red-strong); border-color: var(--red-strong); }
.btn--danger:hover { background: var(--red-tint); }
.btn[aria-disabled="true"] { opacity: .65; cursor: progress; }
.btn--block { width: 100%; }

.confirm-bar { position: sticky; bottom: 0; margin: 16px -20px -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-radius: 0 0 var(--radius) var(--radius); background: rgba(244, 245, 247, .96); border-top: 1px solid var(--line); }
.confirm-bar p { margin: 0 0 8px; font-size: .875rem; color: var(--muted); }

/* Confirmation details */
.details { margin: 16px 0; padding: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.details div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.details div:first-child { border-top: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.cancel-box { margin-top: 10px; }
.booked .cancel-box { margin-top: 0; }
.ask { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--red-tint); }
.ask p { margin-bottom: 0; font-weight: 600; }

@media (min-width: 560px) {
  h1 { font-size: 2rem; }
  .panel { padding: 28px; }
  .confirm-bar { position: static; margin: 20px 0 0; padding: 0; background: none; border: 0; }
  .btn--block { width: auto; }
  .option label { grid-template-columns: auto 1fr auto; }
  .radio { grid-row: 1 / span 2; }
  .places { grid-column: 3; grid-row: 1 / span 2; justify-self: end; margin-top: 0; }
}
@media (max-width: 380px) {
  .details div { grid-template-columns: 1fr; gap: 0; }
}
