/* charliebieger-booking — one stylesheet, light only.

   THE SCALE. Everything is set from these few sizes, so the page reads as one
   thing: type 12.5 / 13.5 / 15 / 17 / 22, spacing in steps of 4 (8, 12, 16,
   24, 32), fields 40 tall, the main button 44, secondary buttons 40, corners
   10 on fields and 20 on the card. */
:root {
  color-scheme: light;
  --ground: #f5f5f3;
  --card: #ffffff;
  --ink: #141413;
  --soft: #6b6b66;
  --line: #e3e3de;
  --wash: #f3f3ef;
  --open: #ecece7;
  --accent: #141413;
  --on-accent: #ffffff;
  --danger: #b3261e;
  --ok: #1f7a4d;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --field: 40px;
  --pane: 524px;           /* the height every step shares on a laptop or wider */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, p, ul { margin: 0; }
a { color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h2[tabindex="-1"]:focus { outline: none; }
:is(select, input, textarea, button, a):focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* --------------------------------------------------------------- card */
.card {
  width: 100%;
  max-width: 940px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 40px rgba(0, 0, 0, .05);
  overflow: hidden;
}

/* ---------------------------------------------------------------- who */
.who { padding: 32px 28px; border-right: 1px solid var(--line); min-width: 0; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  font-weight: 600; letter-spacing: .02em; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.host { margin-top: 16px; font-size: 14px; color: var(--soft); font-weight: 500; }
h1 { margin-top: 2px; font-size: 22px; line-height: 1.2; letter-spacing: -.02em; font-weight: 650; text-wrap: balance; }
.facts { list-style: none; padding: 0; margin-top: 20px; display: grid; gap: 10px; font-size: 14px; color: var(--soft); }
.facts li { display: flex; gap: 10px; align-items: flex-start; }
.facts svg { margin-top: 1.5px; }
#fact-when { color: var(--ink); font-weight: 550; }

/* -------------------------------------------------------------- panes */
.pane { padding: 28px 32px; min-width: 0; }
h2 { font-size: 17px; line-height: 1.3; letter-spacing: -.01em; font-weight: 650; }
.pane p { color: var(--soft); max-width: 52ch; }
.pane > p + p { margin-top: 8px; }
.quiet { color: var(--soft); }
.lead { margin-top: 8px; font-size: 17px; font-weight: 550; }
.pane p.lead, .pane p.month, .pane p.day { color: var(--ink); }
.notice { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--wash); color: var(--ink) !important; font-size: 14px; }
.error { color: var(--danger) !important; font-weight: 500; font-size: 14px; }
.hint { font-size: 12.5px; color: var(--soft); margin: 0; }
.pane .hint { max-width: none; }
.row { margin-top: 20px !important; display: flex; flex-wrap: wrap; gap: 8px; max-width: none !important; }

/* ------------------------------------------------------------ buttons */
.primary {
  height: 44px; padding: 0 22px; border: 0; border-radius: 999px;
  font: 600 15px/1 var(--font); white-space: nowrap; cursor: pointer;
  background: var(--accent); color: var(--on-accent);
  transition: background-color .15s, transform .1s;
}
.primary:hover:not(:disabled) { background: #2b2b29; }
.primary:active:not(:disabled) { transform: scale(.98); }
.primary:disabled { opacity: .55; cursor: default; }
.ghost {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  font: 600 14px/1 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.ghost:hover:not(:disabled) { border-color: var(--ink); }
.ghost.danger { color: var(--danger); }
.ghost.small { height: 34px; padding: 0 12px; font-size: 13.5px; }
.ghost:disabled { opacity: .55; cursor: default; }
.textbtn {
  border: 0; background: none; padding: 6px 0; cursor: pointer;
  font: 500 13.5px/1 var(--font); color: var(--soft);
  text-decoration: underline; text-underline-offset: 3px; transition: color .15s;
}
.textbtn:hover { color: var(--ink); }
.nav, .back.icon {
  width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; background: transparent; color: var(--ink); cursor: pointer;
  transition: background-color .15s;
}
.nav:hover:not(:disabled), .back:hover { background: var(--wash); }
.nav:disabled { color: var(--line); cursor: default; }
.back {
  display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px 0 6px; margin-left: -8px;
  border: 0; border-radius: 999px; background: transparent; color: var(--soft);
  font: 500 14px/1 var(--font); cursor: pointer; transition: background-color .15s, color .15s;
}
.back:hover { color: var(--ink); }
.back.icon { margin-left: 0; }

/* ------------------------------------------------------------- fields */
select, input, textarea {
  width: 100%; height: var(--field); padding: 0 12px;
  font: 15px/1.4 var(--font); color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s;
}
textarea { padding: 9px 12px; resize: none; overflow: hidden; }
:is(select, input, textarea):hover { border-color: #cfcfc9; }
:is(select, input, textarea):focus { outline: none; border-color: var(--ink); }
/* A field the browser filled in looks like any other field, not a yellow one. */
:is(input, textarea, select):-webkit-autofill,
:is(input, textarea, select):-webkit-autofill:hover,
:is(input, textarea, select):-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--card) inset;
  box-shadow: 0 0 0 1000px var(--card) inset;
  caret-color: var(--ink);
  transition: background-color 9999s ease-out 0s;
}
:is(input, textarea, select):autofill { background-color: var(--card) !important; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--soft) 50%), linear-gradient(135deg, var(--soft) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
input[type="radio"], input[type="checkbox"] { width: 16px; height: 16px; padding: 0; margin: 0; flex: none; accent-color: var(--accent); }
form label, label.reason { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; min-width: 0; }
.opt { font-size: 12.5px; font-weight: 400; color: var(--soft); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --------------------------------------------------------------- pick */
/* Two columns from the start: the times column is there before a day is
   chosen, so choosing one never resizes or moves the calendar. */
.pick { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 28px; }
.cal { max-width: 372px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.month { font-weight: 600; }
.dow, .grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.dow { margin-top: 10px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); text-align: center; }
.grid { margin-top: 6px; }
.grid > * { width: 80%; justify-self: center; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; font-size: 14px; font-variant-numeric: tabular-nums; }
.grid.six { gap: 2px 4px; }
.grid.six > * { width: 68%; }
.grid span { color: var(--soft); opacity: .55; }
.grid span.today { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.grid button {
  border: 0; padding: 0; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--open); color: var(--ink);
  transition: background-color .15s, color .15s;
}
.grid button:hover { background: #dedfd8; }
.grid button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.tz { display: grid; gap: 6px; margin-top: 16px; font-size: 12.5px; font-weight: 400; color: var(--soft); }

.times { min-width: 0; }
.times .day { font-weight: 600; line-height: 36px; }
.times.empty { padding-top: 46px; font-size: 14px; }
/* The list scrolls inside the card on a long day. The side padding is room
   for the buttons' focus ring, so nothing is clipped at the edge. */
.time-list { margin-top: 10px; display: grid; gap: 8px; align-content: start; overflow-y: auto; padding: 2px 4px 2px 2px; scrollbar-width: thin; }
.time-list button {
  height: 42px; padding: 0 12px; border-radius: 10px; cursor: pointer;
  font: 600 14.5px/1 var(--font); font-variant-numeric: tabular-nums;
  background: transparent; color: var(--ink); border: 1px solid var(--line);
  transition: border-color .15s, background-color .15s;
}
.time-list button:hover { border-color: var(--ink); background: var(--wash); }

/* ------------------------------------------------------------ details */
.head { display: flex; align-items: center; gap: 4px; margin-left: -8px; }
.head h2 { flex: 1; }
form { margin-top: 14px; display: grid; gap: 14px; max-width: 560px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-width: 0; }
.pair.topic { grid-template-columns: 2fr 1fr; }
.pair.where { grid-template-columns: minmax(210px, 1fr) 1.3fr; }
fieldset.mode { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 6px; }
fieldset.mode legend { padding: 0; margin-bottom: 6px; font-size: 13.5px; font-weight: 600; }
#modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
form label.choice {
  display: flex; align-items: center; gap: 10px; height: var(--field); padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
form label.choice:has(input:checked) { border-color: var(--ink); background: var(--wash); }
form label.choice:has(input:disabled) { opacity: .5; cursor: default; }
/* The row under the choice is always the same height: for Online it is a
   line of text, for In person the two fields. Switching swaps its contents
   and moves nothing else. */
.slot { display: grid; gap: 6px; }
.slot-label { font-size: 13.5px; font-weight: 600; }
.static { display: flex; align-items: center; height: var(--field); padding: 0 12px; margin: 0; max-width: none !important;
  border-radius: 10px; background: var(--wash); color: var(--soft); font-size: 14px; }
.send { display: grid; gap: 10px; justify-items: start; margin-top: 2px; }
.fine { font-size: 12.5px; margin: 0; }
label.reason { max-width: 420px; margin-top: 16px; }
.guest-rows { display: grid; gap: 12px; margin-top: 16px; max-width: 560px; }
.guest-row { display: grid; grid-template-columns: 1fr 1fr 36px; gap: 12px; align-items: center; }
.guest-row .nav { color: var(--soft); }
.guest-row .nav:hover { color: var(--ink); }
#guest-add { margin-top: 12px; }
#view-guests .hint { margin-top: 6px; }
#view-guests .error { margin-top: 12px; }

/* --------------------------------------------------------------- done */
.tick { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 16px;
  background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.tick svg { width: 22px; height: 22px; stroke-width: 2; }
.noscript { text-align: center; color: var(--soft); }

/* ================================================================ layout
   LAPTOP AND WIDER (two columns). One card size: every step is the height of
   the date picker, laid out to fit with nothing scrolling but a long list of
   times. */
@media (min-width: 980px) and (min-height: 560px) {
  .card { height: var(--pane); }
  .pane { overflow: hidden; }
  .time-list { max-height: calc(var(--pane) - 150px); }
}

/* HALF A SCREEN (one column, but still a desktop). The details panel becomes
   a strip across the top, and the step below keeps the same fixed size, with
   the calendar and its times still side by side. */
@media (min-width: 600px) and (max-width: 979px) {
  .card { grid-template-columns: minmax(0, 1fr); max-width: 720px; }
  .who {
    border-right: 0; border-bottom: 1px solid var(--line); padding: 20px 28px;
    display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; align-items: center;
  }
  .avatar { grid-row: 1 / span 2; width: 48px; height: 48px; }
  .host { margin-top: 0; }
  h1 { font-size: 19px; }
  .facts { grid-column: 1 / -1; margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 20px; }
  .pane { padding: 24px 28px; }
  /* The calendar takes what the times column leaves, so a narrow window
     shrinks both a little and neither is left floating in empty space. */
  .cal { max-width: 372px; }
  .pick { grid-template-columns: minmax(0, 372px) minmax(132px, 1fr); gap: 24px; }
}
@media (min-width: 600px) and (max-width: 979px) and (min-height: 640px) {
  .pane { height: var(--pane); overflow: hidden; }
  .time-list { max-height: calc(var(--pane) - 150px); }
  /* The short steps (booked, moved, cancelled, an error) are only as tall as
     what they say. Stacked under the strip, a full-height box would be mostly
     empty; the flow is over by then, so the card can close up around them. */
  .card #view-manage, .card #view-move, .card #view-error { height: auto; padding-top: 36px; padding-bottom: 40px; justify-content: flex-start; }
  /* Room is kept for the chosen time's line, so the strip (and with it the
     card) is the same height before and after a time is picked. */
  .facts { min-height: 50px; align-content: start; }
}

/* BOTH DESKTOP LAYOUTS: the steps are set to fit their box. */
@media (min-width: 600px) {
  /* The short steps sit in the middle of the box, not stranded at its top. */
  #view-manage, #view-move, #view-error, #view-loading { display: flex; flex-direction: column; justify-content: center; padding-bottom: 56px; }
  #view-move .back { align-self: flex-start; }
}

/* PHONES. Everything stacks at its natural height and the page scrolls. */
@media (max-width: 599px) {
  body { padding: 16px 12px; place-items: start center; }
  .card { grid-template-columns: minmax(0, 1fr); }
  .who { border-right: 0; border-bottom: 1px solid var(--line); padding: 22px 20px; }
  .pane { padding: 22px 20px 26px; }
  /* 16px fields: anything smaller makes iOS zoom the page on focus. */
  select, input, textarea { font-size: 16px; }
  :root { --field: 44px; }
  .nav { width: 44px; height: 44px; }
  /* The calendar is as wide as the screen allows; the circles stop growing
     at a comfortable size and no further. */
  .cal { max-width: none; }
  .grid > * { width: min(84%, 52px); font-size: 15px; }
  .grid button { font-size: 15px; }
  .pick { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .times.empty { display: none; }
  .times { scroll-margin-top: 16px; }
  .time-list { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); overflow: visible; padding: 0; }
  .time-list button { height: 46px; }
  form { gap: 16px; margin-top: 16px; }
  .primary { width: 100%; height: 48px; }
  .row .ghost { flex: 1; }
}
@media (max-width: 520px) {
  .pair, .pair.topic, .pair.where { grid-template-columns: minmax(0, 1fr); }
  .guest-row { grid-template-columns: minmax(0, 1fr) 36px; }
  .guest-row input:first-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); place-items: start stretch; background: var(--card); }
  .card { border: 0; border-radius: 0; box-shadow: none; }
}

/* ================================================================ motion
   Almost none, on purpose. A step fades in when you arrive at it, the tick
   draws once when a booking is made, and controls change colour under the
   pointer. Nothing slides, bounces, staggers or replays while you are using
   the form, and all of it is off for anyone who has asked for less motion. */
@media (prefers-reduced-motion: no-preference) {
  .pane.enter { animation: arrive .22s ease-out both; }
  #view-manage.enter .tick path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .4s ease-out .15s forwards; }
  @keyframes arrive { from { opacity: 0; } }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
