/* ── Randevuio Web Booking — Design Tokens ── */
:root {
  --primary: #4F46E5;
  --primary-light: #EEF2FF;
  --primary-dark: #3730A3;
  --primary-muted: #818CF8;
  --success: #10B981;
  --success-light: #ECFDF5;
  --success-dark: #065F46;
  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --warning: #F59E0B;
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;
  --text-placeholder: #D1D5DB;
  --bg: #F9FAFB;
  --surface: #FFFFFF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--surface);
  position: relative;
}

/* ── Screens ── */
.screen { display: none; }
.screen.active { display: block; }

/* ── Loading ── */
.loader-wrap {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100dvh; gap: 16px;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner.small { width: 20px; height: 20px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { color: var(--text-muted); font-size: 14px; }

/* ── Error ── */
.error-wrap {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100dvh; padding: 32px; text-align: center; gap: 12px;
}
.error-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--danger-light); color: var(--danger);
  font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.error-wrap h2 { font-size: 20px; font-weight: 700; }
.error-wrap p { color: var(--text-secondary); font-size: 14px; line-height: 1.5; }

/* ── Header ── */
#biz-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; padding: 24px 20px 16px; position: sticky; top: 0; z-index: 10;
}
.header-brand {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.5px; opacity: 0.7; margin-bottom: 4px;
}
#biz-name { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.biz-meta { font-size: 13px; opacity: 0.8; display: flex; gap: 12px; flex-wrap: wrap; }
.biz-meta span { display: flex; align-items: center; gap: 4px; }

.progress-bar {
  height: 3px; background: rgba(255,255,255,0.2);
  border-radius: 2px; margin-top: 16px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: white; border-radius: 2px;
  width: 0%; transition: width 0.4s ease;
}

/* ── Steps ── */
.step { display: none; padding: 20px; animation: fadeIn 0.3s ease; }
.step.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.step-header { margin-bottom: 16px; }
.step-header h2 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.step-badge {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: white;
  font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step-sub { color: var(--text-muted); font-size: 13px; margin-top: 4px; margin-left: 38px; }

/* ── Card List (services, staff) ── */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.card-item {
  border: 2px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px;
  cursor: pointer; transition: all 0.2s ease;
  display: flex; justify-content: space-between; align-items: center;
}
.card-item:hover { border-color: var(--primary-muted); background: var(--primary-light); }
.card-item.selected { border-color: var(--primary); background: var(--primary-light); }
.card-item-info { flex: 1; }
.card-item-name { font-weight: 600; font-size: 15px; }
.card-item-detail { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }
.card-item-right { text-align: right; flex-shrink: 0; margin-left: 12px; }
.card-item-price { font-weight: 700; font-size: 15px; color: var(--primary); }
.card-item-duration { font-size: 12px; color: var(--text-muted); }
.card-item-check {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border); display: flex;
  align-items: center; justify-content: center;
  transition: all 0.2s; font-size: 12px; color: white;
}
.card-item.selected .card-item-check {
  background: var(--primary); border-color: var(--primary);
}

/* ── Skip button ── */
.skip-btn { margin-bottom: 12px; width: 100%; }

/* ── Date Picker ── */
.date-picker-wrap { margin-bottom: 16px; }
.date-scroll {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 4px 0; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.date-scroll::-webkit-scrollbar { display: none; }
.date-chip {
  flex-shrink: 0; width: 60px; padding: 10px 0; text-align: center;
  border: 2px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer; transition: all 0.2s; background: var(--surface);
}
.date-chip:hover { border-color: var(--primary-muted); }
.date-chip.selected { border-color: var(--primary); background: var(--primary-light); }
.date-chip.closed { opacity: 0.35; cursor: not-allowed; }
.date-chip-day { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.date-chip-num { font-size: 18px; font-weight: 700; margin: 2px 0; }
.date-chip-month { font-size: 10px; color: var(--text-muted); }
.date-chip.selected .date-chip-day,
.date-chip.selected .date-chip-month { color: var(--primary); }

/* ── Time Slots ── */
.time-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.time-slot {
  padding: 10px 4px; text-align: center; border: 2px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 14px;
  font-weight: 500; transition: all 0.2s;
}
.time-slot:hover { border-color: var(--primary-muted); background: var(--primary-light); }
.time-slot.selected { border-color: var(--primary); background: var(--primary); color: white; }
.slots-loading {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 32px 0; color: var(--text-muted); font-size: 14px;
}
.slots-empty {
  text-align: center; padding: 32px 0; color: var(--text-muted); font-size: 14px;
}

/* ── Form ── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-group input, .form-group textarea {
  width: 100%; border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 15px; font-family: inherit;
  color: var(--text-primary); background: var(--surface);
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary);
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-placeholder); }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 24px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; border: none; transition: all 0.2s;
  width: 100%;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover:not(:disabled) { background: var(--primary-light); }
.step-next { margin-top: 16px; }

/* ── Summary Card ── */
.summary-card {
  border: 2px solid var(--border-light); border-radius: var(--radius-md);
  padding: 16px; margin-bottom: 16px; background: var(--bg);
}
.summary-row {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid var(--border-light); font-size: 14px;
}
.summary-row:last-child { border-bottom: none; }
.summary-label { color: var(--text-muted); }
.summary-value { font-weight: 600; text-align: right; }

/* ── Success ── */
.success-wrap {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 20px; text-align: center; gap: 12px;
}
.success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--success-light); color: var(--success);
  font-size: 32px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.success-wrap h2 { font-size: 20px; font-weight: 700; }
.success-sub { color: var(--text-secondary); font-size: 14px; }
.success-wrap .summary-card { width: 100%; text-align: left; margin-top: 8px; }
.success-wrap .btn { margin-top: 12px; }

/* ── Back Button ── */
.back-btn {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--surface); color: var(--text-secondary);
  border: 2px solid var(--border); border-radius: var(--radius-pill);
  padding: 10px 24px; font-size: 14px; font-weight: 600;
  cursor: pointer; box-shadow: var(--shadow-md);
  font-family: inherit; z-index: 20; transition: all 0.2s;
}
.back-btn:hover { background: var(--bg); border-color: var(--primary-muted); }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text-primary); color: white;
  padding: 12px 24px; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 500; z-index: 100;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  max-width: 90%;
}
.toast.error { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(16px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-50%) translateY(16px); } }

/* ── Responsive ── */
@media (max-width: 360px) {
  .time-grid { grid-template-columns: repeat(3, 1fr); }
  .date-chip { width: 54px; }
}
