/* BookDesk — one stylesheet for the booking page, manage page and admin.
   No framework: the whole surface is small enough that hand-written CSS is
   less code than a utility library's config file. */

:root {
  /* Brand accent. A logo color is usually too light for text: the
     wordmark #283038. That cyan is far too light to carry white text
     (about 1.5:1), so --accent is a deepened version of the same hue —
     recognisably the brand color, and about 5.8:1 on white, which clears
     AA for the button and slot labels sitting on it. --accent-ink is the
     darker tone for text on --accent-soft. */
  --accent: #0b6d90;
  --accent-soft: #e8f5fa;
  --accent-ink: #075067;
  --brand-cyan: #50d8f8;
  --brand-ink: #283038;

  --ink: #10161f;
  --ink-2: #4a5462;
  --ink-3: #7c8695;
  --line: #e5e9ec;
  --line-2: #eef1f3;
  --bg: #f6f8f7;
  --surface: #ffffff;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --warn-soft: #fffaeb;
  --warn-ink: #93370d;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 28px -12px rgba(16, 24, 40, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Several components below set display on elements that also use the `hidden`
   attribute; without this the attribute silently loses. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* When embedded in an iframe the host page provides the background. */
body.embedded { background: transparent; }

a { color: var(--accent); }

.page {
  max-width: 940px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}
body.embedded .page { padding: 0; }

/* ---------------------------------------------------------------- card */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.booker { display: grid; grid-template-columns: 300px 1fr; min-height: 520px; }
@media (max-width: 780px) { .booker { grid-template-columns: 1fr; } }

/* --------------------------------------------------------- left panel */
.summary {
  padding: 28px 26px;
  border-right: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--accent-soft), transparent 220px);
}
@media (max-width: 780px) {
  .summary { border-right: 0; border-bottom: 1px solid var(--line-2); }
}

/* The brand mark sits where a host's name would: a logo when one is
   configured, the brand name as a wordmark otherwise. Height-capped rather
   than width-capped so wide and square logos both land on the same baseline. */
.brandmark { margin: 0 0 16px; min-height: 22px; }
.brandmark img {
  display: block;
  max-height: 40px;
  max-width: 190px;
  width: auto;
  height: auto;
}
.brandmark .wordmark {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand-ink);
}
.brandmark a { display: inline-block; text-decoration: none; }
.summary h1 { margin: 0 0 12px; font-size: 24px; line-height: 1.25; letter-spacing: -.02em; }
.summary p.desc { margin: 0 0 20px; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }

.meta { display: grid; gap: 11px; }
.meta-item {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 14px; color: var(--ink-2); line-height: 1.45;
}
.meta-item svg { flex: 0 0 17px; margin-top: 1px; color: var(--ink-3); }
.meta-item strong { color: var(--ink); font-weight: 600; }

/* -------------------------------------------------------- right panel */
.picker { padding: 24px 26px 28px; display: grid; grid-template-columns: 1fr 232px; gap: 26px; }
@media (max-width: 660px) { .picker { grid-template-columns: 1fr; } }

.picker h2 { margin: 0 0 14px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }

/* calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-month { font-size: 15px; font-weight: 600; }
.cal-nav { display: flex; gap: 4px; }
.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; cursor: pointer; color: var(--ink-2);
  transition: background .12s, border-color .12s;
}
.icon-btn:hover:not(:disabled) { background: var(--line-2); }
.icon-btn:disabled { opacity: .35; cursor: default; }

.dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.dow span {
  text-align: center; font-size: 11px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3);
}

.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day {
  position: relative; aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  border: 0; background: transparent; border-radius: 9px;
  font: 500 14px/1 var(--font); color: var(--ink-3);
  cursor: default;
}
.day.available {
  background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 600; cursor: pointer;
}
.day.available:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.day.selected { background: var(--accent); color: #fff; }
.day.today::after {
  content: ""; position: absolute; bottom: 5px;
  width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .55;
}
.day.empty { visibility: hidden; }

/* times */
.times { display: flex; flex-direction: column; min-height: 260px; }
.times-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.times-date { font-size: 14px; font-weight: 600; }
.times-list {
  display: grid; gap: 7px; align-content: start;
  overflow-y: auto; max-height: 428px;
  padding-right: 4px; scrollbar-width: thin;
}
.slot {
  padding: 11px 12px; border: 1px solid var(--line);
  background: var(--surface); border-radius: var(--radius-sm);
  font: 600 14px/1 var(--font); color: var(--accent-ink);
  cursor: pointer; text-align: center;
  transition: border-color .12s, background .12s, transform .06s;
}
.slot:hover { border-color: var(--accent); background: var(--accent-soft); }
.slot:active { transform: translateY(1px); }
.slot.chosen { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ------------------------------------------------------------- states */
.empty-state {
  display: grid; place-items: center; text-align: center;
  padding: 34px 16px; color: var(--ink-3); font-size: 14px; line-height: 1.6;
}
.skeleton {
  background: linear-gradient(90deg, var(--line-2) 25%, #f7f9fa 50%, var(--line-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.notice {
  padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13.5px;
  line-height: 1.5; margin-bottom: 14px;
}
.notice.warn { background: var(--warn-soft); color: var(--warn-ink); }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.notice.info { background: var(--accent-soft); color: var(--accent-ink); }

/* -------------------------------------------------------------- forms */
.form { padding: 26px 28px 30px; max-width: 480px; }
.field { margin-bottom: 15px; }
.field label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 6px; color: var(--ink);
}
.field .hint { font-weight: 400; color: var(--ink-3); }
input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=url], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: 400 15px/1.4 var(--font); color: var(--ink);
  background: var(--surface); transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
textarea { min-height: 86px; resize: vertical; }

/* Honeypot: off-screen rather than display:none, which some bots detect. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font: 600 15px/1 var(--font); cursor: pointer; text-decoration: none;
  background: var(--accent); color: #fff;
  transition: filter .12s, transform .06s;
}
.btn:hover:not(:disabled) { filter: brightness(1.07); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { background: var(--line-2); filter: none; }
.btn.danger { background: var(--danger); }
.btn.small { padding: 7px 13px; font-size: 13.5px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------- confirmation */
.done { padding: 44px 32px 48px; text-align: center; }
.done .tick {
  width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.done h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.02em; }
.done p { margin: 0 0 22px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.done .details {
  max-width: 420px; margin: 0 auto 22px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
}
.done .details div {
  display: flex; gap: 14px; padding: 11px 15px; font-size: 14px;
  border-bottom: 1px solid var(--line-2);
}
.done .details div:last-child { border-bottom: 0; }
.done .details span:first-child { color: var(--ink-3); width: 92px; flex: 0 0 92px; }
.done .details span:last-child { color: var(--ink); font-weight: 500; word-break: break-word; }

/* -------------------------------------------------------------- admin */
.admin-wrap { max-width: 1040px; margin: 0 auto; padding: 28px 20px 64px; }
.admin-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.admin-head h1 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.admin-logo { height: 34px; width: auto; max-width: 210px; object-fit: contain; flex: none; }
@media (max-width: 620px) { .admin-logo { height: 24px; } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; flex-wrap: wrap; }
.tab {
  padding: 9px 14px; border: 0; background: transparent; cursor: pointer;
  font: 600 14px/1 var(--font); color: var(--ink-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.panel { display: none; }
.panel.active { display: block; }

.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; }
.section h3 { margin: 0 0 4px; font-size: 15px; }
.section p.sub { margin: 0 0 18px; font-size: 13.5px; color: var(--ink-3); line-height: 1.55; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .grid-2 { grid-template-columns: 1fr; } }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th {
  text-align: left; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-3); padding: 0 10px 8px; font-weight: 600;
}
table.list td { padding: 11px 10px; border-top: 1px solid var(--line-2); vertical-align: top; }
table.list tr:hover td { background: #fafbfb; }

.pill {
  display: inline-block; padding: 3px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; background: var(--line-2); color: var(--ink-2);
}
.pill.good { background: var(--accent-soft); color: var(--accent-ink); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }

.week-row {
  display: grid; grid-template-columns: 116px 1fr; gap: 12px;
  align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-2);
}
.week-row:last-child { border-bottom: 0; }
.week-row .toggle { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; }
.week-row .ranges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.week-row input[type=time] { width: 120px; }
.week-row.off .ranges { opacity: .4; pointer-events: none; }

.login-box { max-width: 340px; margin: 84px auto; }

/* Choosing who takes the bookings: a radio group that reads as two options
   with an explanation, and a re-orderable list of people. */
.choice-list { display: grid; gap: 10px; margin: 14px 0 4px; }
.choice {
  display: flex; gap: 11px; align-items: flex-start; cursor: pointer;
  padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; transition: border-color .12s, background .12s;
}
.choice:hover { border-color: var(--ink-3); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: 3px; flex: none; accent-color: var(--accent); }
.choice strong { display: block; font-size: 14px; font-weight: 600; }
.choice em { display: block; font-style: normal; font-size: 13px; color: var(--ink-2); margin-top: 3px; line-height: 1.45; }

.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; cursor: pointer; }
.check input { margin-top: 2px; flex: none; accent-color: var(--accent); }

.rank-list { display: grid; gap: 8px; }
.rank-row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.rank-row.on { border-color: var(--accent); background: var(--accent-soft); }
.rank-row .who { flex: 1; min-width: 0; font-size: 14px; }
.rank-row .who span { display: block; font-size: 12.5px; color: var(--ink-3); }
.rank-row .rank {
  flex: none; width: 24px; height: 24px; border-radius: 99px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: var(--accent); color: #fff;
}
.rank-row.off .rank { background: var(--line-2); color: var(--ink-3); }
.rank-row .moves { display: flex; gap: 4px; flex: none; }
.rank-row .moves button {
  width: 26px; height: 26px; padding: 0; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); cursor: pointer; font-size: 12px; line-height: 1;
}
.rank-row .moves button:disabled { opacity: .3; cursor: default; }
