/* =========================================================
   Aster Health — book a visit flow
   ========================================================= */

.book-body {
  background:
    radial-gradient(900px 480px at 50% -10%, rgba(11, 92, 255, 0.06), transparent 65%),
    #f7f8fa;
}

.book-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.book-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(100% - 48px, 1180px);
  height: 72px;
  margin-inline: auto;
  border-bottom: 1px solid var(--line);
}

.book-header-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted-2);
  font-size: 0.8125rem;
}

.book-header-meta strong {
  color: var(--ink-2);
  font-weight: 600;
}

.book-header-meta a {
  color: var(--muted);
  font-size: 0.8125rem;
}

.book-header-meta a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.book-progress {
  height: 4px;
  background: #e9ebef;
}

.book-progress span {
  display: block;
  width: 25%;
  height: 100%;
  background: var(--blue);
  transition: width 0.45s var(--ease);
}

.book-main {
  padding: 34px 24px 80px;
}

.book-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
  width: min(100%, 1120px);
  margin-inline: auto;
}

.book-form-col {
  min-width: 0;
}

/* stepper */

.book-stepper {
  display: flex;
  gap: 6px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.book-stepper li {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted-2);
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
}

.book-stepper li::before {
  display: grid;
  width: 18px;
  height: 18px;
  flex: none;
  place-items: center;
  border: 1px solid #cdd3db;
  border-radius: 50%;
  background: #fff;
  color: var(--muted-2);
  content: attr(data-step-number);
  font-size: 0.5625rem;
  font-weight: 600;
}

.book-stepper li.is-active {
  border-color: #dbe8ff;
  background: var(--blue-050);
  color: var(--blue);
  font-weight: 600;
}

.book-stepper li.is-active::before {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.book-stepper li.is-done {
  color: var(--green);
}

.book-stepper li.is-done::before {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
  content: "✓";
}

.book-stepper li span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* card */

.book-card {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 16px 50px rgba(16, 34, 64, 0.06);
}

.book-step {
  animation: book-step-in 0.38s var(--ease) both;
}

@keyframes book-step-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.book-step h1,
.book-step h2 {
  margin-top: 10px;
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  letter-spacing: -0.04em;
}

.book-step h1:focus,
.book-step h2:focus {
  outline: none;
}

.book-lede {
  max-width: 560px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.book-subhead {
  margin: 28px 0 12px;
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* choice cards */

.book-concern-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}

.book-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.book-choice:hover {
  border-color: #b9c1cc;
}

.book-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.book-choice > .icon {
  width: 21px;
  height: 21px;
  flex: none;
  color: var(--muted-2);
}

.book-choice strong {
  display: block;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
}

.book-choice small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 0.6875rem;
  line-height: 1.35;
}

.book-choice .choice-check {
  display: grid;
  width: 18px;
  height: 18px;
  margin-left: auto;
  flex: none;
  place-items: center;
  border: 1px solid #c9ced6;
  border-radius: 50%;
  background: #fff;
  color: #fff;
}

.book-choice .choice-check .icon {
  width: 10px;
  height: 10px;
  opacity: 0;
}

.book-choice:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-050);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.book-choice:has(input:checked) > .icon {
  color: var(--blue);
}

.book-choice:has(input:checked) .choice-check {
  border-color: var(--blue);
  background: var(--blue);
}

.book-choice:has(input:checked) .choice-check .icon {
  opacity: 1;
}

.book-choice:has(input:focus-visible) {
  outline: 3px solid rgba(11, 92, 255, 0.35);
  outline-offset: 2px;
}

/* visit types */

.book-visit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.book-visit {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.book-visit:hover {
  border-color: #b9c1cc;
}

.book-visit input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.book-visit .icon {
  width: 24px;
  height: 24px;
  color: var(--muted-2);
}

.book-visit strong {
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
}

.book-visit small {
  color: var(--muted-2);
  font-size: 0.6875rem;
  line-height: 1.45;
}

.book-visit .visit-time {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 0.625rem;
  font-weight: 500;
}

.book-visit:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-050);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.book-visit:has(input:checked) .icon {
  color: var(--blue);
}

.book-visit:has(input:focus-visible) {
  outline: 3px solid rgba(11, 92, 255, 0.35);
  outline-offset: 2px;
}

/* dates & times */

.book-dates {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
}

.book-date {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 12px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.book-date:hover {
  border-color: #b9c1cc;
}

.book-date input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.book-date small {
  color: var(--muted-2);
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
}

.book-date strong {
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.book-date span {
  color: var(--muted-2);
  font-size: 0.625rem;
}

.book-date:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-050);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.book-date:has(input:checked) strong {
  color: var(--blue);
}

.book-date:has(input:focus-visible) {
  outline: 3px solid rgba(11, 92, 255, 0.35);
  outline-offset: 2px;
}

.book-times {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.book-time {
  position: relative;
  display: block;
  padding: 11px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.book-time:hover {
  border-color: #b9c1cc;
}

.book-time input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.book-time:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.book-time:has(input:focus-visible) {
  outline: 3px solid rgba(11, 92, 255, 0.35);
  outline-offset: 2px;
}

.book-tz {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted-2);
  font-size: 0.6875rem;
}

.book-tz .icon {
  width: 13px;
  height: 13px;
}

/* details form */

.book-fields {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.book-fields .form-row {
  gap: 12px;
}

.book-details-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid #dbe8ff;
  border-radius: 9px;
  background: #f6faff;
  color: #43536a;
  font-size: 0.75rem;
  line-height: 1.5;
}

.book-details-note .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--blue);
}

/* errors */

.book-error {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  color: var(--red);
  font-size: 0.75rem;
  line-height: 1.4;
}

.book-error[hidden] {
  display: none;
}

/* actions */

.book-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.book-actions .btn-primary {
  margin-left: auto;
}

.book-actions .btn-ghost {
  padding-left: 8px;
}

/* summary */

.book-summary {
  position: sticky;
  top: 98px;
}

.book-summary-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(16, 34, 64, 0.05);
}

.book-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.book-summary-head .tag {
  padding: 3px 8px;
  font-size: 0.5625rem;
}

.book-summary-card h2 {
  margin-top: 14px;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.book-summary-list {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
}

.book-summary-list > div {
  display: grid;
  gap: 3px;
}

.book-summary-list dt {
  color: var(--muted-2);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.book-summary-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
}

.book-summary-list dd.is-empty {
  color: var(--muted-2);
  font-weight: 400;
}

.book-summary-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.book-summary-price span {
  color: var(--muted-2);
  font-size: 0.6875rem;
}

.book-summary-price strong {
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.book-summary-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 14px;
  color: var(--muted-2);
  font-size: 0.6875rem;
  line-height: 1.5;
}

.book-summary-note .icon {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  color: var(--green);
}

.book-help {
  margin-top: 14px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted-2);
  font-size: 0.6875rem;
  line-height: 1.55;
}

.book-help a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* confirmation */

.book-confirm {
  width: min(100%, 680px);
  margin: 12px auto 0;
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(16, 34, 64, 0.08);
  text-align: center;
  animation: book-step-in 0.45s var(--ease) both;
}

.book-confirm .success-mark {
  margin-inline: auto;
}

.book-confirm h1,
.book-confirm h2 {
  margin-top: 16px;
  font-size: clamp(2rem, 4vw, 2.7rem);
}

.book-confirm > p {
  max-width: 500px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.book-confirm-card {
  margin-top: 26px;
  padding: 6px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfd;
  text-align: left;
}

.book-confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.book-confirm-row:first-child {
  border-top: 0;
}

.book-confirm-row span {
  color: var(--muted-2);
  font-size: 0.75rem;
}

.book-confirm-row strong {
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: right;
}

.book-confirm .success-actions {
  margin-top: 26px;
}

.book-confirm .success-note {
  margin-top: 20px;
}

.book-hidden {
  display: none !important;
}

/* responsive */

@media (max-width: 980px) {
  .book-shell {
    grid-template-columns: 1fr;
  }

  .book-summary {
    position: static;
  }

  .book-summary-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
  }

  .book-summary-head,
  .book-summary-card h2 {
    grid-column: 1 / -1;
  }

  .book-summary-list {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .book-summary-price,
  .book-summary-note {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .book-header-inner {
    width: calc(100% - 24px);
    height: 64px;
  }

  .book-header-meta {
    gap: 10px;
    font-size: 0.75rem;
  }

  .book-header-meta a {
    display: none;
  }

  .book-main {
    padding: 20px 16px 56px;
  }

  .book-stepper {
    gap: 4px;
    margin-bottom: 12px;
  }

  .book-stepper li {
    justify-content: center;
    padding: 6px;
  }

  .book-stepper li span {
    display: none;
  }

  .book-stepper li.is-active span {
    display: inline;
  }

  .book-card {
    padding: 24px 20px;
    border-radius: 18px;
  }

  .book-concern-grid {
    grid-template-columns: 1fr;
  }

  .book-visit-grid {
    grid-template-columns: 1fr;
  }

  .book-visit {
    grid-template-columns: 24px 1fr;
    align-items: center;
    gap: 3px 12px;
  }

  .book-visit .icon {
    grid-row: span 3;
  }

  .book-visit .visit-time {
    margin-top: 4px;
    padding-top: 0;
    border-top: 0;
  }

  .book-dates {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .book-times {
    grid-template-columns: 1fr 1fr;
  }

  .book-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .book-actions .btn {
    width: 100%;
  }

  .book-actions .btn-ghost {
    padding-left: 16px;
  }

  .book-confirm {
    padding: 32px 20px;
  }

  .book-confirm-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .book-confirm-row strong {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .book-summary-card {
    display: block;
  }

  .book-summary-list {
    grid-template-columns: 1fr;
  }

  .book-dates {
    grid-template-columns: 1fr 1fr;
  }

  .book-times {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .book-step,
  .book-confirm {
    animation: none;
  }

  .book-progress span {
    transition: none;
  }
}
