/* ── Variables ──────────────────────────────────────────────────────────────── */
:root {
  --bg:         #f1f5f9;
  --card:       #ffffff;
  --text:       #1e293b;
  --muted:      #64748b;
  --accent:     #1e40af;
  --accent-bg:  #eff6ff;
  --border:     #e2e8f0;
  --radius:     12px;
  --topbar:     #1e3a5f;
  --shadow:     0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg:  0 4px 16px rgba(0,0,0,0.10);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* ── Top bar ────────────────────────────────────────────────────────────────── */
.topbar {
  background: var(--topbar);
  color: #fff;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
}

.topbar-inner {
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-brand {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.topbar-sub {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  flex: 1;
}

.btn-sm {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-sm:hover { background: rgba(255,255,255,0.22); }
.hidden { display: none !important; }

/* ── Page layout ────────────────────────────────────────────────────────────── */
.page-main {
  max-width: 640px;
  margin: 32px auto 64px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px;
}

/* ── Booking card header ────────────────────────────────────────────────────── */
.card-header { margin-bottom: 28px; }
.card-header h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.subtitle { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }

/* ── Duration selector ──────────────────────────────────────────────────────── */
.duration-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.duration-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.dur-btn {
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.dur-btn:hover { border-color: var(--accent); color: var(--accent); }
.dur-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* ── Month navigation ───────────────────────────────────────────────────────── */
.month-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.month-label {
  font-weight: 600;
  font-size: 1rem;
  flex: 1;
  text-align: center;
}

.nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.nav-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.nav-btn:disabled { opacity: 0.3; cursor: default; }

/* ── Calendar grid ──────────────────────────────────────────────────────────── */
.cal-grid-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 6px;
}

.cal-grid-head span {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: default;
  transition: background 0.15s, color 0.15s;
}

.cal-day.empty { background: none; }

.cal-day.unavailable {
  color: var(--border);
}

.cal-day.past {
  color: var(--border);
}

.cal-day.available {
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
}
.cal-day.available:hover {
  background: var(--accent-bg);
}

.cal-day.selected {
  background: var(--accent);
  color: #fff;
}

.cal-day.today {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.loading-msg {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 24px 0;
}

/* ── Step 2: Time slots ─────────────────────────────────────────────────────── */
.step-header {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.time-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.time-btn {
  padding: 10px 8px;
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  background: none;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, color 0.15s;
}
.time-btn:hover:not(.busy) { background: var(--accent-bg); }
.time-btn.selected { background: var(--accent); color: #fff; }
.time-btn.busy {
  border-color: var(--border);
  background: #f8fafc;
  color: #b0bec5;
  cursor: not-allowed;
  opacity: 1;
}

.back-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  margin-top: 4px;
}
.back-btn:hover { color: var(--text); }

/* ── Step 3: Form ───────────────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.optional { font-weight: 400; color: var(--muted); }

.field input,
.field textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  transition: border-color 0.15s;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.submit-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 13px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 4px;
}
.submit-btn:hover { opacity: 0.88; }
.submit-btn:disabled { opacity: 0.5; cursor: default; }

.error-msg {
  color: #dc2626;
  font-size: 0.85rem;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: #fef2f2;
  border-radius: 6px;
  border: 1px solid #fecaca;
}

/* ── Step 4: Confirmation ───────────────────────────────────────────────────── */
.confirm-wrap {
  text-align: center;
  padding: 20px 0;
}

.confirm-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-weight: 700;
}

.confirm-wrap h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.confirm-details {
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 10px;
}

.confirm-sub {
  color: var(--muted);
  font-size: 0.88rem;
}

/* ── Admin card ─────────────────────────────────────────────────────────────── */
.admin-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.admin-section {
  margin-bottom: 28px;
}

.admin-section h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.hours-row {
  display: grid;
  grid-template-columns: 80px auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.hours-row label {
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hours-times {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.hours-times input[type="time"] {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--card);
}

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

.date-input {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--card);
}

.blocked-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.blocked-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
}

.blocked-tag button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
  line-height: 1;
}


.admin-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.admin-footer .submit-btn {
  width: auto;
  padding: 11px 32px;
}

.save-msg {
  color: #16a34a;
  font-size: 0.88rem;
  font-weight: 600;
}

.tz-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin: -4px 0 8px;
  text-align: center;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .card { padding: 20px 16px; }
  .time-slots { grid-template-columns: repeat(3, 1fr); }
  .topbar-sub { display: none; }
  .hours-row { grid-template-columns: 1fr; }
}
