:root {
    --ink: #17304f;
    --muted: #66778c;
    --line: #d8e3ef;
    --paper: #ffffff;
    --wash: #f4f8fc;
    --blue: #2f6fb3;
    --blue-dark: #1f4f8f;
    --blue-soft: #e8f1fb;
    --coral: #c86c51;
    font-family: "Aptos", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 90% 0%, #dbeafe, transparent 35%), var(--wash); color: var(--ink); }
.topbar { height: 72px; padding: 0 clamp(20px, 5vw, 72px); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(24, 50, 71, .09); background: rgba(255,255,255,.88); }
.brand { font-weight: 800; letter-spacing: .02em; }
.secure-label { color: var(--blue-dark); font-size: 13px; }
.shell { max-width: 1180px; margin: 0 auto; padding: 58px clamp(20px, 5vw, 72px) 80px; }
.intro-row { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); gap: 28px; align-items: end; margin-bottom: 38px; }
.intro { max-width: 680px; }
.intro-copy { margin-bottom: 0; }
.directory-search { position: relative; padding-bottom: 5px; }
.directory-search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.directory-search-form input { min-width: 0; min-height: 46px; }
.directory-search-form .primary-button { min-height: 46px; }
.directory-search-results { position: absolute; z-index: 2; top: calc(100% + 8px); left: 0; right: 0; max-height: 310px; overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); box-shadow: 0 12px 28px rgba(24,50,71,.14); }
.directory-search-results p { margin: 8px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.directory-result { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); cursor: pointer; font: inherit; text-align: left; line-height: 1.4; }
.directory-result:hover, .directory-result:focus-visible { outline: none; background: var(--blue-soft); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.eyebrow { margin: 0 0 12px; color: var(--coral); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(34px, 5vw, 64px); line-height: 1.02; letter-spacing: -.035em; }
.intro-copy { color: var(--muted); font-size: 17px; line-height: 1.55; max-width: 540px; }
.booking-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 26px; box-shadow: 0 16px 35px rgba(24,50,71,.06); }
.panel-heading { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 24px; }
.panel-heading h2 { margin: 0 0 5px; font-size: 21px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.step { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; background: var(--blue-soft); color: var(--blue-dark); font-size: 12px; font-weight: 800; }
label { display: grid; gap: 7px; margin-bottom: 17px; color: var(--muted); font-size: 13px; font-weight: 700; }
.booking-check { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
select, input, textarea { width: 100%; min-height: 44px; border: 1px solid #c9d6dc; border-radius: 6px; padding: 0 12px; color: var(--ink); background: #fff; font: inherit; font-weight: 500; }
textarea { min-height: 104px; padding: 11px 12px; resize: vertical; line-height: 1.45; }
select:focus, input:focus, textarea:focus { outline: 3px solid rgba(47,111,179,.16); border-color: var(--blue); }
.doctor-info { padding: 16px; border-radius: 7px; background: var(--blue-soft); color: var(--blue-dark); font-size: 14px; line-height: 1.5; }
.doctor-info.empty, .slot-list.empty { color: var(--muted); background: #f7f9fa; }
.slot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)); gap: 9px; min-height: 100px; align-content: start; padding: 14px; border-radius: 7px; background: #f7f9fa; }
.slot-button { min-height: 46px; border: 1px solid #b7cdec; border-radius: 5px; color: var(--blue-dark); background: #fff; cursor: pointer; font-weight: 800; display: grid; place-items: center; gap: 2px; padding: 6px 8px; }
.slot-button:hover, .slot-button.selected { color: #fff; background: var(--blue); border-color: var(--blue); }
.slot-button:disabled { cursor: not-allowed; }
.slot-button.booked { color: #8b5b52; background: #f6ebe8; border-color: #e5c7c0; }
.slot-button.held { color: #8a4f00; background: #fff3d8; border-color: #f3c66f; }
.slot-time { font-size: 15px; line-height: 1.1; }
.slot-status { font-size: 10px; line-height: 1.15; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.patient-panel { margin-top: 18px; }
.hidden { display: none; }
.selected-slot { margin: -4px 0 22px; padding: 13px 15px; border-left: 4px solid var(--coral); background: #fff5f1; color: #82472f; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.full-row { grid-column: 1 / -1; }
.required-star { color: #b04432; font-weight: 900; }
.required-note { margin: -8px 0 18px; color: var(--muted); font-size: 13px; font-weight: 700; }
.primary-button { min-height: 46px; padding: 0 20px; border: 0; border-radius: 6px; background: var(--blue); color: #fff; cursor: pointer; font: inherit; font-weight: 800; }
.primary-button:hover { background: var(--blue-dark); }
.secondary-button { min-height: 44px; padding: 0 18px; border: 1px solid #b7cdec; border-radius: 6px; background: #fff; color: var(--blue-dark); cursor: pointer; font: inherit; font-weight: 800; }
.secondary-button:hover { border-color: var(--blue); color: var(--blue); }
.danger-button { min-height: 46px; padding: 0 20px; border: 1px solid #a23b2e; border-radius: 6px; background: #a23b2e; color: #fff; cursor: pointer; font: inherit; font-weight: 800; }
.danger-button:hover { border-color: #832a24; background: #832a24; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.link-button { display: inline-flex; align-items: center; text-decoration: none; }
.form-message { margin-top: 16px; color: var(--blue-dark); font-weight: 700; }
.form-message.error { color: #a23b2e; }
.confirmation-panel { max-width: 720px; margin-top: 18px; }
.compact-heading { margin-bottom: 18px; }
.confirmation-summary { display: grid; gap: 10px; margin: 22px 0; padding: 18px; border-radius: 8px; background: #f6f8fb; border: 1px solid #e3e8ef; }
.confirmation-summary div { display: grid; gap: 3px; }
.confirmation-summary span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.confirmation-summary strong { color: var(--ink); font-size: 16px; line-height: 1.45; }
.summary-problem strong { white-space: pre-wrap; }
.confirmation-note { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 18px; padding: 13px 15px; border-radius: 7px; font-weight: 800; line-height: 1.5; }
#confirmationNote { margin-bottom: 0; }
.note-button { margin-left: auto; }
.warning-note { color: #8a4f00; background: #fff3d8; border: 1px solid #f3c66f; }
.success-note { color: var(--blue-dark); background: var(--blue-soft); border: 1px solid #b7cdec; }
.warning-icon, .success-icon { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; color: #fff; font-size: 14px; font-weight: 900; line-height: 1; }
.warning-icon { background: #b66a00; }
.success-icon { background: var(--blue); }
footer { padding: 22px; text-align: center; color: var(--muted); font-size: 12px; }
@media (max-width: 820px) { .intro-row { grid-template-columns: 1fr; gap: 18px; } .booking-layout { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .shell { padding-top: 34px; } .form-grid { grid-template-columns: 1fr; } h1 { font-size: 40px; } .panel { padding: 20px; } .directory-search-form { grid-template-columns: 1fr; } }
