/* ---------- tokens ---------- */
:root {
  --brand: #2563eb;
  --brand-ink: color-mix(in oklab, var(--brand) 82%, black);
  --brand-50: color-mix(in oklab, var(--brand) 6%, white);
  --brand-100: color-mix(in oklab, var(--brand) 11%, white);
  --brand-200: color-mix(in oklab, var(--brand) 22%, white);
  --brand-ring: color-mix(in oklab, var(--brand) 28%, transparent);

  --ink: #16161a;
  --ink-2: #4b4b55;     /* secondary text, 8:1 on white */
  --ink-3: #6b6b76;     /* tertiary text, 5:1 on white */
  --ink-4: #b4b4bd;     /* disabled glyphs only */
  --line: #e7e7ec;
  --line-strong: #d6d6de;
  --surface: #ffffff;
  --surface-2: #fafafb;
  --page: #f3f3f6;
  --danger: #b42318;
  --danger-50: #fef3f2;
  --ok: #067647;
  --ok-50: #ecfdf3;

  --radius-lg: 20px;
  --radius: 12px;
  --radius-sm: 10px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --shadow-card: 0 1px 1px rgb(16 16 24 / .03), 0 2px 4px -1px rgb(16 16 24 / .04), 0 24px 48px -24px rgb(16 16 24 / .16);
  --shadow-pop: 0 1px 2px rgb(16 16 24 / .06), 0 6px 16px -6px color-mix(in oklab, var(--brand) 45%, transparent);

  color-scheme: light;
  accent-color: var(--brand);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 420px at 50% -120px, var(--brand-100), transparent 70%),
    var(--page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--brand-200); color: var(--ink); }
input, textarea { caret-color: var(--brand); }
button { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2 { text-wrap: balance; }
p, .desc, .welcome, .type-desc, .lead { text-wrap: pretty; }
h2:focus { outline: none; }

.demo-banner {
  width: 100%; padding: 8px 16px; text-align: center; font-size: 13px; font-weight: 500;
  background: #fffaeb; color: #93370d; border-bottom: 1px solid #fedf89;
}

/* ---------- card shell ---------- */
.card {
  display: grid;
  grid-template-columns: 312px 1fr;
  width: min(1060px, calc(100% - 40px));
  margin: 56px 0 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  min-height: 600px;
  overflow: hidden;
}
.side {
  padding: 32px 28px;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
}
.main { padding: 32px 36px 36px; min-width: 0; }

/* ---------- side panel ---------- */
.owner { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; overflow: hidden; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(145deg, color-mix(in oklab, var(--brand) 88%, white), var(--brand-ink));
  color: #fff; font-weight: 600; font-size: 17px; letter-spacing: .02em;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.owner-name { font-weight: 600; font-size: 15px; letter-spacing: -.005em; }
.owner-sub { color: var(--ink-3); font-size: 13px; }

.summary h1 { font-size: 24px; line-height: 1.2; margin: 0 0 18px; letter-spacing: -.02em; font-weight: 650; }
.facts { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 12px; }
.facts li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.facts li svg { margin-top: 2px; color: var(--ink-3); }
#sum-when {
  margin-top: 4px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--brand-50); color: var(--brand-ink); box-shadow: inset 0 0 0 1px var(--brand-100);
}
#sum-when svg { color: var(--brand); }
.desc, .welcome { color: var(--ink-2); margin: 0; max-width: 34ch; }
.desc { padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------- step headings ---------- */
h2 { font-size: 19px; line-height: 1.3; margin: 0 0 22px; letter-spacing: -.015em; font-weight: 650; }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.step-head h2 { margin: 0; }
.back, .icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--brand);
  transition: background-color .18s var(--ease-out), border-color .18s var(--ease-out), transform .18s var(--ease-out);
}
.back:hover, .icon-btn:hover:not(:disabled) { background: var(--brand-50); border-color: var(--brand-200); }
.back:active, .icon-btn:active:not(:disabled) { transform: scale(.94); }
.icon-btn:disabled { color: var(--ink-4); cursor: default; border-color: transparent; }

/* ---------- meeting types ---------- */
.types { display: grid; gap: 12px; }
.type {
  display: flex; align-items: center; gap: 18px; width: 100%; text-align: left;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer;
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out), transform .2s var(--ease-out);
}
.type:hover { border-color: var(--brand-200); box-shadow: 0 1px 2px rgb(16 16 24 / .04), 0 10px 24px -14px color-mix(in oklab, var(--brand) 40%, transparent); }
.type:active { transform: scale(.995); }
.type-dur {
  display: grid; place-items: center; align-content: center; width: 56px; height: 56px; border-radius: 14px; flex: none;
  background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-100);
  color: var(--brand-ink); font-weight: 700; font-size: 19px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.type-dur small { font-size: 11px; font-weight: 600; margin-top: 3px; letter-spacing: .02em; color: var(--brand); }
.type-body { display: grid; gap: 3px; flex: 1; }
.type-title { font-weight: 600; letter-spacing: -.005em; }
.type-desc { color: var(--ink-3); font-size: 14px; }
.chev { color: var(--ink-4); transition: transform .2s var(--ease-out), color .2s var(--ease-out); }
.type:hover .chev { color: var(--brand); transform: translateX(3px); }

/* ---------- date & time picker ---------- */
.picker { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 36px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-title { font-weight: 600; letter-spacing: -.005em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px 4px; }
.dow { text-align: center; font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; padding-bottom: 8px; }
.day {
  aspect-ratio: 1; max-height: 50px; width: 100%; max-width: 50px; justify-self: center;
  border: 0; border-radius: 50%; background: none; font-weight: 500; color: var(--ink-4);
  position: relative; font-variant-numeric: tabular-nums;
}
.day.avail {
  background: var(--brand-50); color: var(--brand-ink); font-weight: 650; cursor: pointer;
  transition: background-color .16s var(--ease-out), color .16s var(--ease-out), box-shadow .16s var(--ease-out), transform .16s var(--ease-out);
}
.day.avail:hover { background: var(--brand-100); }
.day.avail:active { transform: scale(.94); }
.day.selected, .day.selected:hover { background: var(--brand); color: #fff; box-shadow: var(--shadow-pop); }
.day.today::after { content: ""; position: absolute; left: 50%; bottom: 7px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }

/* loading skeleton */
.cal-grid.loading .day { color: transparent; background: var(--line); opacity: .55; animation: pulse 1.2s ease-in-out infinite; pointer-events: none; box-shadow: none; }
.cal-grid.loading .day.empty { background: none; animation: none; }
.skeleton-time { height: 48px; border-radius: var(--radius-sm); background: var(--line); opacity: .55; animation: pulse 1.2s ease-in-out infinite; }
.skeleton-time:nth-child(2) { animation-delay: .1s; } .skeleton-time:nth-child(3) { animation-delay: .2s; } .skeleton-time:nth-child(4) { animation-delay: .3s; }
@keyframes pulse { 50% { opacity: .25; } }

.tz-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2);
}
.tz-row label { font-weight: 600; color: var(--ink); }
.tz-row select {
  flex: 1; min-width: 180px; height: 34px; padding: 0 32px 0 10px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6b76' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center / 14px;
  appearance: none; font: inherit; color: var(--ink); cursor: pointer; transition: border-color .16s;
}
.tz-row select:hover { border-color: var(--ink-4); }
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 9px; background: var(--page); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; cursor: pointer; font-size: 12px; font-weight: 500; color: var(--ink-2); transition: background-color .16s, color .16s; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(16 16 24 / .1), 0 0 0 1px var(--line); }

.times { display: flex; flex-direction: column; min-height: 0; }
.times-title { font-weight: 600; margin: 6px 0 16px; min-height: 22px; letter-spacing: -.005em; }
.times-list {
  display: grid; gap: 8px; align-content: start; max-height: 452px; overflow-y: auto;
  padding: 2px 6px 16px 2px; margin: -2px -6px 0 -2px; scroll-padding: 8px;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent);
}
.times-list::-webkit-scrollbar { width: 6px; }
.times-list::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.times-empty { color: var(--ink-3); font-size: 14px; padding: 18px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); text-align: center; }
.time-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0fr); gap: 0; transition: grid-template-columns .28s var(--ease-out), gap .28s var(--ease-out); }
.time-row.picked { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.time-row:not(.picked) .next { opacity: 0; visibility: hidden; }
.time, .next {
  height: 48px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; min-width: 0;
}
.time {
  border: 1px solid var(--brand-200); background: var(--surface); color: var(--brand-ink);
  transition: border-color .16s var(--ease-out), background-color .16s var(--ease-out), box-shadow .16s var(--ease-out);
}
.time:hover { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.picked .time { background: var(--brand-50); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.next {
  border: 0; background: var(--brand); color: #fff; overflow: hidden; white-space: nowrap; box-shadow: var(--shadow-pop);
  transition: background-color .16s var(--ease-out), transform .16s var(--ease-out), opacity .22s var(--ease-out) .06s, visibility 0s;
}
.next:hover { background: var(--brand-ink); }
.next:active { transform: scale(.97); }

.status { margin-top: 16px; color: var(--ink-2); font-size: 14px; }
.status:empty { display: none; }
.status.error, #form-status {
  color: var(--danger); background: var(--danger-50); border: 1px solid color-mix(in oklab, var(--danger) 18%, white);
  padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 500;
}

/* ---------- details form ---------- */
#step-details { max-width: 540px; }
.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field label { font-weight: 600; font-size: 14px; }
.req { color: var(--danger); }
.hint { color: var(--ink-3); font-weight: 400; font-size: 13px; margin-left: 6px; }
.field input, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; color: var(--ink);
  background: var(--surface); box-shadow: 0 1px 2px rgb(16 16 24 / .04);
  transition: border-color .16s var(--ease-out), box-shadow .16s var(--ease-out);
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.field input:hover, .field textarea:hover { border-color: var(--ink-4); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field [aria-invalid="true"]:focus { box-shadow: 0 0 0 4px color-mix(in oklab, var(--danger) 22%, transparent); }
.field textarea { resize: vertical; min-height: 104px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
#form-status { margin: 0 0 16px; }
#form-status:empty { display: none; }
.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 4px; min-width: 200px; height: 48px; padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--brand); color: #fff; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-pop);
  transition: background-color .16s var(--ease-out), transform .16s var(--ease-out), opacity .16s;
}
.primary:hover:not(:disabled) { background: var(--brand-ink); }
.primary:active:not(:disabled) { transform: scale(.98); }
.primary:disabled { opacity: .75; cursor: progress; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .35); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- confirmation (the one authored moment) ---------- */
.done { text-align: center; padding-top: 36px; max-width: 520px; margin: 0 auto; }
.check {
  width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok-50); color: var(--ok); box-shadow: 0 0 0 8px color-mix(in oklab, var(--ok-50) 60%, transparent);
  animation: check-pop .5s var(--ease-out) both;
}
.check svg { width: 30px; height: 30px; stroke-width: 2.5; }
.check path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: check-draw .45s .18s var(--ease-out) forwards; }
@keyframes check-pop { from { transform: scale(.6); opacity: 0; } }
@keyframes check-draw { to { stroke-dashoffset: 0; } }
.done h2 { font-size: 24px; margin-bottom: 8px; letter-spacing: -.02em; }
.lead { color: var(--ink-2); margin: 0 auto 24px; max-width: 42ch; }
.done-details { padding: 20px 0 22px; margin-bottom: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.done-title { font-weight: 600; margin-bottom: 4px; }
.done-when { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.join {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 8px 14px; border-radius: 999px;
  background: var(--brand-50); color: var(--brand-ink); font-weight: 600; text-decoration: none; box-shadow: inset 0 0 0 1px var(--brand-100);
  transition: background-color .16s;
}
.join:hover { background: var(--brand-100); }
.muted { color: var(--ink-3); font-size: 14px; }
.link {
  border: 0; background: none; color: var(--brand-ink); font-weight: 600; cursor: pointer; padding: 8px 10px; border-radius: 8px;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--brand-200); transition: text-decoration-color .16s;
}
.link:hover { text-decoration-color: currentColor; }

.foot { color: var(--ink-3); font-size: 12px; padding: 8px 0 28px; letter-spacing: .01em; }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .card { grid-template-columns: 1fr; margin-top: 16px; width: calc(100% - 24px); min-height: 0; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); padding: 22px 22px 20px; }
  .owner { margin-bottom: 16px; }
  .summary h1 { font-size: 21px; margin-bottom: 12px; }
  .facts { margin-bottom: 12px; }
  .desc { padding-top: 12px; }
  .main { padding: 22px; }
  .picker { grid-template-columns: 1fr; gap: 24px; }
  .times-list { max-height: none; mask-image: none; padding-bottom: 2px; }
  .day { max-width: 46px; }
  .primary { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .check path { stroke-dashoffset: 0; }
}
