:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #24364b;
  --muted: #5e6f82;
  --line: #d6deea;
  --teal: #147f78;
  --teal-soft: #e4f4f1;
  --blue-soft: #eef4ff;
  --danger: #b42318;
  --danger-soft: #fff0ed;
  --shadow: 0 12px 34px rgba(28, 43, 62, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", Arial, sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

.booking-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 42px auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.advisor-panel,
.booking-panel {
  background: var(--panel);
}

.advisor-panel {
  display: flex;
  justify-content: center;
  gap: 18px;
  align-items: center;
  padding: 20px 26px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.booking-panel {
  min-width: 0;
  padding: 26px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.advisor-media {
  flex: 0 0 auto;
  width: 88px;
  height: 88px;
  margin: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--blue-soft);
  border: 1px solid var(--line);
}

.advisor-media img,
.advisor-image-placeholder {
  width: 100%;
  height: 100%;
}

.advisor-media img {
  display: block;
  object-fit: cover;
  object-position: center;
}

.advisor-image-placeholder {
  display: grid;
  place-items: center;
  color: var(--teal);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.advisor-copy {
  flex: 0 1 auto;
  min-width: 0;
  width: fit-content;
  max-width: 520px;
}

.advisor-copy .eyebrow {
  margin-bottom: 6px;
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  font-size: clamp(30px, 3vw, 38px);
}

h2 {
  font-size: 26px;
}

.advisor-headline {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.45;
}

.advisor-bio {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.58;
}

.advisor-meta {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 4px;
  margin-top: 10px;
  color: var(--muted);
}

#advisor-price {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  padding-left: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
}

.status-pill.available {
  background: var(--teal-soft);
  border-color: #b8e2dd;
  color: var(--teal);
}

.status-pill.offline,
.status-pill.busy {
  background: var(--danger-soft);
  border-color: #fecdca;
  color: var(--danger);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

label span {
  color: var(--muted);
  font-size: 13px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
}

input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  color: var(--danger);
  font-size: 13px;
  line-height: 1.4;
}

textarea {
  resize: vertical;
}

.flash {
  margin-bottom: 18px;
  border-radius: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.flash.error {
  background: var(--danger-soft);
  border-color: #fecdca;
  color: var(--danger);
}

.flash.success {
  background: var(--teal-soft);
  border-color: #b8e2dd;
  color: var(--teal);
}

.slot-area {
  min-width: 0;
  min-height: 360px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.muted {
  color: var(--muted);
}

.slot-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.slot-button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--teal);
  cursor: pointer;
}

.slot-button:hover,
.slot-button.is-selected {
  border-color: #8bd2c8;
  background: var(--teal-soft);
  color: var(--ink);
}

.booking-schedule {
  display: grid;
  grid-template-columns: minmax(340px, 1.15fr) minmax(250px, 0.85fr);
  gap: 18px;
  margin-bottom: 24px;
}

.booking-schedule[hidden] {
  display: none;
}

.calendar-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, #f6fbfa, #ffffff);
}

.calendar-header,
.slot-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calendar-header strong,
.slot-heading strong {
  font-size: 16px;
}

.slot-heading {
  align-items: flex-start;
  flex-direction: column;
}

.slot-heading span {
  color: var(--muted);
  font-size: 13px;
}

.calendar-nav {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--teal);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.calendar-nav:hover:not(:disabled) {
  border-color: #8bd2c8;
  background: var(--teal-soft);
}

.calendar-nav:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 42px);
  justify-content: center;
  column-gap: 8px;
  row-gap: 6px;
}

.calendar-weekdays {
  margin: 20px 0 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.calendar-day {
  display: grid;
  place-items: center;
  justify-self: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #a1aaba;
  line-height: 1;
  text-align: center;
}

button.calendar-day {
  cursor: pointer;
}

.calendar-day.is-available {
  border-color: #b8e2dd;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 700;
}

.calendar-day.is-available:hover,
.calendar-day.is-selected {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.calendar-day.is-outside {
  visibility: hidden;
}

.calendar-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.calendar-legend span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--teal-soft);
  border: 1px solid #b8e2dd;
}

.booking-form {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.booking-form[hidden] {
  display: none;
}

.booking-continue {
  margin-top: 18px;
}

.selected-slot {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  margin-bottom: 18px;
}

.selected-slot span {
  color: var(--muted);
}

.selected-slot-copy {
  display: grid;
  gap: 4px;
}

.booking-change {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: #fff;
  color: var(--teal);
  cursor: pointer;
  font-weight: 700;
}

.booking-confirmation-status {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid #b8e2dd;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.5;
}

.booking-confirmation-status[hidden] {
  display: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 8px;
}

.form-grid label:last-child {
  grid-column: 1 / -1;
}

.button-primary {
  width: 100%;
  margin-top: 18px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.button-primary:disabled {
  cursor: not-allowed;
  background: #a7b3c2;
}

.booking-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.booking-success {
  min-height: 440px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.booking-success[hidden] {
  display: none;
}

.booking-success-details {
  margin: 20px 0 8px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
}

.button-secondary {
  min-height: 48px;
  margin-top: 18px;
  padding: 0 20px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: #fff;
  color: var(--teal);
  cursor: pointer;
  font-weight: 700;
}

.modal-layer {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 29, 46, 0.6);
}

.modal-layer[hidden] {
  display: none;
}

.topup-modal {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 30px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 29, 46, 0.3);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
}

.topup-balance {
  margin: 18px 0 8px;
  color: var(--ink);
  font-weight: 700;
}

.topup-amount-field {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.topup-terms-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 18px;
}

.topup-terms-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.topup-terms-check a {
  color: var(--teal);
}

.topup-terms-check a[aria-disabled="true"] {
  color: var(--muted);
  text-decoration: none;
}

.topup-status {
  min-height: 22px;
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.45;
}

.topup-status.error {
  color: var(--danger);
}

.topup-status.success {
  color: var(--teal);
  font-weight: 700;
}

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

.topup-actions .button-primary {
  margin-top: 14px;
}

@media (max-width: 1020px) {
  .booking-shell {
    margin: 18px auto;
  }
}

@media (max-width: 760px) {
  .booking-schedule {
    grid-template-columns: 1fr;
  }

  .slot-area {
    min-height: 0;
  }

  .panel-header,
  .selected-slot {
    align-items: stretch;
    flex-direction: column;
  }

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

  .topup-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .booking-shell {
    width: calc(100% - 16px);
    margin: 8px auto;
  }

  .advisor-panel,
  .booking-panel {
    padding: 16px;
  }

  .calendar-card,
  .slot-area {
    padding: 12px;
  }

  .calendar-weekdays,
  .calendar-grid {
    grid-template-columns: repeat(7, 38px);
    gap: 3px;
  }

  .calendar-day {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
  }

  .advisor-media {
    width: 72px;
    height: 72px;
  }

  .topup-modal {
    padding: 24px 18px 18px;
  }
}

@media (max-width: 360px) {
  .advisor-panel {
    gap: 14px;
  }

  .calendar-weekdays,
  .calendar-grid {
    grid-template-columns: repeat(7, 32px);
  }

  .calendar-day {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
  }
}
