/* 🗓 Public scheduling page — Atlas Internal Medicine (public/book-online.js) */
:root {
  --navy: #0f2a44;
  --ink: #1c2a35;
  --muted: #5b6b78;
  --line: #d7dee5;
  --bg: #f5f7f9;
  --card: #ffffff;
  --glow: #f0b23e;       /* porch light: the soonest time and the time you picked */
  --glow-soft: #fdf2db;
  --ok: #2f7d4f;
  --err: #b42318;
  --r: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 17px/1.55 Almarai, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); -webkit-text-size-adjust: 100%; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #7aa7d6; outline-offset: 2px; }

.bk-wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.bk-top { background: var(--navy); color: #fff; }
.bk-toprow { display: flex; align-items: center; justify-content: space-between; min-height: 58px; }
.bk-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; }
.bk-brand img { border-radius: 50%; background: #fff; }
.bk-call { color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; padding: 6px 14px; font-size: 15px; }

.bk-h1 { font-family: "Libre Baskerville", Georgia, serif; font-weight: 700; font-size: clamp(30px, 7vw, 46px); line-height: 1.12; letter-spacing: -.01em; margin: 34px 0 8px; color: var(--navy); }
.bk-lede { color: var(--muted); margin: 0 0 22px; max-width: 34em; }
.bk-step { margin: 0 0 26px; }
.bk-q { font-size: 19px; font-weight: 800; margin: 0 0 10px; }
.bk-help { color: var(--muted); margin: -4px 0 12px; font-size: 16px; }
.bk-addr { color: var(--muted); font-size: 15px; margin: 8px 2px 0; min-height: 1em; }

.bk-seg { display: inline-flex; background: #e8edf2; border-radius: 999px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.bk-seg button { border: 0; background: transparent; border-radius: 999px; padding: 10px 18px; min-height: 44px; cursor: pointer; font-weight: 700; color: var(--navy); }
.bk-seg button.on { background: var(--navy); color: #fff; }

.bk-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bk-kind { text-align: left; border: 1.5px solid var(--line); background: var(--card); border-radius: var(--r); padding: 14px 14px 13px; cursor: pointer; min-height: 84px; display: flex; flex-direction: column; gap: 3px; }
.bk-kind b { font-size: 17px; color: var(--navy); }
.bk-kind span { font-size: 14px; color: var(--muted); line-height: 1.35; }
.bk-kind.on { border-color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--navy); }
.bk-kind.sick b::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--glow); margin-right: 7px; vertical-align: 2px; }

.bk-form { display: flex; flex-direction: column; gap: 12px; }
.bk-form label, .bk-dob legend { display: flex; flex-direction: column; gap: 5px; font-size: 15px; color: var(--muted); font-weight: 700; }
.bk-form input, .bk-form select { font-size: 17px; padding: 12px 12px; border: 1.5px solid #c4cfd9; border-radius: 10px; background: #fff; min-width: 0; width: 100%; }
.bk-form input:focus, .bk-form select:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px #c9d8e8; }
.bk-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bk-dob { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1.6fr 1fr 1.2fr; gap: 8px; }
.bk-dob legend { margin-bottom: 5px; padding: 0; }
.bk-btn { border: 0; background: var(--navy); color: #fff; border-radius: 12px; padding: 14px 20px; min-height: 52px; font-weight: 800; font-size: 17px; cursor: pointer; }
.bk-btn:disabled { opacity: .6; cursor: wait; }
.bk-btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.bk-msg { min-height: 1.2em; margin: 0; font-size: 15px; color: var(--muted); }
.bk-msg.err { color: var(--err); }
.bk-msg.ok { color: var(--ok); }
.bk-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* the time board */
.bk-timeshead { display: flex; flex-direction: column; }
.bk-days { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.bk-day { flex: none; scroll-snap-align: start; width: 74px; border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 8px 4px 7px; cursor: pointer; text-align: center; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.bk-day .dw { font-size: 13px; color: var(--muted); }
.bk-day .dn { font-family: "Libre Baskerville", Georgia, serif; font-size: 24px; font-weight: 700; color: var(--navy); margin: 2px 0; }
.bk-day .dc { font-size: 12px; color: var(--muted); }
.bk-day.on { background: var(--navy); border-color: var(--navy); }
.bk-day.on .dw, .bk-day.on .dn, .bk-day.on .dc { color: #fff; }
.bk-prov { margin: 14px 0 4px; }
.bk-prov h3 { font-size: 16px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.bk-ini { width: 30px; height: 30px; border-radius: 50%; background: #e3ebf3; color: var(--navy); display: inline-grid; place-items: center; font-size: 13px; font-weight: 800; flex: none; }
.bk-wi { font-size: 13px; font-weight: 400; color: var(--muted); }
.bk-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.bk-chip { border: 1.5px solid var(--line); background: var(--card); border-radius: 10px; padding: 11px 6px; min-height: 48px; font-weight: 800; color: var(--navy); cursor: pointer; font-size: 16px; }
.bk-chip:hover { border-color: var(--navy); }
.bk-chip.soon { border-color: var(--glow); background: var(--glow-soft); }
.bk-chip.pick { background: var(--glow); border-color: var(--glow); color: var(--navy); }
.bk-soonest { display: flex; align-items: center; gap: 10px; background: var(--glow-soft); border: 1.5px solid var(--glow); border-radius: var(--r); padding: 12px 14px; margin: 0 0 14px; cursor: pointer; width: 100%; text-align: left; }
.bk-soonest b { color: var(--navy); }
.bk-soonest .lamp { width: 12px; height: 12px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 0 5px rgba(240,178,62,.25); flex: none; }
.bk-empty { background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--r); padding: 18px; color: var(--muted); }
.bk-empty .bk-actions { margin-top: 10px; }
.bk-loading { color: var(--muted); padding: 10px 2px; }
.bk-loading::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 8px; border: 2px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: bkspin .8s linear infinite; vertical-align: -2px; }
@keyframes bkspin { to { transform: rotate(360deg); } }
.bk-welcome { background: #eaf3ee; border-radius: var(--r); padding: 12px 14px; margin: 0 0 14px; color: #1e5236; }

/* the slide-up panel */
.bk-sheet { position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center; }
.bk-sheetbg { position: absolute; inset: 0; background: rgba(15,42,68,.38); }
.bk-panel { position: relative; background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); animation: bkup .22s ease-out; }
@keyframes bkup { from { transform: translateY(40px); opacity: .4; } }
@media (min-width: 700px) { .bk-sheet { align-items: center; } .bk-panel { border-radius: 20px; } }
.bk-x { position: absolute; top: 10px; right: 10px; border: 0; background: #eef2f5; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 16px; }
.bk-sum { margin: 0 34px 16px 0; }
.bk-sum .when { font-family: "Libre Baskerville", Georgia, serif; font-size: 24px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.bk-sum .who { color: var(--muted); margin-top: 4px; }
.bk-fine { font-size: 14px; color: var(--muted); margin: 0; }
.bk-check { flex-direction: row !important; align-items: center; gap: 8px !important; }
.bk-check input { width: auto !important; }
.bk-sex { display: flex; gap: 8px; flex-wrap: wrap; }
.bk-sex label { flex-direction: row; align-items: center; gap: 6px; border: 1.5px solid #c4cfd9; border-radius: 10px; padding: 10px 12px; color: var(--ink); font-weight: 400; cursor: pointer; }
.bk-sex input { width: auto; }
.bk-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* done */
.bk-done { padding-top: 34px; padding-bottom: 40px; }
.bk-done h1 { font-family: "Libre Baskerville", Georgia, serif; font-size: clamp(28px, 6vw, 40px); color: var(--navy); margin: 0 0 10px; line-height: 1.15; }
.bk-ticket { background: var(--card); border: 1.5px solid var(--line); border-left: 6px solid var(--glow); border-radius: var(--r); padding: 16px 18px; margin: 16px 0; }
.bk-ticket .when { font-size: 22px; font-weight: 800; color: var(--navy); }
.bk-note { color: var(--muted); font-size: 14px; margin: 10px 0 40px; }
@media (max-width: 380px) { .bk-kinds { grid-template-columns: 1fr; } .bk-row2 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .bk-panel { animation: none; } .bk-loading::after { animation: none; } }
.bk-linkbtn { border: 0; background: none; padding: 0; color: var(--navy); text-decoration: underline; cursor: pointer; font-weight: 700; }
.bk-seg button.on, .bk-kind.on { transition: background-color .12s ease; }
.bk-back { color: #fff; text-decoration: none; font-size: 15px; margin-left: auto; margin-right: 10px; opacity: .9; white-space: nowrap; }
.bk-officeline { margin: 4px 0 18px; color: #5b6b7b; font-size: 15px; }
.bk-officeline .bk-linkbtn { font-size: 14px; }
