/* Ecomstat look, matched to www.ecomstat.io: sky-blue accent on a light page (Jon: light only, no dark mode), Plus Jakarta Sans + Inter.
   Fonts self-hosted (SIL OFL). */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/fonts/inter-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 600 700; font-display: swap;
  src: url(/fonts/jakarta-latin.woff2) format('woff2');
}

:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --glow: rgba(58, 175, 234, 0.18);
  --card: #ffffff;
  --raise: #f7f8fb;
  --text: #1b1446;
  --muted: #5f6475;
  --line: #dde3f0;
  --accent: #3aafea;
  --accent-ink: #0a78b8;
  --accent-text: #06111a;
  --accent-soft: rgba(58, 175, 234, 0.12);
  --error: #c62828;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 50% -120px, var(--glow), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 16px/1.55 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 32px;
}

.brand { width: 100%; max-width: 560px; margin-bottom: 22px; display: flex; justify-content: center; }
.brand img { height: 32px; width: auto; display: block; }

.card {
  width: 100%;
  max-width: 560px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
}
@media (max-width: 480px) { .card { padding: 20px; } .brand img { height: 28px; } }

.kicker {
  font: 500 12px/1 ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, monospace;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink);
  display: flex; align-items: center; gap: 8px; margin: 0 0 14px;
}
.kicker::before, .kicker::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

h1, h2 { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; letter-spacing: -0.02em; }
h1 { font-size: 30px; line-height: 1.15; margin: 0; font-weight: 700; }
h1 span { color: var(--accent-ink); }
h2 { font-size: 20px; margin: 18px 0 12px; font-weight: 700; }
.sub, .muted, .tz, .opt { color: var(--muted); }
.sub { margin: 8px 0 0; }
.tz { font-size: 14px; margin: 12px 0 16px; }
.head { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
a { color: var(--accent-ink); }

.durations { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.pill, .time {
  font: inherit; cursor: pointer;
  border: 1px solid var(--line); background: var(--raise); color: var(--text);
  border-radius: 8px; padding: 8px 16px;
  transition: border-color .15s, background .15s;
}
.pill:hover, .time:hover { border-color: var(--accent); }
.pill[aria-checked="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600;
}
.pill:focus-visible, .time:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}


.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 14px; }
.time { padding: 10px 0; }
.time:hover { background: var(--accent-soft); }

form label { display: block; margin-top: 14px; font-size: 14px; font-weight: 500; }
input, textarea {
  display: block; width: 100%; margin-top: 6px;
  font: inherit; color: var(--text); background: var(--raise);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.back { font: inherit; background: none; border: 0; color: var(--accent-ink); padding: 0; cursor: pointer; margin-top: 18px; }
.chosen { font-weight: 600; margin: 10px 0 0; }
.primary {
  font: inherit; font-weight: 600; width: 100%; margin-top: 20px; cursor: pointer;
  background: var(--accent); color: var(--accent-text); border: 0; border-radius: 8px; padding: 13px;
}
.primary:hover { filter: brightness(1.08); }
.primary[disabled] { opacity: .6; cursor: progress; }
.error { color: var(--error); margin: 12px 0 0; }

#done { text-align: center; padding: 8px 0 4px; }
.tick {
  width: 56px; height: 56px; margin: 18px auto 0; border-radius: 50%;
  background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent-ink);
  font-size: 26px; display: grid; place-items: center;
}
footer { color: var(--muted); font-size: 13px; margin-top: 20px; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }

/* Centre-aligned layout on every screen size. Form inputs keep left-aligned labels for readability. */
.head, .tz, #loading, #empty, .chosen, .back-row { text-align: center; }
.kicker, .durations { justify-content: center; }
.times { display: flex; flex-wrap: wrap; justify-content: center; }
.time { width: 104px; }
@media (max-width: 480px) {
  .durations { flex-wrap: nowrap; gap: 6px; }
  .pill { flex: 1 1 0; min-width: 0; padding: 8px 4px; white-space: nowrap; }
}

/* Month view */
.cal { max-width: 380px; margin: 0 auto; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 10px; }
.cal-head strong { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; font-size: 17px; }
.nav {
  font: inherit; font-size: 22px; line-height: 1; width: 38px; height: 38px; cursor: pointer;
  border: 1px solid var(--line); background: var(--raise); color: var(--text); border-radius: 8px;
}
.nav:hover:not(:disabled) { border-color: var(--accent); }
.nav:disabled { opacity: .3; cursor: default; }
.dow, .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.dow span { font-size: 12px; color: var(--muted); padding: 4px 0; }
.cell {
  font: inherit; aspect-ratio: 1; display: grid; place-items: center;
  border: 1px solid transparent; background: transparent; color: var(--muted); border-radius: 10px; opacity: .45;
}
.cell.blank { visibility: hidden; }
.cell.open {
  opacity: 1; cursor: pointer; color: var(--text); font-weight: 600;
  background: var(--accent-soft); border-color: transparent;
}
.cell.open:hover { border-color: var(--accent); }
.cell.today { text-decoration: underline; text-underline-offset: 3px; }
.cell[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.day-label { text-align: center; font-weight: 600; margin: 18px 0 0; }


/* Turnstile widget sits centred above the confirm button */
.ts { display: flex; justify-content: center; margin-top: 18px; min-height: 0; }
.ts:empty { display: none; }

