* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Keyboard focus: a clear, branded ring on any control reached via the keyboard
   (mouse clicks don't trigger :focus-visible, so the UI stays clean for them). */
:focus-visible {
  outline: 3px solid #2d6a4f;
  outline-offset: 2px;
  border-radius: 2px;
}

body {
  font-family: system-ui, sans-serif;
  font-size: 14px;
  color: #222;
}

/* Two-panel layout */
#app {
  display: flex;
  height: 100vh;
}

#sidebar {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #e0e0e0;
  overflow-y: auto;
  padding: 16px;
  gap: 12px;
}

#map {
  flex: 1;        /* fills all remaining horizontal space */
  height: 100vh;  /* Leaflet requires an explicit height */
}

/* Sidebar header */
#sidebar h1 {
  font-size: 22px;
  color: #2d6a4f;
}

#subtitle {
  color: #666;
  font-size: 13px;
}

/* "For therapists" link into the dashboard/login */
#therapist-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #2d6a4f;
  text-decoration: none;
}

#therapist-link:hover {
  color: #245741;
  text-decoration: underline;
}

/* Filters */
#filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#filters select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fafafa;
  font-size: 13px;
}

/* Deal cards */
#deals-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#loading-msg {
  color: #999;
  font-style: italic;
}

/* Loading / busy states (shared) */
button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: zenoa-spin 0.6s linear infinite;
}

@keyframes zenoa-spin {
  to { transform: rotate(360deg); }
}

/* Loading placeholder inside lists (slots, requests, deals) */
.loading-row {
  color: #999;
  font-style: italic;
  padding: 4px 0;
}

/* Toast notifications (transient feedback) */
#zenoa-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 16px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  max-width: 90vw;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-error { background: #c0392b; }
.toast-ok    { background: #2d6a4f; }

.deal-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.deal-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.deal-card .therapist-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.deal-card .slot-info {
  color: #555;
  font-size: 13px;
}

.deal-card .discount-badge {
  display: inline-block;
  margin-top: 6px;
  background: #2d6a4f;
  color: #fff;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

.deal-card .distance-badge {
  display: inline-block;
  margin: 6px 0 0 6px;
  background: #eaf3ef;
  color: #1b4332;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

/* "Use my location" toggle */
#near-me-btn {
  width: 100%;
  padding: 8px;
  border: 1px solid #2d6a4f;
  border-radius: 6px;
  background: #fff;
  color: #2d6a4f;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

#near-me-btn:hover { background: #eaf3ef; }

#near-me-btn.active {
  background: #2d6a4f;
  color: #fff;
}

/* ── Dashboard ── */

.dashboard-page {
  background: #f5f5f5;
}

/* Auth panel */
#auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

#auth-box {
  background: #fff;
  border-radius: 10px;
  padding: 32px;
  width: 340px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

#auth-box h1 {
  color: #2d6a4f;
  margin-bottom: 16px;
}

#auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fafafa;
  cursor: pointer;
  font-size: 14px;
}

.tab-btn.active {
  background: #2d6a4f;
  color: #fff;
  border-color: #2d6a4f;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-form input {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.auth-form button[type="submit"] {
  margin-top: 8px;
  padding: 10px;
  background: #2d6a4f;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

/* Text-style button (e.g. "Forgot password?") */
.link-btn {
  margin-top: 8px;
  background: none;
  border: none;
  color: #2d6a4f;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  align-self: flex-start;
  padding: 0;
}

.link-btn:hover {
  color: #245741;
}

.auth-error {
  color: #c0392b;
  font-size: 12px;
  min-height: 16px;
}

/* Dashboard layout */
#dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #2d6a4f;
  color: #fff;
  padding: 12px 24px;
}

#dash-header h1 {
  font-size: 18px;
}

#dash-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

#logout-btn {
  padding: 6px 12px;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 6px;
  cursor: pointer;
}

#dash-body {
  display: flex;
  gap: 24px;
  padding: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

#dash-left  { flex: 1; display: flex; flex-direction: column; gap: 24px; }
#dash-right { flex: 1; }

.dash-section {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-section h2 {
  font-size: 16px;
  color: #2d6a4f;
}

.section-hint {
  color: #999;
  font-size: 13px;
}

/* GDPR consent checkbox (booking + register forms) */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 8px;
  font-size: 12px;
  color: #555;
  line-height: 1.4;
  font-weight: 400;
}

.consent input[type="checkbox"] {
  width: auto;
  margin: 2px 0 0;
  flex-shrink: 0;
}

.consent a { color: #2d6a4f; }

.site-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  font-size: 12px;
}

.site-footer a {
  color: #888;
  text-decoration: none;
}

.site-footer a:hover { color: #2d6a4f; }

/* Legal / privacy page */
.legal-page h2 {
  font-size: 17px;
  color: #1b4332;
  margin: 22px 0 6px;
}

.legal-page h3 {
  font-size: 14px;
  color: #2d6a4f;
  margin: 14px 0 4px;
}

.legal-page p,
.legal-page li { color: #444; line-height: 1.55; }

.legal-page ul { margin: 4px 0 4px 18px; }
.legal-page a { color: #2d6a4f; }

#location-map {
  height: 220px;
  border-radius: 8px;
  overflow: hidden;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-row label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
}

.form-row input,
.form-row select {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

#slot-form button[type="submit"],
#recur-form button[type="submit"],
#dash-deposit-save {
  margin-top: 8px;
  padding: 10px;
  background: #2d6a4f;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

/* Recurring availability */
.weekday-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weekday-pick label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
}

.weekday-pick input { width: auto; }

#recur-list { margin-top: 12px; }

.recur-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

.recur-item-info { font-size: 13px; color: #333; }

.recur-del {
  background: none;
  border: 1px solid #c0392b;
  color: #c0392b;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.recur-del:hover { background: #c0392b; color: #fff; }

/* Slot cards */
.slot-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.slot-card.filled {
  opacity: 0.5;
}

.slot-card-info {
  font-size: 13px;
  line-height: 1.6;
}

.slot-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-filled, .btn-delete {
  padding: 4px 10px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-size: 12px;
}

.btn-filled { background: #e8f5e9; color: #2d6a4f; }
.btn-delete { background: #fdecea; color: #c0392b; }

.hidden { display: none !important; }

/* Leaflet popup tweaks */
.leaflet-popup-content {
  font-size: 13px;
  line-height: 1.5;
  min-width: 160px;
}

.popup-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.popup-phone {
  display: inline-block;
  font-size: 12px;
  color: #555;
  text-decoration: none;
  margin-bottom: 6px;
}

.popup-profile {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #2d6a4f;
  text-decoration: none;
}

.popup-profile:hover { text-decoration: underline; }

#public-page-link {
  color: #2d6a4f;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

#public-page-link:hover { text-decoration: underline; }

/* ── Practitioner profile page (/therapist) ── */
#profile {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 20px;
}

#profile-head h1 {
  font-size: 24px;
  color: #1b4332;
  margin: 12px 0 2px;
}

#profile-specialties {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.spec-tag {
  background: #eaf3ef;
  color: #1b4332;
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}

#profile-bio {
  margin: 16px 0;
  color: #444;
  line-height: 1.55;
}

#profile-map {
  height: 220px;
  border-radius: 10px;
  overflow: hidden;
  margin: 16px 0;
}

#profile-slots { margin-top: 8px; }

#profile-slots h2 {
  font-size: 16px;
  color: #2d6a4f;
  margin-bottom: 10px;
}

.profile-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.profile-slot-info {
  font-size: 13px;
  color: #333;
}

.slot-off { color: #2d6a4f; font-weight: 600; }

#profile-contact {
  margin: 18px 0;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Reviews & ratings ── */
#profile-reviews { margin-top: 20px; }
#profile-reviews h2 { font-size: 16px; color: #2d6a4f; margin-bottom: 8px; }

.review-stars { color: #e0a500; letter-spacing: 1px; }

#reviews-summary {
  margin-bottom: 12px;
  font-size: 15px;
  color: #333;
}

.review-item {
  border-top: 1px solid #eee;
  padding: 10px 0;
}

.review-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-name { font-weight: 600; font-size: 13px; color: #444; }

.review-comment {
  margin-top: 4px;
  color: #444;
  font-size: 13px;
  line-height: 1.5;
}

/* Review box on the status page (form + submitted review) */
.review-box {
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 20px;
}

.review-title { font-weight: 700; color: #1b4332; margin-bottom: 8px; }

.star-pick { display: flex; gap: 4px; margin-bottom: 10px; }

.star-btn {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #e0a500;
  cursor: pointer;
  padding: 0 2px;
}

.review-box textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  margin-bottom: 10px;
}

.review-box button#review-submit {
  background: #2d6a4f;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 14px;
  font-weight: 600;
  cursor: pointer;
}

.review-box button#review-submit:hover { background: #245741; }

.popup-slot {
  border-top: 1px solid #eee;
  padding-top: 6px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.popup-slot-info {
  flex: 1;
}

.book-btn {
  display: inline-block;
  background: #2d6a4f;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.book-btn:hover {
  background: #245741;
}

/* Booking modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.modal-box h3 {
  margin: 0 0 4px;
  color: #1b4332;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #999;
}

.modal-box label {
  display: block;
  margin: 10px 0 4px;
  font-size: 13px;
  font-weight: 600;
}

.modal-box input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

.modal-box form button {
  margin-top: 14px;
  width: 100%;
  padding: 10px;
  background: #2d6a4f;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.modal-box form button:hover {
  background: #245741;
}

#booking-success {
  color: #2d6a4f;
  font-weight: 600;
  margin: 8px 0;
}

.modal-alt {
  display: block;
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: #2d6a4f;
}

/* Dashboard tabs (Your slots / Requests) */
#dash-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.dtab-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid #d0d0d0;
  background: #f4f4f4;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.dtab-btn.active {
  background: #2d6a4f;
  color: #fff;
  border-color: #2d6a4f;
}

/* Booking request cards */
.req-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 10px;
}

.req-card.status-confirmed {
  background: #f0f7f3;
  border-color: #cfe6da;
}

.req-card.status-declined {
  opacity: 0.6;
}

.req-info {
  font-size: 13px;
  line-height: 1.5;
}

.req-info a {
  color: #2d6a4f;
  text-decoration: none;
}

.req-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  white-space: nowrap;
}

.btn-confirm,
.btn-decline {
  padding: 5px 10px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-confirm {
  background: #2d6a4f;
  color: #fff;
}

.btn-decline {
  background: #f0f0f0;
  color: #555;
}

.req-status {
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  color: #2d6a4f;
}

/* Floating toggle button — hidden on desktop, shown on mobile */
#sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 900;
  padding: 10px 14px;
  background: #2d6a4f;
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

/* ===== Mobile (phones / narrow screens) ===== */
@media (max-width: 768px) {
  /* Map fills the screen; sidebar becomes a slide-up bottom sheet */
  #app {
    display: block;
  }

  #map {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  #sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 78vh;
    border-right: none;
    border-top: 1px solid #e0e0e0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
    transform: translateY(100%);
    transition: transform 0.25s ease;
    z-index: 800;
  }

  #sidebar.open {
    transform: translateY(0);
  }

  #sidebar-toggle {
    display: inline-block;
  }

  /* Dashboard: stack the two columns */
  #dash-body {
    flex-direction: column;
  }
}

/* ── Booking tracking link (booking modal success) ── */
.track-link {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  word-break: break-all;
  color: #2d6a4f;
}

/* ── Public booking status page ── */
#status-page {
  max-width: 460px;
  margin: 0 auto;
  padding: 32px 20px;
}

.status-brand {
  font-weight: 700;
  font-size: 20px;
  color: #1b4332;
  text-decoration: none;
}

#status-page h1 {
  font-size: 22px;
  margin: 12px 0 16px;
  color: #1b4332;
}

.status-card {
  border: 1px solid #e0e0e0;
  border-left-width: 5px;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.status-card.status-pending   { border-left-color: #d8a200; background: #fffaf0; }
.status-card.status-confirmed { border-left-color: #2d6a4f; background: #f0f7f3; }
.status-card.status-declined  { border-left-color: #b23a3a; background: #faf0f0; }

.status-badge {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 10px;
}

.status-therapist { font-weight: 600; font-size: 16px; }
.status-when      { color: #555; margin-top: 2px; }
.status-service   { color: #555; }

.status-call,
.status-cta {
  display: inline-block;
  margin-top: 12px;
  padding: 9px 14px;
  border-radius: 8px;
  background: #2d6a4f;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.status-cta:hover,
.status-call:hover { background: #245741; }
