/* Patient Site: matches the vas-reversal.ca design language (colours, type, corners).
   Mobile-first; works inside iframes on vas-reversal.ca and as full pages. */
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin.woff2") format("woff2");
}

:root {
  --brand: #19406a;
  --brand-dark: #122f4e;
  --brand-50: #eef3f8;
  --brand-100: #d8e3ef;
  --ink: #1a2230;
  --ink-soft: #425062;
  --muted: #6a7487;
  --line: #e3e8ef;
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 30, 60, .06);
  --shadow-md: 0 6px 24px -8px rgba(15, 30, 60, .15);
  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  --ok: #1f7a4d; --ok-bg: #edf7f1;
  --warn: #9a6200; --warn-bg: #fdf6e7;
  --error: #b42318; --error-bg: #fdf0ee;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-sans); font-size: 17px; line-height: 1.6;
  font-feature-settings: "kern", "liga", "calt"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.embedded { background: transparent; }
.container { max-width: 760px; margin: 0 auto; padding: 24px 16px; }
body.embedded .container { padding: 8px 2px 16px; }
h1, h2, h3 { font-family: var(--font-serif); color: var(--ink); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .6em; font-weight: 600; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); margin-top: 1.25em; }
h3 { font-size: 1.15rem; }
p { color: var(--ink-soft); }
strong { color: var(--ink); }
a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.muted { color: var(--muted); font-size: .95rem; }
.eyebrow { display: inline-block; color: var(--brand); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; margin-bottom: .5rem; }
.env-banner { background: #b45309; color: #fff; font-weight: 600; font-size: 14px; padding: 6px 16px; text-align: center; }

/* Notices: same treatment as the site's callouts (left rule on a soft tint). */
.notice { border-left: 3px solid var(--brand); background: var(--brand-50); color: var(--ink-soft); padding: .75rem 1.1rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1rem 0; }
.notice p { margin: .25rem 0; }
.notice h2 { margin-top: 0; }
.notice-ok { border-color: var(--ok); background: var(--ok-bg); }
.notice-warn { border-color: var(--warn); background: var(--warn-bg); }
.notice-error { border-color: var(--error); background: var(--error-bg); color: var(--ink); }
.notice-info { border-color: var(--brand); background: var(--brand-50); }

/* Forms */
.vr-form .intro { color: var(--ink-soft); font-size: 1.02rem; }
.vr-form .field { margin: 0 0 20px; }
.vr-form label, .vr-form legend { display: block; font-weight: 600; color: var(--ink); margin: 0 0 6px; font-size: .98rem; }
.vr-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.vr-form fieldset label { margin-top: 10px; }
.vr-form input[type=text], .vr-form input[type=email], .vr-form input[type=tel], .vr-form input[type=number],
.vr-form input[type=date], .vr-form input:not([type]), .vr-form select, .vr-form textarea {
  display: block; width: 100%; font: inherit; font-size: 1rem; padding: .7rem .85rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); box-shadow: var(--shadow-sm);
}
.vr-form input:focus, .vr-form select:focus, .vr-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.vr-form .choice { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--ink-soft); padding: 6px 0; margin: 0; }
.vr-form .choice input { width: 20px; height: 20px; margin: 3px 0 0; flex: none; accent-color: var(--brand); }
.vr-form .req { color: var(--error); }
.vr-form .help { color: var(--muted); font-size: .9rem; margin: 6px 0 0; }
.vr-form .help-important { color: var(--ink-soft); background: var(--brand-50); border-left: 3px solid var(--brand); padding: .5rem .75rem; border-radius: 0 var(--radius) var(--radius) 0; }
.field-error { color: var(--error); font-size: .9rem; margin: 6px 0 0; display: block; }
.field-error:empty { display: none; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--error); }
.vr-form .row, .vr-form .row-2 { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
.vr-form .content-block { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; }
.vr-form .content-block p { margin: 0 0 6px; }
.form-page > h2:first-of-type { margin-top: .25em; }
.page-progress { color: var(--brand); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; margin: .5rem 0 .25rem; }
.page-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.page-actions [hidden] { display: none; }
.vr-form:not(.js-paged) .form-page:not(:last-of-type) [data-submit] { display: none; }

/* Buttons: as on vas-reversal.ca */
.btn {
  display: inline-block; padding: .85rem 1.4rem; border-radius: var(--radius); font: inherit; font-weight: 600; font-size: .98rem;
  line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; border: 1px solid transparent; min-height: 44px;
  transition: transform .08s ease, background .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-secondary:hover { background: var(--brand-50); }
.btn:disabled { opacity: .6; cursor: default; }
.page-actions .btn { flex: 1 1 150px; }

/* Calendar */
.calendar { background: #f7f8f8; border-radius: 4px; overflow: hidden; box-shadow: var(--shadow-sm); padding: 0 0 12px; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #555b61; color: #fff; padding: 6px 8px; }
.calendar-header h2 { margin: 0; text-align: center; flex: 1; font-family: var(--font-sans); font-weight: 400; font-size: 1.45rem; color: #fff; letter-spacing: .01em; }
.cal-nav { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; font-size: 1.6rem; line-height: 1; text-decoration: none; border-radius: 4px; color: #d5d8db; }
.cal-nav:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.cal-nav.disabled { color: #7d8389; }
.calendar-grid { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: 8px; }
.calendar-grid th { font-size: .95rem; color: #6b7177; font-weight: 400; padding: 8px 0 6px; }
.calendar-grid th abbr { text-decoration: none; }
.calendar-grid td { text-align: center; padding: 3px 0; }
/* Weekdays slightly lighter than weekends; stat holidays use the weekend shade. */
.calendar-grid td.weekday { background: #fbfcfc; }
.calendar-grid td.weekend { background: #eceef0; }
.calendar-grid .day { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 999px; font-size: 1rem; color: #555b61; border: 2px solid transparent; box-sizing: border-box; }
.calendar-grid td.other-month .day { color: #c9cdd1; }
.calendar-grid td.past .day { color: #b7bcc1; }
.calendar-grid td.today .day { font-weight: 700; color: var(--ink); }
/* Open day: a 2px ring in the type's colour, painted by embed.js (split when a day has several types). */
.day.open { background-origin: border-box; background-clip: padding-box, border-box; }
.legend { list-style: none; padding: 0 12px; margin: 10px 0 0; display: flex; gap: 18px; flex-wrap: wrap; font-size: .9rem; color: var(--ink-soft); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend-link { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.legend-link:hover { color: var(--brand); text-decoration-style: solid; }
.legend .legend-ring { display: inline-block; width: 16px; height: 16px; border-radius: 999px; border: 2px solid transparent; box-sizing: border-box; }

/* Slot picker */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.slot-day { font-family: var(--font-sans); font-size: .95rem; color: var(--brand); margin: 20px 0 8px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.slot { display: block; position: relative; margin: 0 !important; }
.slot input { position: absolute; opacity: 0; }
.slot-time {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; padding: 8px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; text-align: center; box-shadow: var(--shadow-sm);
}
.slot-time .edm { font-weight: 600; color: var(--ink); }
.slot-time .local { font-size: .8rem; font-weight: 400; color: var(--muted); }
.slot:hover .slot-time { border-color: var(--brand-100); }
.slot input:checked + .slot-time { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 2px var(--brand) inset; }
.slot input:focus-visible + .slot-time { box-shadow: 0 0 0 3px var(--brand-100); }
.slot-calendar { margin: 4px 0 8px; max-width: 420px; }
.slot-calendar[hidden], .slot-month[hidden], .slot-day-group[hidden], .slot-prompt[hidden] { display: none; }
.slot-calendar .calendar-header h2 { font-size: 1.15rem; }
.slot-calendar .cal-nav { background: none; border: 0; cursor: pointer; font: inherit; font-size: 1.6rem; }
.slot-calendar .cal-nav:disabled { color: #7d8389; cursor: default; }
.calendar-grid button.day { font: inherit; cursor: pointer; padding: 0; background-color: transparent; }
.calendar-grid button.day:hover { box-shadow: 0 0 0 2px var(--brand-100); }
.calendar-grid button.day.selected { background-image: none !important; background-color: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.slot-prompt { color: var(--ink-soft); margin: 8px 0 0; }
.tz-ack { margin-top: 18px; }
.tz-ack[hidden] { display: none; }
.code-input { font-size: 1.5rem !important; letter-spacing: .3em; max-width: 12rem; text-align: center; }
.choice-cards { display: grid; gap: 14px; grid-template-columns: 1fr; }
.choice-cards .card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); }
.choice-cards .card h2 { margin-top: 0; font-size: 1.2rem; }

@media (min-width: 600px) {
  .vr-form .row { grid-template-columns: 2fr 1.5fr 1fr; }
  .vr-form .row-2 { grid-template-columns: 1fr 1fr; }
  .calendar-grid .day { width: 44px; height: 44px; }
  .page-actions .btn { flex: 0 0 auto; }
  .choice-cards { grid-template-columns: 1fr 1fr; }
}

/* Email confirmation */
.verify-panel { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--brand-100); border-radius: var(--radius); background: var(--brand-50); }
.verify-panel p { margin-top: 0; }
.verify-panel .page-actions { margin-top: 12px; }
.vr-form .help-code { color: var(--ink-soft); font-weight: 600; }
.verified-badge { color: var(--ok); font-weight: 600; font-size: .95rem; margin: 8px 0 0; }
.verified-badge[hidden], .verify-panel[hidden] { display: none; }

/* Estimate acceptance page */
.estimate-summary { background: var(--brand-50); border-left: 3px solid var(--brand); border-radius: 0 var(--radius) var(--radius) 0; padding: 12px 16px; margin: 0 0 18px; }
.estimate-summary p { margin: 0 0 6px; }
.estimate-summary p:last-child { margin-bottom: 0; }

/* Invoice payment page */
.amount-input { display: flex; align-items: center; gap: 6px; max-width: 14rem; }
.amount-input span { font-size: 1.2rem; color: var(--ink-soft); }
.amount-input input { font-size: 1.2rem; }
.pay-summary { width: 100%; max-width: 26rem; border-collapse: collapse; margin: 6px 0 10px; }
.pay-summary td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.pay-summary td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.pay-summary .pay-total td { font-size: 1.1rem; color: var(--ink); border-bottom: 0; }

/* Estimates and invoices behind an emailed code (design §9.11) */
.notice-privacy { border-color: var(--ink-soft); background: #f4f5f7; }
.document-viewer { margin: 0 0 24px; }
.document-frame { width: 100%; height: 75vh; min-height: 480px; border: 1px solid #d5d9e0; border-radius: var(--radius); background: #f4f5f7; }
@media (max-width: 600px) { .document-frame { height: 60vh; min-height: 360px; } }

/* Intake: consent to receive booking information by email (required) */
.email-consent { border: 2px solid var(--warn); background: var(--warn-bg); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 20px; }
.email-consent .consent { font-weight: 600; }
.email-consent .help { margin: 8px 0 0 28px; }

/* On/off switch (form field type Switch) */
.vr-form .switch-choice { display: flex; gap: 12px; align-items: center; font-weight: 600; color: var(--ink); margin: 0; cursor: pointer; }
.vr-form .switch-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; flex: none; width: 44px; height: 24px; border-radius: 12px; background: #c9ced6; transition: background .15s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch-choice input:checked + .switch-track { background: var(--brand); }
.switch-choice input:checked + .switch-track::after { transform: translateX(20px); }
.switch-choice input:focus-visible + .switch-track { outline: 2px solid var(--brand); outline-offset: 2px; }
.vr-form [data-region-for][hidden], .vr-form [data-region-label][hidden] { display: none; }

/* Payment deadline on the procedure booking page (orange warning block) */
.notice-deadline { border-left-color: #ea580c; background: #fff4ea; color: var(--ink); }
.notice-deadline .deadline-title { color: #9a3412; }
.notice-deadline .choice { font-weight: 600; color: var(--ink); }

/* Procedure times: a few long blocks per day, shown larger (decided 2026-11-04) */
.slot-grid-large { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.slot-grid-large .slot-time { padding: 14px 16px; font-size: 1.05rem; }
.slot-part { display: block; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); }
.slot-day-group:has(.slot-grid-large) .slot-day { font-size: 1.1rem; margin-top: 24px; }

/* Highlighted notice inside a form (e.g. when the emergency contact is contacted) */
.vr-form .content-block.content-highlight { background: var(--warn-bg); border: 1px solid #f1d9a8; border-left: 4px solid var(--warn); }
.vr-form .content-block.content-highlight strong { color: var(--warn); }

/* Estimate and invoice pages: Download on the left, Lock on the right */
.document-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.document-actions form { margin: 0 0 0 auto; }

/* Estimate page: the accept buttons stay disabled until both boxes are ticked */
.accept-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.accept-actions .btn[disabled] { opacity: .45; cursor: not-allowed; }
.code-help { margin: 6px 0 0; font-size: .88rem; color: var(--muted); }

/* The patient portal (design §9.12): sidebar beside the page on wide screens, above it on phones. */
.portal { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.portal > .container { max-width: none; margin: 0; padding: 16px 0 24px; min-width: 0; }
.portal-nav { margin-top: 16px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.portal-nav-title { margin: 0 0 8px; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.portal-nav ul { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.portal-nav li { flex: 1 1 140px; }
.portal-nav li a { display: block; padding: 8px 12px; border-radius: 8px; border-left: 3px solid transparent; text-decoration: none; color: var(--ink); background: var(--bg); }
.portal-nav li a:hover { background: var(--brand-50); }
.portal-nav li a.on { background: var(--brand-50); border-left-color: var(--brand); }
.portal-nav li a span { display: block; font-weight: 600; }
.portal-nav li a small { display: block; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.portal-nav form { margin: 0; }
.portal-lock { width: 100%; padding-top: 8px; padding-bottom: 8px; font-size: .95rem; }
.portal-nav-note { margin: 8px 0 0; font-size: .78rem; color: var(--muted); line-height: 1.4; }
@media (min-width: 900px) {
  .portal { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 32px; align-items: start; padding: 0 24px; }
  .portal > .container { padding-top: 24px; }
  .portal-nav { position: sticky; top: 16px; margin-top: 24px; }
  .portal-nav ul { display: block; }
  .portal-nav li { margin-bottom: 4px; }
}
.portal-appointments { list-style: none; margin: 0 0 12px; padding: 0; }
.portal-appointments > li { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 12px 16px; margin-bottom: 8px; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 0 var(--radius) var(--radius) 0; }
.portal-appointments > li strong { display: block; }
.portal-appointments > li span { color: var(--ink-soft); }
.portal-appointments > li .btn { padding: 8px 14px; font-size: .95rem; }
.portal-appointments-past > li { border-left-color: var(--line); background: transparent; }
.calendar-menu { position: relative; }
.calendar-menu summary { list-style: none; cursor: pointer; }
.calendar-menu summary::-webkit-details-marker { display: none; }
.calendar-menu summary::after { content: " ▾"; }
.calendar-menu ul { list-style: none; margin: 6px 0 0; padding: 6px; position: absolute; right: 0; z-index: 5; min-width: 270px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.calendar-menu ul a { display: block; padding: 9px 12px; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: .95rem; }
.calendar-menu ul a:hover, .calendar-menu ul a:focus { background: var(--brand-50); }
@media (max-width: 600px) { .calendar-menu { width: 100%; } .calendar-menu summary { width: 100%; text-align: center; } .calendar-menu ul { position: static; box-shadow: none; } }
.portal-nav li a span { display: flex !important; align-items: center; justify-content: space-between; gap: 8px; }
.portal-mark { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 6px; border-radius: 999px; font-size: .74rem; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.portal-mark i { font-style: normal; }
.portal-mark-ok { color: var(--ok); background: var(--ok-bg); }
.portal-mark-late { color: #fff; background: var(--error); }
.portal-mark-warn { color: var(--warn); background: var(--warn-bg); }
.calendar-menu ul li { margin: 0; }
.portal-mark-ok { padding: 0; width: 1.5em; height: 1.5em; justify-content: center; font-size: .85rem; }

/* Patient information videos (design §7.7). */
.vr-video { margin: 0 0 18px; }
.vr-video video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #0f2a47; border-radius: var(--radius); border: 1px solid var(--line); }
.vr-video-status { margin: 8px 0 0; }
.vr-video.is-watched .vr-video-status { color: var(--ok); font-weight: 600; }
.vr-chapters { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.vr-chapters button { width: 100%; text-align: left; padding: 8px 12px; border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 0 8px 8px 0; background: #fff; color: var(--ink); font: inherit; font-size: .95rem; cursor: pointer; }
.vr-chapters button:hover { background: var(--brand-50); }
.vr-chapters button.on { border-left-color: var(--brand); background: var(--brand-50); font-weight: 600; }
.vr-chapters button span { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; font-weight: 400; }
.portal-mark[hidden] { display: none; }
.vr-video-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.vr-video-bar .vr-video-status { margin: 0 0 0 6px; flex: 1 1 240px; }
.vr-video-bar .vr-video-status:empty { display: none; }
/* Two matching small controls under the video; the extra selectors beat the form's full-width field styles. */
.vr-video-bar .vr-cc, .vr-form .vr-video-bar select.vr-speed, .vr-video-bar select.vr-speed {
  display: inline-block; width: auto; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
  background-color: #fff; color: var(--ink-soft); font: inherit; font-size: .9rem; font-weight: 600; line-height: 1; cursor: pointer; box-shadow: none;
}
.vr-video-bar .vr-cc:hover, .vr-video-bar select.vr-speed:hover { border-color: var(--brand); color: var(--brand); }
.vr-video-bar .vr-cc[aria-pressed="true"] { border-color: var(--brand); background-color: var(--brand-50); color: var(--brand); }
.vr-video-bar select.vr-speed { padding-right: 10px; }
.hold-note { display: flex; align-items: center; gap: 16px; }
.hold-note p { margin: 0; }
.hold-clock { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); min-width: 4.2ch; text-align: center; line-height: 1; }
.hold-clock:empty, .hold-clock span:empty { display: none; }
@media (max-width: 600px) { .hold-note { flex-direction: column; align-items: flex-start; gap: 6px; } }
.vr-form .video-confirm { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); color: var(--ink); font-weight: 600; align-items: center; cursor: pointer; }
.vr-form .video-confirm input { margin: 0; }
