@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap");

:root {
  --page-bg: #f6f3ec;
  --card-bg: #ffffff;
  --card-border: #e4dccd;
  --text-main: #111827;
  --text-soft: #4b5563;
  --text-faint: #6b7280;
  --accent: #1f6b92;
  --danger: #9f1d1d;
  --danger-soft: #fdecec;
  --success: #059669;
  --success-soft: #ecfdf5;
  --shadow: 0 18px 46px rgba(17, 24, 39, 0.08);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 20px 110px;
}

.page:has(.date-flow-card) {
  max-width: 1280px;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero p {
  max-width: 780px;
  margin: 0 auto;
  color: var(--text-soft);
  font-size: 1.12rem;
  line-height: 1.55;
}

.info-card,
.main-card,
.side-card,
.panel-card,
.confirm-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.info-card {
  max-width: 780px;
  margin: 0 auto 36px;
  padding: 24px;
}

.info-card h2 {
  margin: 0 0 18px;
  font-size: 1.85rem;
  line-height: 1.1;
}

.info-block + .info-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #ede6da;
}

.info-block h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.info-block p,
.info-block li {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.65;
}

.info-block ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.layout:has(.date-flow-card) {
  grid-template-columns: 300px minmax(0, 1fr);
}

.side-card {
  padding: 22px;
  min-height: 260px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 50px;
  height: 50px;
  color: #111827;
  flex: 0 0 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
  overflow: visible;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand-name {
  font-size: 1.42rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.side-card h2 {
  margin: 0 0 14px;
  font-size: 1.65rem;
  line-height: 1.12;
}

.side-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.main-card,
.panel-card {
  padding: 28px;
}

.panel-card > .back-btn,
.panel-card > .card-head,
.panel-card > .appointment-options,
.panel-card > .white-box,
.panel-card > .actions,
.panel-card > .status-box,
.panel-card > .weekday-row,
.panel-card > .calendar-grid {
  margin-left: 0;
  margin-right: 0;
}

.panel-card > .card-head {
  padding-left: 0;
  padding-right: 0;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.card-head > div:first-child {
  max-width: 680px;
}

.card-head h2,
.panel-card h3 {
  margin: 0;
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  line-height: 1.08;
}

.card-head p,
.panel-card p {
  margin: 8px 0 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.chip {
  white-space: nowrap;
  border-radius: 999px;
  background: #f4efe6;
  color: var(--text-soft);
  padding: 10px 14px;
  font-size: 0.9rem;
}

.back-btn {
  min-height: 44px;
  border: 1px solid #d8cbb9;
  border-radius: 999px;
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  font-weight: 800;
  padding: 0 16px;
  margin-bottom: 16px;
}

.lookup-grid,
.form-grid {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-weight: 800;
}

.field input {
  width: 100%;
  min-height: 54px;
  border: 1px solid #d8cbb9;
  border-radius: 12px;
  background: #fffdf9;
  padding: 12px 14px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.done-actions {
  justify-content: center;
  margin-top: 22px;
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-soft-danger {
  min-height: 50px;
  border-radius: 999px;
  padding: 0 20px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: #0f172a;
  color: #ffffff;
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-secondary {
  background: #ffffff;
  color: #0f172a;
  border-color: #d8cbb9;
}

.btn-danger {
  background: #9f1d1d;
  color: #ffffff;
}

.btn-soft-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #f3cdcd;
}

.status-box {
  display: none;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  line-height: 1.55;
}

.status-box.is-visible {
  display: block;
}

.status-info {
  background: #eff6fb;
  border: 1px solid #d7eaf5;
  color: #1f4d67;
}

.status-success {
  background: var(--success-soft);
  border: 1px solid #9ee7bf;
  color: #064e3b;
}

.status-error {
  background: var(--danger-soft);
  border: 1px solid #f3cdcd;
  color: var(--danger);
}

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

.detail-card,
.change-card {
  border: 1px solid #ede6da;
  border-radius: var(--radius-md);
  background: #fffdf9;
  padding: 15px;
}

.detail-card small,
.change-card small {
  display: block;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  margin-bottom: 5px;
}

.detail-card strong,
.change-card strong {
  display: block;
  line-height: 1.35;
}

.old-value {
  color: var(--text-faint);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.new-value {
  color: #064e3b;
}

.flow-panel {
  display: none;
  margin-top: 22px;
}

.flow-panel.is-visible {
  display: block;
}

.appointment-options,
.payment-options,
.slot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.option-card,
.slot-button {
  min-height: 88px;
  border: 1px solid #e3d7c7;
  border-radius: 15px;
  background: #fffdf9;
  padding: 14px;
  cursor: pointer;
  text-align: left;
}

.option-card.selected,
.slot-button.selected {
  border-color: #1f6b92;
  box-shadow: 0 0 0 2px rgba(31, 107, 146, 0.12);
}

.option-card strong,
.option-card small,
.slot-button strong,
.slot-button small {
  display: block;
}

.option-card small,
.slot-button small {
  margin-top: 5px;
  color: var(--text-soft);
  line-height: 1.45;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
}

.month-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  white-space: nowrap;
  margin-bottom: 16px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #d8cbb9;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  font-weight: 800;
  color: #334155;
}

.icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.booking-calendar-shell {
  border: 1px solid #e6e1d5;
  border-radius: 12px;
  background: #ffffff;
  padding: 16px;
}

.date-time-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
  transition: all 0.25s ease;
}

.date-time-layout.has-selected-date {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
}

.calendar-pane {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

.date-time-layout.has-selected-date .calendar-pane {
  margin: 0;
}

.times-pane {
  width: 100%;
  min-height: 360px;
  border: 1px solid #e6e1d5;
  border-radius: 12px;
  background: #ffffff;
  padding: 16px;
}

.times-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.times-head h3 {
  margin: 0;
  font-size: 1rem;
}

.times-head p {
  margin: 4px 0 0;
  color: var(--text-faint);
  font-size: 0.9rem;
}

.times-pane .slot-grid {
  grid-template-columns: 1fr;
  margin-top: 0;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(6px, 1vw, 10px);
}

.weekday-row {
  margin-top: 18px;
  color: var(--text-soft);
  font-size: 0.9rem;
  text-align: center;
}

.calendar-grid {
  margin-top: 10px;
  justify-items: center;
  align-items: center;
}

.day-button {
  width: min(100%, 64px);
  max-width: 64px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid #e6edf2;
  background: #ffffff;
  color: #c9c1b8;
  font-weight: 800;
}

.day-button.bookable {
  border-color: #c4d7e3;
  color: #0f172a;
  cursor: pointer;
}

.day-button.bookable:hover {
  border-color: #457b9d;
  box-shadow: 0 0 0 3px rgba(69, 123, 157, 0.18);
  transform: translateY(-1px);
}

.day-button.selected {
  border-color: #7fb7d6;
  background: radial-gradient(120% 120% at 50% 20%, #7fb7d6 0%, #457b9d 60%, #2e546a 100%);
  color: #ffffff;
  box-shadow: none;
}

.slot-button {
  text-align: center;
  min-height: auto;
  border-radius: 10px;
  padding: 12px;
}

.slot-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.timezone-note {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  color: var(--text-faint);
  font-size: 0.82rem;
}

.final-card,
.success-card {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid #9ee7bf;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ecfdf5 0%, #e7fbf1 100%);
  box-shadow: 0 22px 58px rgba(5, 150, 105, 0.18);
}

.success-card.centered-only {
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin-top: clamp(24px, 8vh, 72px);
}

.success-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--success);
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 18px;
}

.success-card h2,
.final-card h2 {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 4vw, 2.65rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.white-box {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: #ffffff;
}

.panel-card > .white-box {
  padding: 0;
  background: transparent;
}

.panel-card > .white-box h3,
.panel-card > .white-box p {
  margin-left: 0;
  margin-right: 0;
}

.panel-card > .white-box h3 {
  max-width: 560px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: 22px;
  background: rgba(15, 23, 42, 0.52);
}

.modal-backdrop.is-visible {
  display: flex;
}

.modal-card {
  width: min(560px, 100%);
  padding: 26px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.modal-card h3 {
  margin: 0 0 10px;
  font-size: 1.8rem;
}

.hidden {
  display: none !important;
}

.done-actions {
  margin-top: 24px;
  justify-content: center;
}

.done-actions .btn-primary,
.done-actions .btn-secondary {
  min-width: 190px;
}

@media (max-width: 900px) {
  .layout,
  .layout:has(.date-flow-card) {
    grid-template-columns: 1fr;
  }

  .side-card {
    min-height: auto;
  }

  .date-time-layout.has-selected-date {
    grid-template-columns: 1fr;
  }

  .date-time-layout.has-selected-date .calendar-pane {
    margin: 0 auto;
  }

  .times-pane {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .page {
    padding: 28px 12px 80px;
    max-width: 100%;
  }

  .page:has(.date-flow-card) {
    max-width: 100%;
  }

  .layout,
  .layout:has(.date-flow-card) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    width: 100%;
  }

  .main-card,
  .panel-card,
  .side-card,
  .info-card {
    padding: 18px;
  }

  .card-head,
  .calendar-head {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .card-head {
    align-items: stretch;
  }

  .month-controls {
    justify-content: space-between;
    width: 100%;
  }

  .booking-calendar-shell {
    padding: 12px;
    overflow: hidden;
  }

  .date-flow-card {
    width: 100%;
    min-width: 0;
  }

  .date-time-layout,
  .date-time-layout.has-selected-date {
    display: block;
    width: 100%;
  }

  .date-time-layout.has-selected-date .calendar-pane {
    display: none;
  }

  .calendar-pane,
  .times-pane {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .times-pane {
    padding: 18px;
  }

  .chip {
    display: inline-block;
    margin-top: 12px;
  }

  .current-grid,
  .change-grid,
  .appointment-options,
  .payment-options,
  .slot-grid {
    grid-template-columns: 1fr;
  }

  .weekday-row,
  .calendar-grid {
    gap: 6px;
  }

  .day-button {
    width: clamp(38px, 12vw, 56px);
    font-size: 0.88rem;
  }

  .slot-grid,
  .times-pane .slot-grid {
    grid-template-columns: 1fr;
  }

  .back-btn {
    width: fit-content;
  }
}
