:root {
  --ink: #111316;
  --muted: #6d7178;
  --line: #e7e8ea;
  --surface: #ffffff;
  --soft: #f7f7f5;
  --accent: #cf3b49;
  --accent-dark: #a52632;
  --shadow: 0 18px 55px rgba(20, 25, 32, .08);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--soft);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0%, rgba(207, 59, 73, .06), transparent 30rem),
    var(--soft);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  height: 82px;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: auto;
  height: 54px;
  max-width: min(330px, 58vw);
  object-fit: contain;
}

.header-help {
  color: var(--muted);
  font-size: 14px;
}

.header-help a {
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
}

.page-shell {
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 54px 0 70px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: end;
  padding: 18px 4px 38px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .18em;
  color: var(--accent);
}

.hero h1 {
  font-size: clamp(42px, 7vw, 78px);
  line-height: .96;
  letter-spacing: -.055em;
  margin: 14px 0 18px;
  max-width: 760px;
  font-weight: 600;
}

.hero p {
  max-width: 690px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  margin: 0;
}

.hero-badge {
  min-width: 180px;
  padding: 18px 0 5px;
  border-top: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  text-align: right;
  font-size: 13px;
  color: var(--muted);
}

.hero-badge strong {
  color: var(--ink);
  font-size: 17px;
  margin-top: 4px;
}

.booking-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 24px;
  overflow: hidden;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
  background: #fcfcfb;
}

.step {
  min-height: 86px;
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 18px 24px;
  opacity: .42;
  border-right: 1px solid var(--line);
}

.step:last-child {
  border-right: 0;
}

.step.active,
.step.done {
  opacity: 1;
}

.step > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  border: 1px solid #c8cace;
  font-weight: 700;
}

.step.active > span,
.step.done > span {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.step div {
  display: flex;
  flex-direction: column;
}

.step b {
  font-size: 14px;
}

.step small {
  color: var(--muted);
  margin-top: 3px;
}

#patientStep,
#appointmentStep,
.review-panel,
.confirmation {
  padding: 42px;
}

h2 {
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -.035em;
  margin: 0 0 10px;
  font-weight: 600;
}

h3 {
  margin: 7px 0;
  font-size: 23px;
  letter-spacing: -.02em;
}

.section-copy {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.patient-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  background: var(--soft);
  border-radius: 999px;
  padding: 5px;
  margin: 28px 0;
  border: 1px solid var(--line);
}

.toggle {
  min-height: 44px;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 650;
}

.toggle.active {
  background: var(--ink);
  color: white;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.form-grid > *,
.lookup-grid > *,
.filters > * {
  min-width: 0;
}

label > span {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .01em;
}

input,
select {
  width: 100%;
  min-height: 52px;
  border: 1px solid #d8dade;
  border-radius: 12px;
  padding: 0 14px;
  background: white;
  color: var(--ink);
  outline: none;
  transition: border .15s, box-shadow .15s;
}

input[type="date"] {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  font-size: 16px;
}

input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  min-width: 0;
}

input:focus,
select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17,19,22,.06);
}

.full {
  grid-column: 1 / -1;
}

.form-action {
  display: flex;
  justify-content: flex-end;
  margin-top: 5px;
}

.primary-btn,
.dark-btn {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  padding: 0 24px;
  cursor: pointer;
  font-weight: 750;
}

.primary-btn {
  background: var(--accent);
  color: white;
}

.primary-btn:hover {
  background: var(--accent-dark);
}

.dark-btn {
  background: var(--ink);
  color: white;
}

button:disabled {
  cursor: wait;
  opacity: .6;
}

.existing-patient-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 5px;
}

.patient-number-help {
  margin-top: 18px;
}

.forgot-number-btn {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 8px 0;
  cursor: pointer;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lookup-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--soft);
  padding: 22px;
}

.lookup-panel h3 {
  margin-bottom: 5px;
}

.lookup-panel p {
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.5;
}

.lookup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.lookup-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  margin-top: 18px;
}

.verification-panel {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--soft);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
}

.verification-panel p {
  color: var(--muted);
  margin: 0;
}

.code-row {
  display: flex;
  gap: 10px;
  min-width: 320px;
}

.code-row input {
  text-align: center;
  font-size: 22px;
  letter-spacing: .18em;
}

.message {
  margin: 22px 42px 0;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 14px;
}

.message.error {
  background: #fff0f1;
  color: #8e2630;
  border: 1px solid #f4c8cc;
}

.message.success {
  background: #eef8f1;
  color: #21653a;
  border: 1px solid #cce7d4;
}

.section-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
}

.text-btn,
.review-back {
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  text-decoration: underline;
  padding: 8px 0;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 28px 0 30px;
}

.availability-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.availability-status {
  color: var(--muted);
  font-size: 14px;
  margin-top: 7px;
}

.date-scroll-wrap {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.date-scroll-arrow {
  width: 44px;
  height: 78px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}

.date-scroll-arrow:hover {
  border-color: #b7b9bd;
}

.date-selector {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 2px 2px 10px;
}

.date-selector::-webkit-scrollbar {
  display: none;
}

.date-pill {
  flex: 0 0 96px;
  min-height: 102px;
  padding: 11px 10px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 16px;
  scroll-snap-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: transform .12s, border .12s, background .12s, color .12s;
}

.date-pill:hover {
  transform: translateY(-2px);
  border-color: #b7b9bd;
}

.date-pill.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
  box-shadow: 0 8px 22px rgba(17,19,22,.14);
}

.date-weekday {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .7;
}

.date-day {
  font-size: 28px;
  line-height: 1;
  margin-top: 4px;
}

.date-month {
  font-size: 12px;
  margin-top: 2px;
}

.date-pill small {
  display: block;
  margin-top: 7px;
  font-size: 10px;
  opacity: .67;
}

.selected-date-heading {
  margin-top: 26px;
  margin-bottom: 13px;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.015em;
}

.time-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.time-button {
  min-height: 84px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform .12s, border .12s, box-shadow .12s;
}

.time-button:hover {
  transform: translateY(-2px);
  border-color: #b7b9bd;
  box-shadow: 0 8px 24px rgba(20,25,32,.07);
}

.time-main {
  font-size: 20px;
  font-weight: 800;
}

.time-office {
  margin-top: 5px;
  font-size: 13px;
  font-weight: 700;
}

.time-doctor {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.empty-times {
  margin-top: 20px;
  padding: 25px;
  border: 1px dashed #cfd1d4;
  border-radius: 16px;
  text-align: center;
  color: var(--muted);
  background: #fbfbfa;
}

.review-panel {
  min-height: 470px;
}

.review-content {
  max-width: 760px;
  margin: 26px auto 0;
}

.review-details {
  margin: 28px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.review-details div {
  padding: 19px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-bottom: 1px solid var(--line);
}

.review-details div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.review-details div.wide {
  grid-column: 1 / -1;
  border-right: 0;
}

.review-details span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .09em;
}

.review-details strong {
  font-size: 16px;
}

.review-actions {
  display: flex;
  justify-content: flex-end;
}

.review-confirm {
  min-width: 230px;
}

.confirmation {
  text-align: center;
}

.success-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: white;
  font-size: 30px;
  margin: 0 auto 22px;
}

.confirmation .eyebrow {
  margin-bottom: 10px;
}

.confirmation > p {
  color: var(--muted);
  line-height: 1.6;
}

.confirmation-details {
  max-width: 660px;
  margin: 28px auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.confirmation-details div {
  padding: 17px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.confirmation-details div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.confirmation-details div.wide {
  grid-column: 1 / -1;
  border-right: 0;
}

.confirmation-details span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.confirmation-details strong {
  font-size: 15px;
}

.privacy-note {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 22px 0 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .site-header {
    padding: 0 4vw;
  }

  .header-help {
    display: none;
  }

  .hero {
    align-items: start;
  }

  .hero-badge {
    display: none;
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .step {
    min-height: 72px;
    padding: 12px;
  }

  .step small {
    display: none;
  }

  #patientStep,
  #appointmentStep,
  .review-panel,
  .confirmation {
    padding: 28px 22px;
  }

  .message {
    margin: 16px 22px 0;
  }

  .form-grid,
  .filters,
  .lookup-grid {
    grid-template-columns: 1fr;
  }

  .full {
    grid-column: auto;
  }

  .verification-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .code-row {
    min-width: 0;
  }

  .time-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .site-header {
    height: 70px;
  }

  .page-shell {
    width: 100%;
    padding: 26px 12px 42px;
  }

  .hero {
    padding: 8px 8px 24px;
  }

  .hero h1 {
    font-size: 43px;
  }

  .hero p {
    font-size: 16px;
  }

  .booking-card {
    border-radius: 20px;
  }

  .steps {
    position: relative;
  }

  .step {
    min-height: 62px;
    justify-content: center;
    padding: 9px 5px;
    gap: 7px;
  }

  .step > span {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    font-size: 12px;
  }

  .step b {
    font-size: 11px;
  }

  #patientStep,
  #appointmentStep,
  .review-panel,
  .confirmation {
    padding: 24px 16px 28px;
  }

  .message {
    margin: 14px 16px 0;
  }

  .patient-toggle {
    display: grid;
    width: 100%;
  }

  .toggle {
    padding-left: 10px;
    padding-right: 10px;
    font-size: 13px;
  }

  .form-action {
    justify-content: stretch;
  }

  .existing-patient-actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
  }

  .existing-patient-actions .primary-btn {
    width: 100%;
  }

  .existing-patient-actions .forgot-number-btn {
    text-align: center;
    min-height: 44px;
  }

  .dob-field,
  .dob-field input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .dob-field input[type="date"] {
    box-sizing: border-box;
    font-size: 16px;
    padding-left: 12px;
    padding-right: 8px;
  }

  .lookup-panel {
    padding: 18px 14px;
  }

  .lookup-actions {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 8px;
  }

  .lookup-actions .dark-btn {
    width: 100%;
  }

  .lookup-actions .text-btn {
    text-align: center;
  }

  .form-action .primary-btn,
  .review-confirm {
    width: 100%;
  }

  .section-heading-row {
    flex-direction: column;
    gap: 8px;
  }

  .filters {
    margin-top: 24px;
    margin-bottom: 26px;
  }

  .date-scroll-wrap {
    grid-template-columns: 1fr;
  }

  .date-scroll-arrow {
    display: none;
  }

  .date-selector {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    scroll-padding-left: 16px;
  }

  .date-pill {
    flex-basis: 84px;
    min-height: 96px;
  }

  .selected-date-heading {
    margin-top: 20px;
    font-size: 18px;
  }

  .time-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .time-button {
    min-height: 76px;
    padding: 12px;
  }

  .time-main {
    font-size: 19px;
  }

  .time-office {
    font-size: 12px;
  }

  .time-doctor {
    font-size: 11px;
  }

  .review-content {
    margin-top: 18px;
  }

  .review-details,
  .confirmation-details {
    grid-template-columns: 1fr;
  }

  .review-details div,
  .review-details div:nth-child(odd),
  .confirmation-details div,
  .confirmation-details div:nth-child(odd) {
    border-right: 0;
  }

  .review-actions {
    justify-content: stretch;
  }

  .code-row {
    flex-direction: column;
  }
}

@media (max-width: 360px) {
  .time-slots {
    grid-template-columns: 1fr;
  }
}


@media (max-width: 720px) {
  .brand-logo {
    height: 43px;
    max-width: 68vw;
  }
}

@media (max-width: 420px) {
  .brand-logo {
    height: 38px;
    max-width: 72vw;
  }
}


/* Mobile header/logo override */
@media (max-width: 720px) {
  .site-header {
    height: 84px;
    padding: 0 16px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    justify-content: center;
  }

  .site-header .brand {
    width: 100%;
    justify-content: center;
  }

  .brand-logo {
    height: 54px;
    width: auto;
    max-width: min(380px, 90vw);
    object-fit: contain;
    margin: 0 auto;
  }

  .site-header .header-help {
    display: none;
  }
}

@media (max-width: 420px) {
  .site-header {
    height: 78px;
  }

  .brand-logo {
    height: 48px;
    max-width: 90vw;
  }
}
