/* me.cliniweb /book/ - patient self-booking. premiumUI tokens (my.cliniweb/html/premiumUI.md). */
@font-face {
  font-family: "Cliniweb Appointment Sans";
  src: url("/assets/fonts/OpenSans-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --premium-canvas: #f5f5f1;
  --premium-surface: #ffffff;
  --premium-ink: #233932;
  --premium-muted: #69756f;
  --premium-line: #e5e9e3;
  --premium-soft: #f3f6f1;
  --premium-accent: #245b4b;
  --premium-accent-dark: #194637;
  --premium-accent-soft: #eaf1eb;
  --premium-success: #42633b;
  --premium-warning: #836d42;
  --premium-danger: #9b3e39;
  --field-bg: #fbfcf9;
  --field-line: #e2e7df;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--premium-canvas);
  color: var(--premium-ink);
  font: 400 15px/1.55 "Cliniweb Appointment Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--premium-accent); }
[hidden] { display: none !important; }

.b-wrap { width: min(620px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 40px; }
.b-wrap.is-wide { width: min(700px, calc(100% - 32px)); }

/* ---- Header ------------------------------------------------------------ */
.b-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.b-head-mark {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border-radius: 9px; background: var(--premium-accent-soft); color: var(--premium-accent);
}
.b-head-mark svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.b-head-kicker, .b-kicker {
  font-size: .66rem; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--premium-muted);
}
.b-head-name { font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em; }

/* ---- Stepper ----------------------------------------------------------- */
.b-steps { display: flex; gap: 6px; list-style: none; margin: 0 0 14px; padding: 0; }
.b-steps li {
  flex: 1; display: flex; align-items: center; gap: 7px; min-width: 0;
  padding-top: 9px; border-top: 2px solid var(--premium-line);
  font-size: .7rem; font-weight: 550; color: #8a948e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.b-steps li span {
  width: 18px; height: 18px; flex: none; display: grid; place-items: center; border-radius: 5px;
  background: var(--premium-soft); font-size: .64rem; font-weight: 650;
}
.b-steps li.is-done { border-top-color: #9fbaa6; color: var(--premium-muted); }
.b-steps li.is-done span { background: var(--premium-accent-soft); color: var(--premium-accent); }
.b-steps li.is-current { border-top-color: var(--premium-accent); color: var(--premium-accent); }
.b-steps li.is-current span { background: var(--premium-accent); color: #fff; }
.b-steps em { font-style: normal; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) {
  .b-steps li:not(.is-current) { flex: 0 0 34px; }
  .b-steps li:not(.is-current) em { display: none; }
}

/* ---- Main card --------------------------------------------------------- */
.b-card {
  background: var(--premium-surface);
  border: 1px solid #e2e7df;
  border-radius: 13px;
  box-shadow: 0 3px 5px rgba(39,59,36,.025), 0 18px 40px -32px rgba(31,56,32,.20);
  padding: clamp(20px, 5vw, 32px);
  animation: b-rise .28s ease-out both;
}
@keyframes b-rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .b-card { animation: none; } }

.b-title {
  margin: 4px 0 6px;
  font-size: clamp(1.4rem, 4.6vw, 1.75rem); font-weight: 550; line-height: 1.2; letter-spacing: -.035em;
}
.b-lead { margin: 0 0 20px; color: var(--premium-muted); font-size: .9rem; }
.b-note { margin: 12px 0 0; color: var(--premium-muted); font-size: .78rem; }
.b-center { text-align: center; }
.b-section {
  margin: 24px 0 10px; padding-top: 18px; border-top: 1px solid var(--premium-line);
  font-size: .66rem; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--premium-muted);
}
.b-derived {
  margin: -8px 0 18px; padding: 9px 12px; border-radius: 7px;
  background: var(--premium-soft); color: var(--premium-muted); font-size: .8rem;
}

/* ---- Forms ------------------------------------------------------------- */
.b-form { margin: 0; }
.b-field { margin-bottom: 14px; }
.b-field label { display: block; margin-bottom: 5px; font-size: .78rem; font-weight: 600; }
.b-field small { display: block; margin-top: 6px; color: var(--premium-muted); font-size: .74rem; }
.b-opt { font-weight: 450; color: var(--premium-muted); }
.b-field input, .b-field select {
  width: 100%; min-height: 44px; padding: 10px 12px;
  background: var(--field-bg); border: 1px solid var(--field-line); border-radius: 7px;
  color: var(--premium-ink); font: inherit; font-size: 16px; /* 16px stops iOS zoom */
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.b-field input::placeholder { color: #778371; opacity: 1; }
.b-field input:focus, .b-field select:focus {
  background: #fff; border-color: #96b49c; box-shadow: 0 0 0 3px rgba(54,98,57,.08); outline: 0;
}
#said { font-size: 1.2rem; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.b-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.b-grid-3 { grid-template-columns: 1.4fr 1fr 1.2fr; }
@media (max-width: 520px) { .b-grid, .b-grid-3 { grid-template-columns: 1fr; } }

.b-check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; font-size: .84rem; cursor: pointer; }
.b-check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--premium-accent); }
.b-consent { margin-top: 20px; padding: 12px; border: 1px solid #e8ece3; border-radius: 8px; background: #fbfcf9; font-size: .8rem; color: var(--premium-muted); }

.b-captcha { margin: 4px 0 16px; min-height: 78px; }
@media (max-width: 380px) { .b-captcha .g-recaptcha { transform: scale(.88); transform-origin: 0 0; } .b-captcha { min-height: 70px; } }

.b-error {
  margin: 0 0 14px; padding: 10px 12px; border-radius: 7px;
  background: #f8ecea; color: var(--premium-danger); font-size: .84rem; font-weight: 550;
}

/* ---- Buttons ----------------------------------------------------------- */
.b-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px;
  border: 1px solid #dde3db; border-radius: 8px; background: #fff; color: #506652;
  font: inherit; font-weight: 550; text-decoration: none; cursor: pointer;
  transition: background .12s, border-color .12s, transform .06s;
}
.b-btn:active { transform: translateY(1px); }
.b-btn-primary {
  background: var(--premium-accent); border-color: var(--premium-accent); color: #fff; font-weight: 600;
  box-shadow: 0 2px 3px rgba(28,57,43,.10), inset 0 1px 0 rgba(255,255,255,.08);
}
.b-btn-primary:hover { background: var(--premium-accent-dark); border-color: var(--premium-accent-dark); }
.b-btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.b-btn-block { width: 100%; margin-top: 6px; }
.b-btn:focus-visible, .b-day:focus-visible, .b-time input:focus-visible + span, .b-radio input:focus-visible + span {
  outline: 2px solid #547b42; outline-offset: 2px;
}
.b-link { font-size: .84rem; font-weight: 550; }

/* ---- Existing patient contacts / summaries ----------------------------- */
.b-contacts, .b-summary, .b-practice dl { margin: 0; }
.b-contacts, .b-summary {
  border: 1px solid #e8ece3; border-radius: 9px; background: #fbfcf9; padding: 4px 14px; margin-bottom: 4px;
}
.b-contacts div, .b-summary div, .b-practice dl div {
  display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--premium-line);
}
.b-contacts div:last-child, .b-summary div:last-child, .b-practice dl div:last-child { border-bottom: 0; }
.b-contacts dt, .b-summary dt, .b-practice dt { color: var(--premium-muted); font-size: .78rem; }
.b-contacts dd, .b-summary dd, .b-practice dd { margin: 0; font-weight: 600; font-size: .86rem; text-align: right; }
.b-contacts dd { font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.b-contacts + .b-note { margin-bottom: 20px; }

/* ---- Slot picker ------------------------------------------------------- */
.b-days {
  display: flex; gap: 8px; overflow-x: auto; margin: 0 -4px 16px; padding: 2px 4px 8px;
  scroll-snap-type: x proximity; scrollbar-width: thin;
}
.b-day {
  flex: 0 0 auto; min-width: 84px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 12px;
  border: 1px solid #e2e7df; border-radius: 9px; background: #fff; color: var(--premium-ink);
  font: inherit; text-align: left; cursor: pointer; transition: border-color .12s, background .12s;
}
.b-day:hover { border-color: #b9cdbd; background: #f7f9f5; }
.b-day.is-active { border-color: var(--premium-accent); background: var(--premium-accent-soft); box-shadow: inset 0 0 0 1px var(--premium-accent); }
.b-day-dow { font-size: .64rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--premium-muted); }
.b-day-date { font-size: .98rem; font-weight: 600; letter-spacing: -.01em; }
.b-day-count { font-size: .68rem; color: var(--premium-success); }

.b-panel-date { margin: 0 0 10px; font-size: .92rem; font-weight: 600; }
.js .b-panel:not(.is-active) { display: none; }
.b-panel + .b-panel { margin-top: 18px; }
.b-provider { padding: 12px 0; border-top: 1px solid var(--premium-line); }
.b-provider-name { margin-bottom: 8px; font-size: .8rem; font-weight: 600; color: #506652; }
.b-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 7px; }
.b-time { position: relative; cursor: pointer; }
.b-time input, .b-radio input { position: absolute; opacity: 0; pointer-events: none; }
.b-time span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 42px; padding: 4px 6px;
  border: 1px solid #dde3db; border-radius: 8px; background: #fff;
  font-weight: 600; font-size: .9rem; font-variant-numeric: tabular-nums;
  transition: border-color .12s, background .12s, color .12s;
}
.b-time:hover span { border-color: #b9cdbd; background: #f3f6f0; color: var(--premium-accent); }
.b-time input:checked + span { background: var(--premium-accent); border-color: var(--premium-accent); color: #fff; }
.b-tag { font-style: normal; font-size: .58rem; font-weight: 550; opacity: .75; letter-spacing: .02em; }

.b-confirm {
  position: sticky; bottom: 0; margin: 18px calc(clamp(20px, 5vw, 32px) * -1) calc(clamp(20px, 5vw, 32px) * -1);
  padding: 16px clamp(20px, 5vw, 32px) clamp(18px, 5vw, 26px);
  background: rgba(255,255,255,.96); border-top: 1px solid var(--premium-line); border-radius: 0 0 13px 13px;
  backdrop-filter: blur(6px);
}
.b-confirm-slot { font-weight: 600; font-size: .9rem; margin-bottom: 10px; }
.b-confirm-slot.is-empty { color: var(--premium-muted); font-weight: 450; }
.b-format { display: flex; gap: 8px; margin: 0 0 10px; padding: 0; border: 0; }
.b-format legend { width: 100%; margin-bottom: 6px; font-size: .74rem; font-weight: 600; color: var(--premium-muted); }
.b-radio { flex: 1; cursor: pointer; }
.b-radio span {
  display: flex; align-items: center; justify-content: center; min-height: 40px; border: 1px solid #dde3db; border-radius: 8px;
  font-size: .86rem; font-weight: 550; color: #506652; background: #fff;
}
.b-radio input:checked + span { border-color: var(--premium-accent); background: var(--premium-accent-soft); color: var(--premium-accent); box-shadow: inset 0 0 0 1px var(--premium-accent); }
.b-radio.is-disabled { display: none; }
.b-virtual { margin-bottom: 8px; padding: 10px 12px; border-radius: 8px; background: #f5eddf; color: var(--premium-warning); font-size: .8rem; }
.b-virtual p { margin: 0 0 8px; }
.b-virtual .b-check { margin: 0; color: var(--premium-ink); }
.b-callout { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: #f5eddf; color: var(--premium-warning); font-size: .82rem; text-align: center; }

.b-next { margin-top: 20px; padding: 16px; border: 1px solid #d5e2d7; border-radius: 9px; background: var(--premium-accent-soft); }
.b-next-title { margin: 2px 0 4px; font-size: 1.05rem; font-weight: 600; letter-spacing: -.02em; }
.b-next p { margin: 0 0 10px; color: #506652; font-size: .84rem; }

/* ---- Status / done / practice ----------------------------------------- */
.b-status { padding: 14px 16px; border-radius: 9px; font-size: .9rem; }
.b-status p { margin: 0; }
.b-status-wait { background: #f5eddf; color: #5f4f2f; }
.b-status-error { background: #f8ecea; color: var(--premium-danger); }

.b-done-mark {
  width: 52px; height: 52px; margin: 0 auto 12px; display: grid; place-items: center;
  border-radius: 50%; background: var(--premium-accent-soft); color: var(--premium-accent);
}
.b-done-mark svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 24; stroke-dashoffset: 24; animation: b-draw .45s .15s ease-out forwards; }
@keyframes b-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .b-done-mark svg { animation: none; stroke-dashoffset: 0; } }
.b-summary { margin-top: 18px; }

.b-practice { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--premium-line); }
.b-practice-name { margin-bottom: 4px; font-weight: 600; }

.b-foot { margin-top: 18px; text-align: center; color: #8a948e; font-size: .7rem; }

/* Google Places dropdown in the premium palette */
.pac-container { border-radius: 8px; border: 1px solid #e2e7df; box-shadow: 0 12px 30px -18px rgba(31,56,32,.35); font-family: inherit; }
.pac-item { padding: 6px 10px; }

/* "Powered by Cliniweb" footer link back to the provider site (cliniweb.co.za) */
.pw-link { color: inherit; text-decoration: underline; text-decoration-color: rgba(138, 148, 142, .45); text-underline-offset: 2px; }
.pw-link:hover { color: #245b4b; }
