/* Palette mirrors the confirmation email (indigo accent). Light-mode greys
   are #6b7280 or darker so small text clears WCAG AA (4.5:1). */
:root {
  color-scheme: light dark;
  --bg: #f3f4f6;
  --card: #ffffff;
  --fg: #111827;
  --muted: #6b7280;
  --disabled: #9ca3af;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-text: #4338ca;
  --accent-soft: #eef2ff;
  --accent-border: #c7d2fe;
  --ring: rgba(79, 70, 229, 0.4);
  --danger: #b91c1c;
  --danger-hover: #991b1b;
  --ok-bg: #ecfdf5;
  --ok-fg: #065f46;
  --err-bg: #fef2f2;
  --err-fg: #991b1b;
  --warn-bg: #fffbeb;
  --warn-fg: #78350f;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f19;
    --card: #111827;
    --fg: #f9fafb;
    --muted: #9ca3af;
    --disabled: #4b5563;
    --border: #1f2937;
    --border-strong: #374151;
    --accent-hover: #6366f1;
    --accent-text: #a5b4fc;
    --accent-soft: #1e1b4b;
    --accent-border: #3730a3;
    --ring: rgba(165, 180, 252, 0.5);
    --ok-bg: #052e22;
    --ok-fg: #a7f3d0;
    --err-bg: #3b1212;
    --err-fg: #fecaca;
    --warn-bg: #3a2a06;
    --warn-fg: #fde68a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}
h1, h2 { margin: 0; }
svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 16px 64px;
}
.card {
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Host / meeting info pane */
.host {
  padding: 36px 32px;
  border-right: 1px solid var(--border);
}
.eyebrow {
  margin: 0 0 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent-text);
}
.host h1 { font-size: 1.625rem; line-height: 1.2; letter-spacing: -0.4px; }
.meta { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; color: var(--muted); font-size: 0.9375rem; }
.meta li { display: flex; align-items: flex-start; gap: 10px; }
.meta svg { margin-top: 2px; }
.meta .tz { align-items: center; }
.meta .tz svg { margin-top: 0; flex: none; }
/* Negative margin cancels the tap target's extra height so the row spacing matches the lines above. */
.tz-field { flex: 1; min-width: 0; margin: -10px 0; }
/* Reads as one more line of the info list (same type, colour and left edge as
   "30 min"), with a chevron to show it opens. The 44px height is the tap target. */
.tz-select {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; min-height: 44px; margin: 0; padding: 0 28px 0 0;
  font: inherit; font-size: 0.9375rem; color: var(--muted);
  text-overflow: ellipsis;
  background-color: transparent; border: 0; border-radius: 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 2px center; background-size: 16px;
  cursor: pointer;
}
@media (prefers-color-scheme: dark) {
  .tz-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  }
}
.tz-select:hover:not(:disabled) { color: var(--accent-text); }
.tz-select:focus { outline: none; }
.tz-select:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; color: var(--fg); }
.tz-select:disabled { cursor: default; background-image: none; padding-right: 0; }
.tz-select option { color: var(--fg); background: var(--card); }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Right-hand stage */
.stage { padding: 32px; min-width: 0; }
.step-title { font-size: 1.25rem; line-height: 1.3; letter-spacing: -0.2px; }
.step-title:focus, .times-heading:focus { outline: none; }

.pick { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 32px; }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-title { font-size: 1rem; font-weight: 600; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--accent-text);
  cursor: pointer;
}
.icon-btn:hover:not(:disabled) { background: var(--accent-soft); }
.icon-btn:disabled { color: var(--disabled); cursor: default; }

.cal-weekdays, .cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekdays span {
  text-align: center; padding: 4px 0 8px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--muted);
}
.day {
  position: relative;
  aspect-ratio: 1;
  min-height: 40px;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--disabled);
  font: inherit; font-size: 0.9375rem;
}
.day.has { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; cursor: pointer; }
.day.has:hover { background: var(--accent-border); }
.day[aria-pressed="true"] { background: var(--accent); color: #fff; }
.day.today::after {
  content: ""; position: absolute; left: 50%; bottom: 20%;
  width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
  background: currentColor;
}
.day.sk { background: var(--border); animation: pulse 1.4s ease-in-out infinite; }
.day.blank { visibility: hidden; }

/* Times */
/* min-height (not a fixed line-height) keeps it level with the calendar header and tidy if it ever wraps. */
.times-heading { display: flex; align-items: center; min-height: 44px; margin-bottom: 12px; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.time-list { display: flex; flex-direction: column; gap: 8px; max-height: 400px; overflow-y: auto; padding: 2px; }
.time-btn {
  min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--accent-border); border-radius: 10px;
  background: transparent; color: var(--accent-text);
  font: inherit; font-weight: 600; cursor: pointer;
}
.time-btn:hover { background: var(--accent-soft); border-color: var(--accent); }

/* Details step */
.back {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 44px; margin: -8px 0 4px -8px; padding: 0 12px 0 6px;
  border: 0; border-radius: 10px; background: transparent;
  color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer;
}
.back:hover { background: var(--accent-soft); }
.summary { margin: 8px 0 0; color: var(--muted); }
.book-form { margin-top: 24px; display: grid; gap: 18px; max-width: 460px; }
.field label { display: block; margin-bottom: 6px; font-size: 0.9375rem; font-weight: 600; }
.optional { font-weight: 400; color: var(--muted); }
.hint { margin: 6px 0 0; font-size: 0.8125rem; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 12px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--card); color: var(--fg);
  font: inherit; font-size: 1rem;
}
.field textarea { resize: vertical; min-height: 5rem; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.field [aria-invalid="true"] { border-color: var(--danger); }

/* Honeypot: off-screen (not display:none, which simple bots detect) and out of the tab order. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.captcha:empty { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px;
  border: 1px solid transparent; border-radius: 10px;
  background: var(--accent); color: #fff;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover:not(:disabled) { background: var(--accent-hover); }
.btn:disabled { opacity: 0.65; cursor: default; }
.btn-secondary { background: transparent; color: var(--accent-text); border-color: var(--accent-border); }
.btn-secondary:hover:not(:disabled) { background: var(--accent-soft); }
.btn-danger { background: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }

/* Messages */
.msg { margin-top: 4px; padding: 12px 14px; border-radius: 10px; font-size: 0.9375rem; }
.msg.error { background: var(--err-bg); color: var(--err-fg); }
.msg.success { background: var(--ok-bg); color: var(--ok-fg); }
.msg.notice { background: var(--warn-bg); color: var(--warn-fg); font-weight: 600; }
.msg.notice[hidden] { display: none; }
#pickStatus:not(:empty) { margin-top: 16px; }
.retry { display: flex; margin: 12px 0 0; min-height: 44px; padding: 8px 16px; }

/* Done step */
.done { text-align: center; max-width: 460px; margin: 0 auto; padding: 8px 0; }
.check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin-bottom: 16px; border-radius: 50%;
  background: var(--ok-bg); color: var(--ok-fg);
}
.check svg { width: 28px; height: 28px; stroke-width: 2.5; }
.done .summary { color: var(--fg); font-weight: 500; }
.note { margin: 12px 0 0; color: var(--muted); font-size: 0.9375rem; }
.done-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 24px; }
.fineprint { margin: 24px 0 0; color: var(--muted); font-size: 0.875rem; }
a.link { color: var(--accent-text); text-decoration: underline; font-weight: 500; }
.noscript { margin: 24px 0 0; text-align: center; color: var(--muted); }

/* Cancel page */
.card.narrow { display: block; max-width: 520px; margin: 0 auto; padding: 36px 32px; }
.card.narrow h1 { font-size: 1.5rem; letter-spacing: -0.3px; }
.card.narrow .lead { margin: 8px 0 24px; color: var(--muted); }
.card.narrow .actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

@keyframes pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) {
  .day.sk { animation: none; }
}

/* Tablet: stack the info pane above the picker */
@media (max-width: 820px) {
  .card { grid-template-columns: 1fr; }
  .host { padding: 24px 24px 20px; border-right: 0; border-bottom: 1px solid var(--border); }
  .meta { margin-top: 16px; }
  .stage { padding: 24px; }
}
/* Phone: calendar then times, full-width */
@media (max-width: 600px) {
  .shell { padding: 12px 8px 40px; }
  .pick { grid-template-columns: 1fr; gap: 20px; }
  .time-list { max-height: none; }
  .stage { padding: 20px 16px; }
  .host { padding: 20px 16px 16px; }
  .book-form { max-width: none; }
  .done-actions .btn { width: 100%; }
  .card.narrow { padding: 24px 20px; }
}
