:root {
  --background: #f8f7f1;
  --surface: #fffef9;
  --ink: #173a30;
  --soft-ink: #4f655c;
  --green: #235745;
  --green-dark: #163d30;
  --sage: #e6ede2;
  --border: #d8ded1;
  --error: #982d31;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body.booking-page {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font: 400 1rem/1.75 Cairo, Tahoma, sans-serif;
}
a { color: var(--green-dark); text-underline-offset: .2em; }
a:hover { color: var(--green); }
:focus-visible { outline: 3px solid #975823; outline-offset: 4px; }
img { display: block; max-inline-size: 100%; }
button, input, select, textarea { font: inherit; }
button:not(:disabled) { cursor: pointer; }
p, h1, h2, h3, dl { margin: 0; }
.page-width { width: min(1184px, calc(100% - 88px)); margin-inline: auto; }

.booking-header, .booking-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.booking-header { padding-block: 1.25rem; }
.booking-header nav { display: flex; gap: 1.4rem; align-items: center; }
.clinic-brand {
  display: inline-flex;
  gap: .7rem;
  align-items: center;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}
.clinic-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font: 400 1.8rem/1 Arial, sans-serif;
}
.contact-link { font-size: .875rem; font-weight: 700; text-decoration: none; }
.contact-link:hover { text-decoration: underline; }
.chat-link { white-space: nowrap; font-size: .875rem; font-weight: 700; text-decoration: none; }
.chat-link:hover { text-decoration: underline; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  min-height: 2.75rem;
  padding: .55rem 1.25rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  background: var(--green);
  color: white;
  font-size: .9rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.btn:hover, .btn:focus-visible { background: var(--green-dark); color: white; }
.btn:disabled { opacity: .65; cursor: wait; }
.btn.ghost { border-color: #bac8bb; background: transparent; color: var(--green-dark); }
.btn.ghost:hover { background: var(--sage); }

.booking-hero {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  align-items: stretch;
  min-height: 410px;
  border-radius: 1.5rem;
  overflow: hidden;
  background: #e8ede2;
}
.hero-copy {
  align-self: center;
  padding: clamp(1.8rem, 5vw, 4rem);
}
.hero-kicker { display: flex; gap: .5rem; align-items: center; color: var(--green); font-size: .875rem; font-weight: 700; }
.hero-kicker > span:first-child { width: .5rem; height: .5rem; flex: none; border-radius: 50%; background: #65836c; }
.booking-hero h1 { margin: .55rem 0 .7rem; font-size: clamp(2.5rem, 5vw, 4.4rem); font-weight: 800; line-height: 1.42; }
.booking-hero em { color: var(--green); font-style: normal; }
.hero-description { max-width: 31ch; color: var(--soft-ink); font-size: .95rem; line-height: 1.9; }
.hero-book { margin-top: 1.45rem; padding-inline: 1.25rem; }
.hero-image { width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: center 55%; }

.booking-section { scroll-margin-top: 1.5rem; padding-block: 2.75rem 3.5rem; }
.section-heading { margin-bottom: 1.25rem; }
.section-heading h2 { font-size: clamp(1.65rem, 2.8vw, 2.15rem); line-height: 1.4; font-weight: 800; }
.section-heading p { margin-top: .35rem; color: var(--soft-ink); font-size: .9rem; }
.booking-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: clamp(1.15rem, 3.4vw, 2.5rem);
  box-shadow: 0 12px 36px #203c2910;
}
.doctor-selection { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.75rem; }
#doctor-picker { flex: 0 1 22rem; }
.doctor-profile { display: flex; align-items: center; gap: .75rem; flex: 1 1 15rem; min-width: 0; }
.doctor-profile h3 { font-size: 1rem; }
.doctor-profile p, .doctor-profile a { color: var(--soft-ink); font-size: .85rem; }
.doctor-profile a { margin-inline-start: auto; }
.doctor-avatar {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--sage);
  color: var(--green);
  flex: none;
  overflow: hidden;
  font: 400 1.6rem/1 Arial, sans-serif;
}
.doctor-avatar img { width: 100%; height: 100%; object-fit: cover; }
.clinic-details {
  display: flex;
  flex-wrap: wrap;
  flex: 1 0 100%;
  gap: .5rem 1.75rem;
  padding: .8rem 1rem;
  border-radius: .65rem;
  background: #f1f3ea;
  color: var(--soft-ink);
  font-size: .83rem;
  overflow-wrap: anywhere;
}
.clinic-detail dt { font-weight: 700; color: var(--ink); }
.clinic-detail dd { margin: 0; }
.availability { padding: 1rem 0 0; color: var(--soft-ink); font-size: .9rem; }
.availability a { margin-inline-start: .5rem; font-weight: 700; }

.form-columns {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 1.5rem 2.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
.form-columns:has(#patient-fields[hidden]) { grid-template-columns: 1fr; }
legend { padding: 0; margin-bottom: .65rem; color: var(--ink); font-size: 1.08rem; font-weight: 800; }
.fld { min-width: 0; margin-bottom: .9rem; }
label, .field-label { display: block; font-size: .88rem; font-weight: 700; margin-bottom: .3rem; }
label small { color: var(--soft-ink); font-weight: 400; margin-inline-start: .3rem; }
.required, .err, .manage-feedback { color: var(--error); }
input:not([type="checkbox"]), select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 2.85rem;
  padding: .55rem .65rem;
  color: var(--ink);
  background: white;
  border: 1px solid #c4d0c3;
  border-radius: .55rem;
  font-size: 1rem;
}
input::placeholder, textarea::placeholder { color: #5c6e64; }
textarea { min-height: 4.85rem; resize: vertical; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .75rem; }
.days, .slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; }
.chip {
  min-height: 2.85rem;
  background: white;
  border: 1px solid #c4d0c3;
  color: var(--green-dark);
  border-radius: .55rem;
  padding: .35rem .2rem;
  font-size: .81rem;
  font-weight: 700;
}
.days .chip small { display: block; color: inherit; font-size: .72rem; font-weight: 400; }
.chip:hover:not(:disabled) { border-color: var(--green); }
.chip.on { border-color: var(--green); background: var(--sage); box-shadow: inset 0 0 0 1px var(--green); }
.chip:disabled { background: #f0f2ed; color: #58645d; text-decoration: line-through; }
.placeholder, .loading, .waitlist-option { grid-column: 1 / -1; color: var(--soft-ink); font-size: .87rem; }
.waitlist-option .btn { margin-top: .5rem; }
.selection-summary { padding: .55rem .8rem; border-radius: .5rem; background: var(--sage); color: var(--green-dark); font-size: .86rem; }
.upload-details summary { color: var(--green-dark); cursor: pointer; font-size: .88rem; font-weight: 700; }
.upload-area { margin-top: .6rem; padding: .75rem; border: 1px dashed #9fac9f; border-radius: .55rem; }
.upload-area label small { display: block; margin-inline-start: 0; }
.upload-area input { font-size: .82rem; }
.upload-area p { margin-top: .4rem; color: var(--soft-ink); font-size: .82rem; }
.submit-fields { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.booking-consent { display: flex; align-items: start; gap: .6rem; font-weight: 400; margin-bottom: .85rem; }
.booking-consent input { flex: none; width: 1.15rem; height: 1.15rem; margin: .2rem 0 0; accent-color: var(--green); }
#go { min-width: 9rem; }
.booking-disclaimer { display: inline-block; margin-inline-start: .75rem; color: var(--soft-ink); font-size: .83rem; }
.err, .manage-feedback { font-size: .85rem; overflow-wrap: anywhere; }
.err:not(:empty), .manage-feedback:not(:empty) { margin-top: .6rem; }

.ok { text-align: center; margin-bottom: 1.25rem; }
.success-icon { display: grid; place-items: center; margin: 0 auto .6rem; width: 3rem; height: 3rem; border-radius: 50%; background: var(--sage); font-size: 1.4rem; }
.ok .big { margin: .5rem 0; color: var(--green); font-size: 1.3rem; font-weight: 800; }
.manage-card { padding: 1rem; background: #eef3e9; border: 1px solid var(--border); border-radius: .75rem; margin-bottom: 1rem; }
.manage-card h3 { font-size: 1rem; }
.manage-card p { margin: .3rem 0 .65rem; font-size: .87rem; }
.manage-actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.manage-card .btn { font-size: .82rem; padding-inline: .7rem; }
.manage-editor { margin-top: .7rem; }
.manage-editor input { margin-bottom: .45rem; }
.management-link {
  direction: ltr;
  text-align: left;
  margin: .7rem 0;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: .55rem;
  background: white;
  font-size: .84rem;
  overflow-wrap: anywhere;
}
.booking-footer { padding-block: 1.25rem; border-top: 1px solid var(--border); color: var(--soft-ink); font-size: .87rem; }
.booking-footer span { font-weight: 700; }

@media (max-width: 860px) {
  .page-width { width: calc(100% - 48px); }
  .booking-hero { min-height: 355px; }
  .form-columns { gap: 1.25rem; }
  .days, .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .page-width { width: calc(100% - 32px); }
  .booking-header { padding-block: .75rem; gap: .5rem; }
  .booking-header nav { gap: .5rem; flex: none; }
  .clinic-mark { width: 2rem; height: 2rem; font-size: 1.3rem; }
  .clinic-brand { font-size: .875rem; gap: .4rem; }
  .header-book { padding-inline: .6rem; font-size: .8rem; }
  .contact-link { display: none; }
  .chat-link { font-size: .8rem; }
  .clinic-brand span:last-child { overflow-wrap: anywhere; }
  .booking-hero { grid-template-columns: 1fr; min-height: 0; border-radius: 1rem; }
  .hero-copy { padding: 1.25rem 1.15rem; }
  .hero-kicker { font-size: .8rem; }
  .booking-hero h1 { font-size: clamp(2rem, 8.5vw, 2.9rem); }
  .hero-book { margin-top: .85rem; }
  .hero-image { height: clamp(145px, 40vw, 250px); }
  .booking-section { padding-block: 1.65rem 2.35rem; }
  .section-heading { margin-bottom: .85rem; }
  .doctor-selection { gap: .65rem; }
  #doctor-picker { flex-basis: 100%; }
  .booking-card { padding: 1rem; }
  .form-columns { grid-template-columns: 1fr; }
  .days, .slots { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .booking-disclaimer { display: block; margin: .4rem 0 0; }
  #go { width: 100%; }
}
@media (max-width: 370px) {
  .field-pair { grid-template-columns: 1fr; }
  .days, .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
