/* Booking page: one card. A forest-green host panel on the left, the day-and-time picker on the right.
   Type: the device's own fonts (SF Pro and the New York serif on Apple devices).
   Color: mint page, white card, greens for anything you can book. */

:root {
  color-scheme: light;
  --page: #ddeee7;        /* mint page */
  --surface: #ffffff;     /* card */
  --forest: #1f3d34;      /* host panel, selected day, primary buttons */
  --on-forest: #f1f8f5;   /* text on forest */
  --on-forest-muted: #a9c9bd;
  --pine: #2d6a56;        /* open days, times, links */
  --mint: #dcf1e9;        /* open-day fill */
  --mint-soft: #eef8f4;   /* hovers */
  --ink: #17231f;         /* text */
  --muted: #5d6e67;       /* secondary text */
  --line: #dbe5e1;        /* dividers, borders */
  --sage: #6b8a7f;        /* a chosen time waiting for Next */
  --danger: #b42318;
  --sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --r-small: 10px;        /* days, times, buttons, fields */
  --r-card: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0c1512;
    --surface: #14201c;
    --forest: #0f2a22;
    --on-forest: #e3f1eb;
    --on-forest-muted: #8fb3a6;
    --pine: #8fd6bd;
    --mint: #1d3a31;
    --mint-soft: #182e27;
    --ink: #e4efea;
    --muted: #9db0a8;
    --line: #26372f;
    --sage: #4f6b61;
    --danger: #ff8a80;
  }
}

* { box-sizing: border-box; }

/* `hidden` must win over any display rule below. */
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; color: inherit; }

svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 3px solid var(--pine);
  outline-offset: 2px;
}

.page {
  max-width: 1060px;
  margin: 0 auto;
  padding: 56px 24px 32px;
}

/* ---- the card */

.card {
  display: grid;
  grid-template-columns: 300px 1fr;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: 0 1px 2px rgb(16 40 32 / 0.06), 0 24px 48px -28px rgb(16 40 32 / 0.45);
  min-height: 560px;
  overflow: hidden;
}

/* ---- host panel: the dark green side */

.host {
  position: relative;
  padding: 32px 28px;
  background: var(--forest);
  color: var(--on-forest);
}

.back {
  position: absolute;
  top: 22px;
  left: 20px;
  width: 38px;
  height: 38px;
  border-radius: var(--r-small);
  border: 1px solid rgb(255 255 255 / 0.18);
  background: rgb(255 255 255 / 0.06);
  color: var(--on-forest);
  display: grid;
  place-items: center;
}
.back:hover { background: rgb(255 255 255 / 0.14); }
.back:not([hidden]) ~ .avatar { margin-top: 50px; }

.avatar {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--mint);
  color: var(--forest);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}

@media (prefers-color-scheme: dark) {
  .avatar { background: #24473b; color: var(--on-forest); }
}

.host-name {
  margin: 0 0 4px;
  color: var(--on-forest-muted);
  font-weight: 600;
  font-size: 15px;
}

.event-name {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.12;
  font-weight: 500;
}

.facts {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}
.facts li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--on-forest-muted);
  font-weight: 500;
  margin-bottom: 10px;
}
.facts svg { margin-top: 2px; }
#fact-when, #fact-tz { color: var(--on-forest); font-weight: 600; }

.intro {
  margin: 0;
  color: var(--on-forest);
  max-width: 34ch;
  font-size: 15px;
}

/* ---- right side panels */

.panel {
  padding: 32px 32px 28px;
  min-width: 0;
}

.panel h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  margin: 0 0 22px;
}

/* ---- picker: month calendar + that day's times */

.pick-body {
  display: grid;
  grid-template-columns: minmax(0, 380px);
  gap: 28px;
}
/* Times sit beside the calendar on wide screens and drop below it on narrower ones. */
@media (min-width: 1000px) {
  .pick-body.with-times { grid-template-columns: minmax(0, 380px) minmax(200px, 1fr); }
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.month { font-size: 17px; font-weight: 600; }
.cal-nav { display: flex; gap: 6px; }

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: var(--r-small);
  border: none;
  background: var(--mint-soft);
  color: var(--pine);
  display: grid;
  place-items: center;
}
.icon-button:hover:not(:disabled) { background: var(--mint); }
.icon-button:disabled { background: none; color: var(--line); cursor: default; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
}
.cal-grid .dow {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding-bottom: 4px;
}
.cal-grid .day {
  position: relative;
  width: 100%;
  height: 46px;
  border-radius: var(--r-small);
  border: none;
  background: none;
  font-size: 16px;
  color: var(--muted);
  display: grid;
  place-items: center;
}
.cal-grid .day.open {
  background: var(--mint);
  color: var(--pine);
  font-weight: 700;
}
.cal-grid .day.open:hover { background: var(--pine); color: var(--surface); }
.cal-grid .day[aria-pressed="true"] { background: var(--forest); color: var(--on-forest); }
.cal-grid .day:disabled { cursor: default; }
.cal-grid .day.today::after {
  content: "";
  position: absolute;
  bottom: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.tz {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  color: var(--muted);
}
.tz select {
  font: inherit;
  color: var(--ink);
  background: none;
  border: none;
  padding: 4px 0;
  max-width: 100%;
  cursor: pointer;
}

.times h3 {
  margin: 6px 0 16px;
  font-size: 16px;
  font-weight: 600;
}
.time-list {
  list-style: none;
  margin: 0;
  padding: 0 4px 0 0;
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
}
.time-list li { display: flex; gap: 8px; }
.time-list li:has(.next) { grid-column: 1 / -1; }   /* the chosen time and Next share a full row */
.time {
  flex: 1;
  height: 48px;
  border-radius: var(--r-small);
  border: 1px solid color-mix(in srgb, var(--pine) 40%, transparent);
  background: var(--surface);
  color: var(--pine);
  font-weight: 650;
  font-size: 16px;
}
.time:hover { background: var(--mint-soft); border-color: var(--pine); }
.time.chosen { background: var(--sage); border-color: var(--sage); color: #ffffff; }
.next {
  flex: 1;
  height: 48px;
  border-radius: var(--r-small);
  border: none;
  background: var(--forest);
  color: var(--on-forest);
  font-weight: 650;
}

.empty { color: var(--muted); margin: 0; }

/* ---- details form */

.details { max-width: 560px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 15px; }
.field input, .field textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-small);
}
.field input:focus, .field textarea:focus { border-color: var(--pine); }
textarea { resize: vertical; min-height: 84px; }
.opt { font-weight: 400; color: var(--muted); }

.how { border: none; padding: 0; margin: 4px 0 16px; }
.how legend { font-weight: 600; font-size: 15px; padding: 0; margin-bottom: 8px; }
.choice { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.choice input { margin: 0; accent-color: var(--pine); }

.ts { min-height: 66px; margin: 4px 0 8px; }
.error { color: var(--danger); min-height: 1.5em; margin: 0 0 12px; }

.primary {
  background: var(--forest);
  color: var(--on-forest);
  border: none;
  border-radius: var(--r-small);
  padding: 13px 24px;
  font-weight: 650;
}
.primary:hover:not(:disabled) { background: var(--pine); }
.primary:disabled { opacity: 0.6; cursor: progress; }

.ghost {
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--r-small);
  padding: 12px 22px;
}
.ghost.danger { color: var(--danger); }

@media (prefers-color-scheme: dark) {
  .primary, .next { background: var(--pine); color: var(--forest); }
  .primary:hover:not(:disabled) { background: #a9e3cf; }
  .cal-grid .day[aria-pressed="true"] { background: var(--pine); color: var(--forest); }
  .cal-grid .day.open:hover { color: var(--forest); }
}

/* ---- confirmation and status */

.note p { margin: 0 0 12px; max-width: 60ch; }
.note a { color: var(--pine); text-underline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

/* One deliberate moment: the times column settles in when you pick a day. */
@media (prefers-reduced-motion: no-preference) {
  .times.arrive { animation: arrive 220ms ease-out; }
  @keyframes arrive { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
}

.foot {
  margin-top: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---- narrower screens */

@media (max-width: 999px) {
  .time-list { max-height: none; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

@media (max-width: 860px) {
  .card { grid-template-columns: 1fr; min-height: 0; }
  .host { padding: 24px 20px; }
}

@media (max-width: 480px) {
  .page { padding: 16px 12px 24px; }
  .panel { padding: 24px 16px; }
  .cal-grid { gap: 4px; }
  .cal-grid .day { height: 42px; }
}
