/* MasterSlot booking — ultra-light modern styles (< 50KB total) */

:root {
  --bg: #f8f9fa;
  --card: #fff;
  --primary: #6c5ce7;
  --primary-hover: #5a4bd6;
  --text: #1a1a2e;
  --text-muted: #6c757d;
  --border: #e0e0e0;
  --success: #27ae60;
  --danger: #e74c3c;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --primary: #818cf8;
  --primary-hover: #6366f1;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: 0 4px 20px rgba(0,0,0,.4);
}

.theme-toggle-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
  z-index: 100;
}

.theme-toggle-btn:hover {
  transform: scale(1.05);
}

* { 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);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* Main app card */
#booking-app {
  max-width: 480px;
  margin: 20px auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
}

.booking-header h2 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

/* Step indicator */
#step-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: .85rem;
}
.step-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-weight: 600;
}
.step-dot.active {
  background: var(--primary);
  color: #fff;
}
.step-arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Error */
.error-msg {
  color: var(--danger);
  font-size: .9rem;
  margin: 8px 0;
  padding: 8px 12px;
  background: #fdecea;
  border-radius: 8px;
  display: none;
}
.error-msg:not(:empty) { display: block; }

/* Step titles */
.step h3 {
  font-size: 1.05rem;
  margin-bottom: 12px;
  color: var(--text-muted);
}

/* Services */
.services-list { display: flex; flex-direction: column; gap: 10px; }

.master-header {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 8px 0;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.service-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.service-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(108,92,231,.2);
}
.service-name { font-weight: 600; color: var(--text) !important; }
.service-meta { color: var(--text-muted) !important; font-size: .9rem; }

/* Date picker */
#date-slots label {
  display: block;
  margin-bottom: 6px;
  font-size: .9rem;
  color: var(--text-muted);
}
#date-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 12px;
}
#slots-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.slot-btn {
  padding: 10px 16px;
  background: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: .9rem;
  transition: all .12s;
  flex: 0 0 auto;
}
.slot-btn:hover { border-color: var(--primary); }
.slot-btn.selected {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary);
}
.loading, .no-slots {
  color: var(--text-muted);
  font-size: .9rem;
  padding: 8px 0;
}

/* Contact form */
#contact-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#contact-form label {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: 4px;
}
#contact-form input,
#contact-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
}
#contact-form textarea { min-height: 60px; resize: vertical; }
.booking-summary {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 8px;
  font-size: .9rem;
  color: var(--text);
  margin-bottom: 8px;
}

/* Submit */
#submit-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
#submit-btn:hover:not(:disabled) { background: var(--primary-hover); }
#submit-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Back */
.back-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: .9rem;
  color: var(--text-muted);
}

/* Success */
.booking-success {
  text-align: center;
  padding: 32px 16px;
  animation: fadeIn .3s ease;
}
.success-icon {
  font-size: 3rem;
  color: var(--success);
  margin-bottom: 8px;
}
.booking-success h3 {
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 8px;
}
.booking-success p {
  font-size: 1.05rem;
  color: var(--text);
}
.success-detail { color: var(--text-muted); font-size: .9rem; }

/* Viral banner */
.viral-banner {
  position: sticky;
  bottom: 0;
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  border-radius: var(--radius);
  margin-top: 16px;
  text-align: center;
}
.viral-link {
  display: block;
  padding: 14px 16px;
  color: #fff;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.3;
}
.viral-link:hover { text-decoration: underline; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a2e;
    --card: #2a2a3e;
    --text: #e0e0f0;
    --text-muted: #a0a0b8;
    --border: #3a3a4e;
  }
}

/* Mobile & MAX Mini App Fullscreen Native Adaptation */
@media (max-width: 640px) {
  body {
    background: var(--card);
    padding: 0;
    margin: 0;
    -webkit-tap-highlight-color: transparent;
  }

  #booking-app {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 16px 16px 40px 16px !important;
    min-height: 100vh;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(32px, env(safe-area-inset-bottom));
  }

  .service-card {
    padding: 16px 14px !important;
    font-size: 16px !important;
    border-radius: 14px !important;
  }

  .slot-btn {
    padding: 12px 10px !important;
    font-size: 15px !important;
    min-height: 44px !important;
  }

  #submit-btn {
    padding: 16px 20px !important;
    font-size: 17px !important;
    border-radius: 14px !important;
    min-height: 50px !important;
  }

  input, textarea {
    font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
    padding: 14px 12px !important;
    border-radius: 10px;
  }

  .stats-grid {
    grid-template-columns: 1fr !important;
  }
}