:root {
  --pf-canvas: #f3f7f6;
  --pf-surface: #ffffff;
  --pf-ink: #18312f;
  --pf-muted: #60716e;
  --pf-border: #d5e1de;
  --pf-primary: #0f6b64;
  --pf-primary-hover: #0a554f;
  --pf-sage: #e1eee8;
  --pf-lavender: #eeeaf6;
  --pf-blue: #e3eff5;
  --pf-success: #2c7457;
  --pf-warning: #806018;
  --pf-danger: #a23d48;
  --pf-info: #336f87;
  --pf-shadow: 0 8px 24px rgba(24, 49, 47, 0.07);
  --pf-radius: 8px;
}

* {
  letter-spacing: 0;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  background: var(--pf-canvas);
  color: var(--pf-ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.55;
}

a {
  color: var(--pf-primary);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--pf-primary-hover);
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1100;
  transform: translateY(-160%);
  border-radius: 4px;
  background: var(--pf-ink);
  color: #fff;
  padding: 0.65rem 0.85rem;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-navbar {
  min-height: 68px;
  border-bottom: 1px solid var(--pf-border);
  background: rgba(255, 255, 255, 0.98);
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--pf-ink);
  font-size: 1.05rem;
  font-weight: 700;
}

.navbar-brand:hover {
  color: var(--pf-primary);
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  background: var(--pf-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}

.navbar-toggler {
  border-color: var(--pf-border);
  min-height: 44px;
}

.nav-link {
  color: var(--pf-ink);
  font-weight: 600;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--pf-primary);
}

.app-main {
  padding-top: 2rem;
  max-width: 100%;
  overflow-x: clip;
  padding-bottom: 3rem;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-eyebrow {
  margin-bottom: 0.35rem;
  color: var(--pf-primary);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--pf-ink);
  font-weight: 700;
}

.text-muted {
  color: var(--pf-muted) !important;
}

.surface-panel,
.card,
.list-group-item,
.table-shell {
  border-color: var(--pf-border) !important;
  background: var(--pf-surface);
}

.surface-panel {
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  box-shadow: var(--pf-shadow);
  padding: clamp(1.1rem, 2vw, 1.75rem);
}

.surface-panel--flat {
  box-shadow: none;
}

.card,
.list-group,
.list-group-item,
.alert,
.btn,
.form-control,
.form-select,
.form-check-input {
  border-radius: var(--pf-radius);
}

.list-group {
  gap: 0.65rem;
}

.list-group-item {
  border: 1px solid var(--pf-border);
}

.list-group-item + .list-group-item {
  border-top-width: 1px;
}

.list-group-item-action:hover,
.list-group-item-action:focus {
  border-color: #a9c6c0;
  background: #f9fcfb;
  color: var(--pf-ink);
}

.btn {
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  font-weight: 700;
}

.btn-sm {
  min-height: 36px;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}

.btn-primary {
  border-color: var(--pf-primary);
  background: var(--pf-primary);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  border-color: var(--pf-primary-hover) !important;
  background: var(--pf-primary-hover) !important;
}

.btn-outline-primary {
  border-color: var(--pf-primary);
  color: var(--pf-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  border-color: var(--pf-primary);
  background: var(--pf-primary);
  color: #fff;
}

.btn-outline-secondary {
  border-color: #9baba8;
  color: #425754;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  border-color: #425754;
  background: #425754;
  color: #fff;
}

.btn-success {
  border-color: var(--pf-success);
  background: var(--pf-success);
}

.btn-outline-danger {
  border-color: var(--pf-danger);
  color: var(--pf-danger);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
  border-color: var(--pf-danger);
  background: var(--pf-danger);
  color: #fff;
}

.form-control,
.form-select {
  min-height: 44px;
  border-color: #afbfbc;
  color: var(--pf-ink);
}

textarea.form-control {
  min-height: 96px;
}

.form-check-input {
  width: 1.2rem;
  height: 1.2rem;
  border-color: #829895;
}

.form-check-input:checked {
  border-color: var(--pf-primary);
  background-color: var(--pf-primary);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn:focus-visible,
a:focus-visible,
button:focus-visible {
  border-color: var(--pf-primary);
  box-shadow: 0 0 0 0.22rem rgba(15, 107, 100, 0.2);
  outline: 2px solid transparent;
}

.form-label {
  margin-bottom: 0.35rem;
  color: #2f4845;
  font-weight: 700;
}

.form-text,
.helptext {
  color: var(--pf-muted);
  font-size: 0.85rem;
}

form p {
  margin-bottom: 1rem;
}

form p > label {
  display: block;
  margin-bottom: 0.35rem;
  color: #2f4845;
  font-weight: 700;
}

form .mb-3 > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
form p > input:not([type="checkbox"]):not([type="radio"]),
form p > select,
form p > textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  border: 1px solid #afbfbc;
  border-radius: var(--pf-radius);
  background: #fff;
  padding: 0.55rem 0.75rem;
}

.errorlist {
  margin: 0 0 0.35rem;
  padding: 0;
  color: var(--pf-danger);
  font-size: 0.875rem;
  list-style: none;
}

.alert {
  border-width: 1px;
}

.alert-success {
  border-color: #b8d7c8;
  background: #edf7f1;
  color: #20563f;
}

.alert-warning {
  border-color: #ddc98c;
  background: #fff9e8;
  color: #684d0f;
}

.alert-danger {
  border-color: #dfbbc0;
  background: #fff1f2;
  color: #7a2c35;
}

.alert-info,
.alert-light {
  border-color: #bdd4df !important;
  background: #f0f7fa;
  color: #28586d;
}

.badge {
  border-radius: 999px;
  padding: 0.42em 0.68em;
  font-weight: 700;
}

.text-bg-primary {
  background: var(--pf-primary) !important;
}

.text-bg-success {
  background: var(--pf-success) !important;
}

.text-bg-warning {
  background: #f2df9f !important;
  color: #55400e !important;
}

.text-bg-secondary {
  background: #536966 !important;
}

.text-bg-light {
  background: #f5f8f7 !important;
  color: #334b48 !important;
}

.booking-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.booking-progress__step {
  position: relative;
  color: var(--pf-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.booking-progress__step::before {
  position: relative;
  z-index: 1;
  display: grid;
  width: 30px;
  height: 30px;
  margin: 0 auto 0.35rem;
  place-items: center;
  border: 2px solid var(--pf-border);
  border-radius: 50%;
  background: var(--pf-surface);
  content: attr(data-step);
}

.booking-progress__step::after {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--pf-border);
  content: "";
}

.booking-progress__step:last-child::after {
  display: none;
}

.booking-progress__step.is-complete::before {
  border-color: var(--pf-success);
  background: var(--pf-success);
  color: #fff;
  content: "\2713";
}

.booking-progress__step.is-active {
  color: var(--pf-ink);
}

.booking-progress__step.is-active::before {
  border-color: var(--pf-primary);
  background: var(--pf-primary);
  color: #fff;
}

.hold-timer {
  min-width: 144px;
  border: 1px solid #c7d7d3;
  border-radius: var(--pf-radius);
  background: var(--pf-sage);
  padding: 0.75rem 1rem;
  text-align: center;
}

.hold-timer__value {
  color: var(--pf-primary-hover);
  font-variant-numeric: tabular-nums;
}

.hold-timer.is-expired {
  border-color: #dfbbc0;
  background: #fff1f2;
}

.hold-timer.is-expired .hold-timer__value {
  color: var(--pf-danger);
}

.slot-list {
  display: grid;
  gap: 0.85rem;
}

.slot-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  background: var(--pf-surface);
  box-shadow: 0 3px 12px rgba(24, 49, 47, 0.04);
  padding: 1.15rem;
}

.slot-card__date {
  margin-bottom: 0.2rem;
  font-size: 1.05rem;
}

.slot-card__meta {
  color: var(--pf-muted);
}

.slot-card__price {
  margin-top: 0.5rem;
  color: #304a47;
  font-weight: 700;
}

.empty-state {
  border: 1px dashed #afc3bf;
  border-radius: var(--pf-radius);
  background: rgba(255, 255, 255, 0.58);
  padding: 1.5rem;
  color: var(--pf-muted);
  text-align: center;
}

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

.therapist-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  background: var(--pf-surface);
  box-shadow: var(--pf-shadow);
  padding: 1.35rem;
}

.therapist-card__body {
  min-width: 0;
}

.therapist-card__title,
.diary-header__title {
  margin-bottom: 0.75rem;
  color: var(--pf-primary-hover);
  font-weight: 700;
}

.diary-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--pf-border);
  padding-bottom: 1.5rem;
}

.diary-header__biography {
  max-width: 70ch;
}

.diary-header__biography p:last-child {
  margin-bottom: 0.75rem;
}

.diary-group {
  margin-bottom: 2rem;
}

.diary-group__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.share-panel {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  align-items: center;
  gap: 2rem;
}

.share-panel__qr img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--pf-border);
}

.share-panel__details {
  min-width: 0;
}

.print-qr-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 2rem;
  background: #fff;
  text-align: center;
}

.print-qr-page main {
  max-width: 680px;
}

.print-qr-page img {
  display: block;
  width: min(360px, 100%);
  height: auto;
  margin: 1.5rem auto;
}

.print-qr-page__title {
  color: var(--pf-muted);
}

.print-qr-page__url {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}

.metric-card {
  height: 100%;
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
  background: var(--pf-surface);
  padding: 1rem;
}

.metric-card__value {
  color: var(--pf-primary-hover);
  font-size: 1.85rem;
  font-weight: 750;
  line-height: 1.2;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.section-heading h2 {
  margin: 0;
}

.table-shell {
  overflow: hidden;
  max-width: 100%;
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius);
}

.table {
  color: var(--pf-ink);
}

.table > :not(caption) > * > * {
  border-bottom-color: #e5ecea;
  padding: 0.8rem 0.9rem;
}

.table thead th {
  background: #edf3f1;
  color: #415653;
  font-size: 0.78rem;
  text-transform: uppercase;
  vertical-align: middle;
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline__item {
  position: relative;
  margin-left: 0.45rem;
  border-left: 2px solid #c9d9d6;
  padding: 0 0 1.2rem 1.2rem;
}

.timeline__item::before {
  position: absolute;
  top: 0.28rem;
  left: -0.42rem;
  width: 0.72rem;
  height: 0.72rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--pf-primary);
  box-shadow: 0 0 0 1px var(--pf-primary);
  content: "";
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.definition-list dt {
  color: var(--pf-muted);
  font-size: 0.84rem;
}

.app-footer {
  border-top: 1px solid var(--pf-border);
  color: var(--pf-muted);
  font-size: 0.84rem;
}

@media (max-width: 767.98px) {
  .app-main {
    padding-top: 1.25rem;
  }

  .therapist-grid,
  .share-panel {
    grid-template-columns: 1fr;
  }

  .share-panel__qr {
    width: min(280px, 100%);
    margin: 0 auto;
  }

  .navbar-collapse {
    border-top: 1px solid var(--pf-border);
    margin-top: 0.75rem;
    padding: 0.75rem 0 0.35rem;
  }

  .navbar-nav .btn,
  .navbar-nav form,
  .navbar-nav form .btn {
    width: 100%;
  }

  .slot-card {
    grid-template-columns: 1fr;
  }

  .slot-card form,
  .slot-card .btn {
    width: 100%;
  }

  .booking-progress__step {
    font-size: 0.68rem;
  }

  .booking-progress__step::before {
    width: 28px;
    height: 28px;
  }

  .booking-progress__step::after {
    top: 13px;
  }

  .table-shell {
    display: block;
    width: 100%;
    overflow-x: auto;
    contain: inline-size;
  }

  .table {
    min-width: 650px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .print-qr-page {
    min-height: auto;
    padding: 0;
  }

  .print-qr-page__button {
    display: none;
  }
}
