/* Soren's calendar booking – styles. System fonts only (no third-party font requests). */

:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #17202a;
  --muted: #5d6875;
  --line: #e3e7ec;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 12px 32px rgba(16, 24, 40, .10);
  --ok: #1e7a4f;
  --err: #b42318;
}

/* ---------- Fonts (self-hosted, no third-party requests) ---------- */
@font-face { font-family: "Open Sans"; src: url(/fonts/open-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url(/fonts/open-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url(/fonts/open-sans-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Roboto Slab"; src: url(/fonts/roboto-slab-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

/* ---------- Themes ---------- */
body[data-theme="private"] {   /* BoardVerity look – petrol + amber, no brand name */
  --bg: #faf8f9;
  --hero: #27465a;
  --hero-rule: #d99518;
  --primary: #27465a;
  --primary-ink: #ffffff;
  --accent: #d99518;
  --accent-ink: #1d1a17;
  --soft: #e9eff2;
  --soft-ink: #1e3646;
  --eyebrow: #e3ad4a;
  --radius: 3px; --r-sm: 2px;
  --font-head: var(--font);
}
body[data-theme="maf"] {       /* MAF International – template colours, Roboto Slab headings */
  --bg: #f3f6f9;
  --hero: linear-gradient(120deg, #00172d 0%, #024d78 70%, #0580a7 140%);
  --hero-rule: #cc1522;
  --primary: #024d78;
  --primary-ink: #ffffff;
  --accent: #cc1522;
  --accent-ink: #ffffff;
  --soft: #e3f3f7;
  --soft-ink: #00314f;
  --eyebrow: #cdecf2;
  --radius: 6px; --r-sm: 4px;
  --font: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --font-head: "Roboto Slab", Georgia, serif;
}
body[data-theme="sai"] {       /* Scrum Alliance – board deck colours, Open Sans */
  --bg: #f4f6fa;
  --hero: linear-gradient(90deg, #182340 0%, #182340 64%, #2a3b6b 64%, #2a3b6b 100%);
  --hero-rule: #375edf;
  --primary: #182340;
  --primary-ink: #ffffff;
  --accent: #375edf;
  --accent-ink: #ffffff;
  --soft: #dbeef7;
  --soft-ink: #182340;
  --eyebrow: #7d9bff;
  --radius: 4px; --r-sm: 3px;
  --font: "Open Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: var(--font);
}
body[data-theme="admin"] {
  --hero: #2f3842;
  --hero-rule: #d99518;
  --primary: #2f3842;
  --primary-ink: #ffffff;
  --accent: #d99518;
  --accent-ink: #1d1a17;
  --soft: #eef1f4;
  --soft-ink: #20262e;
  --eyebrow: #e3ad4a;
  --radius: 8px; --r-sm: 6px;
  --font-head: var(--font);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
h1, h2, h3, h4 { font-family: var(--font-head); }

/* ---------- Top bar (logo / wordmark) ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1000px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo { display: block; height: 44px; width: auto; }
.logo-sai { height: 40px; }
.wordmark { font-family: Georgia, "Times New Roman", serif; font-size: 22px; letter-spacing: .2px; color: #1e3646; white-space: nowrap; }
.brand-sub { font-size: 10.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); border-left: 1px solid var(--line); padding-left: 14px; line-height: 1.35; }
.top-note { font-size: 13px; color: var(--muted); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--hero);
  color: #fff;
  padding: 46px 20px 124px;
  border-bottom: 3px solid var(--hero-rule);
}
.hero-inner { position: relative; max-width: 1000px; margin: 0 auto; }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--eyebrow); margin: 0 0 10px; white-space: pre-wrap;
}
body[data-theme="private"] .eyebrow::before, body[data-theme="admin"] .eyebrow::before {
  content: ""; display: block; width: 30px; height: 2px; background: var(--accent); margin-bottom: 14px;
}
body[data-theme="maf"] .eyebrow {
  display: inline-block; background: var(--accent); color: #fff; padding: 5px 10px; letter-spacing: 1.2px; border-radius: 2px;
}
.hero h1 { margin: 0; font-size: 36px; line-height: 1.12; font-weight: 700; letter-spacing: -.2px; }
.hero p.tagline { margin: 10px 0 0; color: rgba(255, 255, 255, .86); font-size: 17px; max-width: 640px; }

/* ---------- Card ---------- */
.wrap { max-width: 1000px; margin: -92px auto 0; padding: 0 16px 40px; position: relative; z-index: 2; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  display: grid; grid-template-columns: 300px 1fr; min-height: 460px; overflow: hidden;
}
.info { padding: 28px; border-right: 1px solid var(--line); }
.info h2 { margin: 0 0 4px; font-size: 20px; }
.info .sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.facts { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 12px; }
.facts li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.facts svg { flex: none; width: 20px; height: 20px; margin-top: 1px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.facts .topic { font-weight: 600; }
.field-label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
select.tz, .input, textarea.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff;
}
.input:focus, select.tz:focus, textarea.input:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
.hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; }

.picker { padding: 28px; }
.picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 8px; }
.picker-head h3 { margin: 0; font-size: 17px; }
.nav { display: flex; gap: 6px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dow { text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .8px; color: var(--muted); text-transform: uppercase; padding-bottom: 2px; }
.day {
  border: 1px solid var(--line); background: #fff; border-radius: var(--r-sm); padding: 8px 4px; min-height: 62px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer;
  transition: transform .08s ease, border-color .12s ease;
}
.day .num { font-size: 17px; font-weight: 700; }
.day .mon { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.day .count { font-size: 11px; color: var(--primary); font-weight: 600; }
.day.has { background: var(--soft); border-color: transparent; color: var(--soft-ink); }
.day.has:hover { transform: translateY(-1px); border-color: var(--primary); }
.day.sel { background: var(--primary); color: var(--primary-ink); }
.day.sel .count, .day.sel .mon { color: rgba(255, 255, 255, .85); }
.day.none { cursor: default; color: #a3abb5; background: #fafbfc; }
.day.none .count { color: #b8bfc8; font-weight: 400; }
.day.blank { border: 0; background: transparent; cursor: default; }
.day.today .num { text-decoration: underline; text-underline-offset: 3px; }

.times { margin-top: 22px; }
.times h4 { margin: 0 0 10px; font-size: 15px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slot {
  padding: 10px 6px; border-radius: var(--r-sm); border: 1.5px solid var(--primary); background: #fff; color: var(--primary);
  font-weight: 650; cursor: pointer; text-align: center;
}
.slot:hover { background: var(--primary); color: var(--primary-ink); }
.empty { color: var(--muted); padding: 18px; background: #fafbfc; border-radius: var(--r-sm); text-align: center; }

/* ---------- Form / confirmation ---------- */
.panel { padding: 28px; }
.back { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; font-weight: 600; margin-bottom: 16px; display: inline-flex; align-items: center; gap: 6px; }
.back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chosen { background: var(--soft); color: var(--soft-ink); border-radius: var(--r-sm); padding: 14px 16px; margin-bottom: 20px; }
.chosen strong { display: block; font-size: 17px; }
.chosen span { font-size: 14px; opacity: .85; }
.form { display: grid; gap: 14px; max-width: 520px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice label { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; cursor: pointer; font-weight: 600; }
.choice input { accent-color: var(--primary); width: 18px; height: 18px; margin: 0; }
.choice label:has(input:checked) { border-color: var(--primary); background: var(--soft); }
.choice small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--r-sm); border: 0; background: var(--primary); color: var(--primary-ink);
  font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn.danger { background: var(--err); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.msg { padding: 12px 14px; border-radius: var(--r-sm); font-size: 14px; }
.msg.err { background: #fef3f2; color: var(--err); }
.msg.ok { background: #ecfdf3; color: var(--ok); }
.done { text-align: center; padding: 48px 28px; max-width: 560px; margin: 0 auto; }
.done .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; margin: 0 auto 16px; }
.done .tick svg { width: 30px; height: 30px; fill: none; stroke: var(--primary); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.done h2 { margin: 0 0 8px; }
.done p { color: var(--muted); margin: 6px 0; }
.done .when { color: var(--ink); font-size: 18px; font-weight: 700; margin: 14px 0 4px; }
.single { grid-template-columns: 1fr; min-height: 0; }

footer.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 16px 32px; }

/* ---------- Boot / errors ---------- */
.boot { min-height: 60vh; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #d9dee4; border-top-color: #274659; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-inline { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 20px 0; }
.loading-inline .spinner { width: 20px; height: 20px; border-width: 2px; border-top-color: var(--primary); }
.noscript { text-align: center; padding: 40px; }

/* ---------- Admin ---------- */
.admin .card { display: block; padding: 28px; min-height: 0; margin-bottom: 20px; }
.admin h2 { margin: 0 0 16px; font-size: 19px; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { padding: 10px 16px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; }
.seg button.on { border-color: var(--primary); background: var(--primary); color: #fff; }
.seg button[data-acc="private"].on { background: #274659; border-color: #274659; }
.seg button[data-acc="maf"].on { background: #28517e; border-color: #28517e; }
.seg button[data-acc="sai"].on { background: #182340; border-color: #182340; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.admin label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.admin .row { margin-bottom: 16px; }
details.adv { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 16px; }
details.adv summary { cursor: pointer; font-weight: 600; }
details.adv .grid2 { margin-top: 12px; }
.check { display: flex !important; grid-template-columns: none; align-items: center; gap: 8px; font-weight: 500 !important; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.result { border: 2px solid var(--accent); border-radius: 14px; padding: 18px; background: #fffaf0; margin-top: 18px; }
.result .url { font-size: 18px; font-weight: 700; word-break: break-all; margin: 4px 0 12px; }
.list { display: grid; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.item.off { opacity: .55; }
.item .meta { font-size: 13px; color: var(--muted); }
.item .ttl { font-weight: 650; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; color: #fff; margin-right: 6px; vertical-align: 1px; }
.badge.private { background: #274659; } .badge.maf { background: #28517e; } .badge.sai { background: #182340; }
.badge.fixed { background: #8a6d1f; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .card { grid-template-columns: 1fr; }
  .info { border-right: 0; border-bottom: 1px solid var(--line); }
  .hero { padding: 32px 18px 110px; }
  .hero h1 { font-size: 25px; }
  .grid4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .info, .picker, .panel, .admin .card { padding: 20px; }
  .cal { gap: 4px; }
  .day { min-height: 54px; border-radius: var(--r-sm); }
  .day .count { font-size: 10px; }
  .choice, .grid2 { grid-template-columns: 1fr; }
  .emblem { width: 48px; height: 48px; }
}

/* Theme touches */
body[data-theme="private"] .btn:not(.ghost):not(.danger) { background: var(--accent); color: var(--accent-ink); }
body[data-theme="private"] .card { border-top: 2px solid var(--primary); }
body[data-theme="maf"] .slot:hover, body[data-theme="sai"] .slot:hover { background: var(--accent); border-color: var(--accent); }
body[data-theme="sai"] .day.sel { background: var(--accent); }
body[data-theme="sai"] .btn:not(.ghost):not(.danger) { background: var(--accent); }
body[data-theme="maf"] .btn:not(.ghost):not(.danger) { background: var(--primary); }
body[data-theme="maf"] .info h2, body[data-theme="maf"] .done h2 { color: #00314f; }
@media (max-width: 820px) {
  .hero h1 { font-size: 28px; }
  body[data-theme="sai"] { --hero: #182340; }
  .top-note { display: none; }
}
@media (max-width: 520px) {
  .logo { height: 34px; } .logo-sai { height: 32px; }
  .brand-sub { display: none; }
  .wordmark { font-size: 19px; }
}
