:root {
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-soft: #ecfdf5;
  --accent: #f4662f;
  --accent-dark: #d94d21;
  --accent-soft: #fff3ee;
  --success: #16a34a;
  --text: #0f172a;
  --muted: #64748b;
  --border: #dbe8e5;
  --panel: #ffffff;
  --page: #f8fafc;
  --shadow: 0 24px 80px rgba(15, 23, 42, 0.16);
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, Manrope, Arial, Helvetica, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 0%, rgba(20, 184, 166, 0.14), transparent 30%), var(--page);
  overflow: hidden;
}

.page-demo {
  min-height: 100vh;
  padding: 40px;
}

.page-demo h1,
.page-demo p { margin: 0; }

.chatbot-panel {
  position: fixed;
  inset: 8px;
  background: var(--panel);
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
}

.chatbot-header {
  min-height: 86px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #fff;
  background: linear-gradient(135deg, #0b6b63 0%, #0f766e 55%, #63b7ad 100%);
  flex: 0 0 auto;
}

.chatbot-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chatbot-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-weight: 900;
  flex: 0 0 auto;
}

.chatbot-brand h2 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.chatbot-brand p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 650;
}

.chatbot-brand p span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.header-appointment-btn {
  border: 0;
  cursor: pointer;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 118, 110, 0.95);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
  font-size: 14px;
  font-weight: 900;
}

.chatbot-body {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.42), #fff 34%);
  overflow: hidden;
}

.chatbot-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.chatbot-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 22px;
  scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar,
.side-panel::-webkit-scrollbar { width: 9px; }
.chatbot-messages::-webkit-scrollbar-thumb,
.side-panel::-webkit-scrollbar-thumb { background: rgba(15, 118, 110, 0.26); border-radius: 999px; }

.message-row {
  display: flex;
  margin-bottom: 16px;
}

.message-row.user { justify-content: flex-end; }
.message-row.bot { justify-content: flex-start; }
.message-row.wide { width: 100%; }

.message-bubble {
  max-width: min(720px, 88%);
  padding: 15px 16px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.5;
}

.message-row.bot:not(.wide) .message-bubble {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(15, 118, 110, 0.08);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
  border-top-left-radius: 8px;
}

.message-row.user .message-bubble {
  color: #fff;
  background: var(--primary);
  border-top-right-radius: 8px;
  font-weight: 800;
}

.message-row.wide .message-bubble {
  width: 100%;
  max-width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.btn,
.chat-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover,
.chat-btn:hover { transform: translateY(-1px); }

.btn-primary,
.chat-btn:not(.secondary):not(.call) {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.2);
}

.btn-primary:hover,
.chat-btn:not(.secondary):not(.call):hover { background: var(--primary-dark); }

.btn-secondary,
.chat-btn.secondary {
  color: var(--primary);
  background: #fff;
  border: 1px solid rgba(15, 118, 110, 0.26);
}

.btn-secondary:hover,
.chat-btn.secondary:hover { background: var(--primary-soft); }

.btn-call,
.chat-btn.call {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 14px 30px rgba(244, 102, 47, 0.22);
}

.btn-call:hover,
.chat-btn.call:hover { background: var(--accent-dark); }

.btn:disabled,
.chat-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.appointment-box {
  width: 100%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 26px;
  padding: 24px;
  box-shadow: 0 18px 54px rgba(15, 23, 42, 0.08);
}

.mobile-step-indicator {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--primary-soft);
  border: 1px solid rgba(15, 118, 110, 0.18);
  color: var(--primary-dark);
  font-weight: 900;
  font-size: 14px;
}

.box-title {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.box-subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.intro-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border: 1px solid rgba(244, 102, 47, 0.16);
  border-radius: 18px;
  background: linear-gradient(135deg, #fff7f2, rgba(255, 255, 255, 0.82));
  color: var(--accent-dark);
}

.intro-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  font-weight: 900;
  flex: 0 0 auto;
}

.intro-card strong { display: block; margin-bottom: 3px; }
.intro-card span { font-weight: 750; }

.appointment-types {
  display: grid;
  gap: 12px;
}

.type-card {
  width: 100%;
  min-height: 78px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  cursor: pointer;
  text-align: left;
  border-radius: 20px;
  padding: 16px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(236, 253, 245, 0.72));
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.045);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.type-card:hover,
.type-card.selected {
  border-color: rgba(15, 118, 110, 0.34);
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.07);
}

.type-icon,
.type-arrow {
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: rgba(236, 253, 245, 0.95);
  border: 1px solid rgba(15, 118, 110, 0.12);
  font-weight: 950;
}

.type-icon { width: 44px; height: 44px; font-size: 19px; }
.type-arrow { width: 34px; height: 34px; border-radius: 999px; font-size: 20px; }

.type-card h4 {
  margin: 0 0 4px;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.type-card p {
  margin: 0;
  color: #52647a;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
}

.schedule-days {
  display: grid;
  gap: 10px;
}

.day-card {
  padding: 14px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 18px;
  background: #fff;
}

.day-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.day-card-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 950;
}

.available-count {
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
}

.slot-btn {
  width: 100%;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.slot-btn:hover { background: #d9fbee; }
.slot-btn.booked {
  cursor: not-allowed;
  color: #94a3b8;
  background: #f1f5f9;
  border-color: #e2e8f0;
  text-decoration: line-through;
}

.availability-nav {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 18px;
  background: rgba(236, 253, 245, 0.72);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.availability-range {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 950;
}

.availability-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.availability-nav-btn {
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 12px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 950;
}

.availability-nav-btn.primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.availability-nav-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.patient-form {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 14px 18px;
  align-items: center;
  width: 100%;
}

.patient-form label {
  font-size: 14px;
  font-weight: 950;
}

.patient-form input,
.patient-form select,
.patient-form textarea {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
}

.patient-form textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.45;
}

.patient-form input:focus,
.patient-form select:focus,
.patient-form textarea:focus {
  border-color: rgba(15, 118, 110, 0.48);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

.form-full { grid-column: 1 / -1; }
.form-full label { display: block; margin-bottom: 8px; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.summary-card {
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(22, 163, 74, 0.22);
  background: #f0fdf4;
}

.summary-card h3 {
  margin: 0 0 16px;
  color: #166534;
  font-size: 20px;
}

.summary-list {
  display: grid;
  gap: 10px;
  font-size: 15px;
}

.summary-list div {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
}

.summary-list strong { color: #166534; }

.success-message {
  margin-top: 16px;
  padding: 18px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(22, 163, 74, 0.22);
  color: #166534;
  font-weight: 800;
  line-height: 1.55;
}

.error-message {
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  background: #fff1f2;
  border: 1px solid rgba(220, 38, 38, 0.18);
  color: #991b1b;
  font-weight: 800;
}

.chatbot-input-area {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.chatbot-input-area input {
  min-width: 0;
  flex: 1;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 16px;
  font-size: 15px;
  outline: none;
}

.btn-send { min-width: 76px; border-radius: 16px; }

.side-panel {
  min-width: 0;
  padding: 20px;
  background: #fff;
  overflow-y: auto;
}

.side-card {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  margin-bottom: 14px;
  background: #fff;
}

.side-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.side-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.side-eyebrow {
  margin: 0 0 5px !important;
  color: var(--primary) !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px !important;
  font-weight: 950;
}

.side-card-selected {
  background: linear-gradient(135deg, var(--primary-soft), #fff);
  border-color: rgba(15, 118, 110, 0.18);
}

.selected-summary-box {
  margin: 12px 0 16px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15, 118, 110, 0.10);
}

.selected-summary-box strong,
.selected-summary-box span {
  display: block;
  color: var(--primary-dark);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 900;
}

.progress-steps {
  display: grid;
  gap: 0;
}

.progress-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  position: relative;
  padding-bottom: 12px;
}

.progress-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 34px;
  width: 2px;
  height: calc(100% - 28px);
  background: #e2e8f0;
}

.progress-step.done:not(:last-child)::after { background: #86efac; }

.step-number {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  font-weight: 950;
  z-index: 1;
}

.progress-step.done .step-number {
  color: #fff;
  background: var(--success);
  border-color: var(--success);
}

.progress-step.current .step-number {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.step-title {
  display: block;
  color: var(--text);
  font-weight: 950;
  font-size: 14px;
}

.step-state {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.progress-step.done .step-title,
.progress-step.done .step-state { color: #166534; }
.progress-step.current .step-title,
.progress-step.current .step-state { color: var(--accent-dark); }

.help-card {
  background: var(--accent-soft);
  border-color: rgba(244, 102, 47, 0.18);
}

.help-card h3 { color: #9a3412; }
.help-card p { color: #7c2d12; }
.help-card .btn-call { width: 100%; margin-top: 14px; }


/* Standalone appointment page header */
.booking-app-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(20, 184, 166, 0.10), transparent 30rem),
    linear-gradient(180deg, #f8fafc 0%, #eefcf8 100%);
  padding: 88px 24px 24px;
}

.booking-page-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  min-height: 64px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(15, 118, 110, 0.12);
}

.booking-back-link {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 950;
  padding: 10px 14px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid rgba(15, 118, 110, 0.16);
}

.booking-back-link:hover { background: #d1fae5; }

.mobile-header-back {
  display: none;
}

.booking-page-title {
  text-align: right;
  display: grid;
  gap: 2px;
}

.booking-page-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.booking-page-title strong {
  color: var(--text);
  font-size: 17px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.booking-app-page .chatbot-panel {
  position: relative;
  inset: auto;
  height: calc(100vh - 112px);
  max-width: 1380px;
  margin: 0 auto;
}

/* Monthly calendar is now used on desktop and mobile. */
.mobile-calendar-block { display: block; }
.desktop-schedule-block { display: none; }

.mobile-month-card {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 14px 34px rgba(15,23,42,0.06);
  padding: 14px;
  touch-action: pan-y;
}

.mobile-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.mobile-month-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.month-nav-btn {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid rgba(15,118,110,0.16);
  border-radius: 14px;
  background: #ecfdf5;
  color: var(--primary-dark);
  font-weight: 950;
  cursor: pointer;
}

.month-nav-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.mobile-weekdays,
.mobile-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.mobile-weekdays span {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.month-day-btn {
  min-height: 40px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: #f8fafc;
  color: var(--text);
  font-size: 14px;
  font-weight: 950;
  cursor: pointer;
}

.month-day-btn:hover:not(:disabled) {
  border-color: rgba(15,118,110,0.24);
  background: #ecfdf5;
}

.month-day-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(15,118,110,0.22);
}

.month-day-btn.today:not(.selected) {
  border-color: rgba(244,102,47,0.36);
  color: var(--accent-dark);
}

.month-day-btn.outside,
.month-day-btn:disabled {
  color: #cbd5e1;
  background: #f1f5f9;
  cursor: not-allowed;
}

.mobile-times-card {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #ffffff;
  padding: 14px;
}

.mobile-times-card h4 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 16px;
  font-weight: 950;
}

.mobile-times-placeholder {
  color: var(--muted);
  padding: 14px;
  border-radius: 18px;
  background: #f8fafc;
  font-weight: 850;
  line-height: 1.5;
}

.mobile-slot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 1050px) {
  .chatbot-body { grid-template-columns: 1fr; }
  .side-panel { display: none; }
  .chatbot-main { border-right: 0; }
  .mobile-step-indicator { display: block; }
}

@media (max-width: 760px) {
  .booking-app-page { padding: 0; background: var(--page); }
  .booking-page-header { display: none; }
  .booking-app-page .chatbot-panel { height: 100vh; border-radius: 0; }
  .desktop-schedule-block { display: none; }
  .mobile-calendar-block { display: block; }
  .mobile-step-indicator { margin-bottom: 12px; }

  body { overflow-x: hidden; overflow-y: auto; }
  .chatbot-panel { inset: 0; border-radius: 0; }
  .chatbot-header {
    min-height: 56px;
    padding: 10px 14px;
    justify-content: flex-start;
  }
  .chatbot-brand {
    width: 100%;
    gap: 10px;
  }
  .mobile-header-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 950;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
  }
  .chatbot-brand h2 {
    margin: 0;
    font-size: 16px;
    line-height: 1.1;
  }
  .chatbot-brand p { display: none; }
  .chatbot-avatar { display: none; }
  .header-appointment-btn { display: none; }
  .chatbot-messages { padding: 14px; }
  .message-bubble { max-width: 95%; }
  .appointment-box { padding: 16px; border-radius: 22px; }
  .box-title { font-size: 21px; }
  .intro-card { align-items: flex-start; }
  .type-card { grid-template-columns: 42px minmax(0, 1fr); }
  .type-arrow { display: none; }
  .slot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .availability-nav { align-items: stretch; }
  .availability-range { width: 100%; }
  .availability-actions { width: 100%; }
  .availability-nav-btn { flex: 1 1 100%; }
  .patient-form { grid-template-columns: 1fr; gap: 8px; }
  .patient-form label { margin-top: 8px; }
  .summary-list div { grid-template-columns: 1fr; gap: 2px; }
  .form-actions { justify-content: stretch; }
  .form-actions .btn,
  .form-actions .chat-btn { width: 100%; }
  .chatbot-input-area { padding: 12px; }
  .btn-send { min-width: 64px; }
}

@media (max-width: 430px) {
  .slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-month-grid, .mobile-weekdays { gap: 5px; }
  .month-day-btn { min-height: 38px; border-radius: 12px; }
}


/* Monthly calendar upgrade */
.appointment-calendar-box {
  max-width: 1180px;
}

.monthly-calendar-block {
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(360px, 1fr);
  gap: 16px;
  align-items: start;
}

.mobile-month-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.month-day-btn.has-times:not(.selected) {
  border-color: rgba(15, 118, 110, 0.28);
  background: #e8fff6;
  color: var(--primary-dark);
}

.month-day-btn.no-times,
.month-day-btn.closed {
  color: #94a3b8;
  background: #eef2f7;
  text-decoration: none;
}

.month-day-btn.loading::after {
  content: "";
  display: block;
  width: 5px;
  height: 5px;
  margin: 3px auto 0;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.55;
}

.monthly-times-card {
  min-height: 100%;
}

.selected-date-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.selected-date-head span {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.selected-date-head h4 {
  margin: 0;
}

.monthly-slot-grid {
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
}

.chat-safety-note {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-weight: 850;
}

@media (max-width: 900px) {
  .monthly-calendar-block {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .monthly-slot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* Final appointment calendar fixes: PM slots + mobile scroll target */
.monthly-times-card {
  scroll-margin-top: 12px;
}

.monthly-slot-grid {
  align-content: start;
}

@media (max-width: 760px) {
  .monthly-calendar-block {
    gap: 14px;
  }

  .mobile-times-card.monthly-times-card {
    min-height: auto;
    padding: 14px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 14px 28px rgba(15, 118, 110, 0.08);
  }

  .selected-date-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .monthly-slot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 430px) {
  .monthly-slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Calendar-only final cleanup: hide other-month days and keep unavailable days visually off. */
.month-day-empty {
  min-height: 40px;
  border-radius: 14px;
  pointer-events: none;
  visibility: hidden;
}

.month-day-btn.no-times,
.month-day-btn.closed,
.month-day-btn:disabled {
  color: #b6c2d1;
  background: #eef2f7;
  border-color: transparent;
  opacity: 0.72;
  cursor: not-allowed;
}

.month-day-btn.has-times:not(.selected):not(:disabled) {
  opacity: 1;
}

@media (max-width: 430px) {
  .month-day-empty {
    min-height: 38px;
    border-radius: 12px;
  }
}


/* Mobile safety delay before appointment type choices */
.appointment-delay-box {
  min-height: 210px;
}

.appointment-delay-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 22px;
  background: rgba(240, 253, 250, 0.72);
}

.appointment-delay-spinner {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 3px solid rgba(15, 118, 110, 0.18);
  border-top-color: #0f766e;
  border-radius: 50%;
  animation: appointmentDelaySpin 0.8s linear infinite;
}

@keyframes appointmentDelaySpin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .appointment-delay-box {
    min-height: 245px;
  }

  .appointment-delay-card {
    padding: 20px;
  }
}


/* CHATBOT BACK TO TOP */
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
.back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 9999;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,0.34);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #073f3d, #0f766e);
  box-shadow: 0 18px 36px rgba(7,63,61,0.22);
  font-size: 22px;
  line-height: 1;
  font-weight: 850;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.back-to-top:hover,
.back-to-top:focus-visible {
  box-shadow: 0 22px 44px rgba(7,63,61,0.28);
  transform: translateY(-2px) scale(1.02);
  outline: none;
}
@media (max-width: 680px) {
  .back-to-top {
    right: 14px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: 42px;
    height: 42px;
    font-size: 20px;
  }
}
