:root {
  /* Brand teal — primary buttons (matches myclinicy.com's actual button color) */
  --primary: #03c595;
  --primary-dark: #029f78;
  --primary-light: #e6f9f4;
  /* Selection green — day picker / time slots / success state (myclinicy uses a
     second, more emerald green for these, distinct from the button teal above) */
  --success: #20cc6d;
  --success-soft: #d9f4e3;
  --text: #3f4a44;
  --muted: #7c8f83;
  --border: #dde5e0;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --bg: #f7f9f8;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Alexandria", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--primary-dark); }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); display: inline-block; }
.admin-link { color: var(--muted); font-size: 13px; text-decoration: none; }
.admin-link:hover { color: var(--primary-dark); }

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
}

.wizard h1 { margin: 0 0 4px; font-size: 22px; }
.subtitle { margin: 0 0 20px; color: var(--muted); font-size: 14px; }

.progress-track {
  height: 6px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--success);
  border-radius: 4px;
  transition: width .2s ease;
}
.progress-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 20px;
}

.panel h2 { font-size: 16px; margin: 0 0 14px; }
.hidden { display: none !important; }

.option-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.option-card {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: right;
  background: #fff;
  transition: border-color .15s, background .15s;
}
.option-card:hover { border-color: var(--primary); background: var(--primary-light); }
.option-card.selected { border-color: var(--primary); background: var(--primary-light); }
.option-title { font-weight: 700; font-size: 15px; }
.option-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

.option-card.with-avatar {
  display: flex;
  align-items: center;
  gap: 14px;
}
.avatar {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.avatar-lg { width: 76px; height: 76px; min-width: 76px; font-size: 26px; border-radius: 14px; }
.avatar-sm { width: 34px; height: 34px; min-width: 34px; font-size: 13px; border-radius: 8px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--muted); }
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
}
.field input:focus { outline: none; border-color: var(--primary); }

/* ---- Day picker (week strip, like myclinicy) ---- */
.day-picker-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.day-picker-nav .nav-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.day-picker-nav .nav-arrow:hover { border-color: var(--primary); color: var(--primary-dark); }
.day-picker-nav .nav-arrow:disabled { opacity: .35; cursor: not-allowed; }
.day-picker-label { font-size: 13px; color: var(--muted); font-weight: 600; }

.day-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.day-btn {
  padding: 10px 4px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  line-height: 1.6;
}
.day-btn .day-name { display: block; font-size: 13px; font-weight: 700; color: var(--text); }
.day-btn .day-date { display: block; font-size: 12px; color: var(--muted); direction: ltr; }
.day-btn:hover { border-color: var(--success); background: var(--success-soft); }
.day-btn.selected { background: var(--success); border-color: var(--success); }
.day-btn.selected .day-name, .day-btn.selected .day-date { color: #fff; }
.day-btn:disabled {
  border-color: var(--border);
  cursor: not-allowed;
  opacity: .5;
}
.day-btn:disabled:hover { background: #fff; border-color: var(--border); }

/* ---- Time slots, grouped by period like myclinicy ---- */
.slot-period + .slot-period { margin-top: 18px; }
.slot-period-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
  direction: ltr;
  text-align: right;
}
.slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 4px;
}
.slot-btn {
  padding: 10px 6px;
  border: 1.5px solid var(--success);
  border-radius: 8px;
  background: #fff;
  color: var(--success);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  direction: ltr;
}
.slot-btn:hover { background: var(--success-soft); }
.slot-btn.selected { border-color: var(--success); background: var(--success); color: #fff; }
.empty-note { color: var(--muted); font-size: 14px; padding: 10px 0; }

.btn-primary {
  width: 100%;
  padding: 13px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #b9c2c4; cursor: not-allowed; }

.btn-link {
  display: block;
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 12px 0 0;
}
.btn-link:hover { color: var(--primary-dark); }

.btn-outline {
  display: block;
  margin: 10px auto 0;
  padding: 10px 22px;
  background: #fff;
  border: 1.5px solid var(--primary);
  color: var(--primary-dark);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.btn-outline:hover { background: var(--primary-light); }

/* Temporary test-mode helper — only rendered while OTP_TEST_MODE=true on the
   server (no real SMS sent). Styled to stand out so it's obvious this must
   be removed/disabled before real patients use the site. */
.dev-otp-hint {
  background: #fff7e6;
  border: 1.5px dashed #f0ad4e;
  color: #8a5a00;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  text-align: center;
}
.dev-otp-hint b { font-size: 20px; letter-spacing: 2px; direction: ltr; display: inline-block; }

.alert {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}

.summary {
  background: var(--primary-light);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 2;
}
.summary b { color: var(--primary-dark); }

.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  margin: 0 auto 16px;
}
[data-panel="success"] h2 { text-align: center; }
.note-box {
  background: #f3f4f6;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: 18px;
}

.skeleton {
  height: 60px;
  border-radius: 12px;
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

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