/* ─── CSS Custom Properties (themes) ─────────────────────────────────────── */
:root {
  --primary: #1B2A4A;
  --primary-text: #ffffff;
  --accent: #C9A84C;
  --accent-hover: #b8943d;
  --bg: #f5f5f3;
  --surface: #ffffff;
  --border: #e0e0e0;
  --text: #1a1a1a;
  --text-muted: #666666;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

body[data-theme="ybm"] {
  --primary: #1a1a1a;
  --primary-text: #ffffff;
  --accent: #F5A623;
  --accent-hover: #e09018;
  --bg: #f5f5f3;
}

/* ─── Reset & base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Georgia', serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Header ──────────────────────────────────────────────────────────────── */
#site-header {
  background: var(--primary);
  color: var(--primary-text);
  padding: 24px 40px;
  text-align: center;
}

#site-header .header-logo {
  max-height: 64px;
  max-width: 280px;
  object-fit: contain;
  margin-bottom: 8px;
}

#site-header h1 {
  font-size: 24px;
  font-weight: normal;
  letter-spacing: 0.5px;
}

#site-header p.header-subtitle {
  font-size: 14px;
  opacity: 0.75;
  margin-top: 4px;
}

/* ─── Main container ──────────────────────────────────────────────────────── */
.booking-container {
  flex: 1;
  max-width: 680px;
  width: 100%;
  margin: 40px auto;
  padding: 0 16px;
}

/* ─── Steps ───────────────────────────────────────────────────────────────── */
.step { display: none; }
.step.active { display: block; }

.step-header {
  margin-bottom: 28px;
}

.step-header h2 {
  font-size: 22px;
  font-weight: normal;
  color: var(--primary);
  margin-bottom: 6px;
}

.step-header p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.5;
}

.back-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  margin-bottom: 16px;
  display: inline-block;
  font-family: inherit;
}

.back-btn:hover { text-decoration: underline; }

/* ─── Calendar navigation ─────────────────────────────────────────────────── */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
}

.calendar-nav h3 {
  font-size: 18px;
  font-weight: normal;
  color: var(--primary);
}

.calendar-nav button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 36px;
  height: 36px;
  font-size: 22px;
  cursor: pointer;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.calendar-nav button:hover {
  background: var(--bg);
}

/* ─── Calendar grid ───────────────────────────────────────────────────────── */
.calendar-grid {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--primary);
}

.calendar-weekdays span {
  text-align: center;
  padding: 10px 0;
  color: var(--primary-text);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.85;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
}

.cal-day {
  background: var(--surface);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: default;
  transition: background 0.15s;
  position: relative;
}

.cal-day.empty { background: var(--bg); }

.cal-day.past,
.cal-day.unavailable {
  color: #ccc;
  cursor: not-allowed;
}

.cal-day.available {
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
}

.cal-day.available:hover {
  background: var(--accent);
  color: white;
}

.cal-day.today {
  font-weight: bold;
}

.cal-day.today::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.cal-day.selected {
  background: var(--primary);
  color: white;
}

/* ─── Time slots ──────────────────────────────────────────────────────────── */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.slot-btn {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s;
  box-shadow: var(--shadow);
}

.slot-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.slot-btn.busy {
  background: var(--bg);
  color: #ccc;
  cursor: not-allowed;
  text-decoration: line-through;
  border-color: var(--border);
  box-shadow: none;
}

.slot-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.no-slots {
  color: var(--text-muted);
  font-size: 15px;
  text-align: center;
  padding: 40px 0;
  grid-column: 1 / -1;
}

/* ─── Form ────────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.required { color: var(--accent); }
.optional { color: #aaa; font-size: 12px; text-transform: none; letter-spacing: 0; }

.form-group input,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

.form-group textarea { resize: vertical; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 16px 36px;
  font-size: 16px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.15s;
  text-decoration: none;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.error-msg {
  color: #c0392b;
  font-size: 14px;
  margin-top: 12px;
}

/* ─── Confirmation ────────────────────────────────────────────────────────── */
.confirmation-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 40px;
  text-align: center;
}

.check-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #2ecc71;
  color: white;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.confirmation-card h2 {
  font-size: 26px;
  color: var(--primary);
  margin-bottom: 12px;
}

.confirmation-card p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.confirmation-sub {
  font-size: 13px;
  color: #aaa;
  margin-bottom: 28px !important;
}

.detail-block {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: left;
  margin-bottom: 28px;
  font-size: 15px;
  line-height: 2;
  color: var(--text);
}

.detail-block strong { color: var(--text-muted); font-weight: normal; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ─── Footer ──────────────────────────────────────────────────────────────── */
#site-footer {
  background: var(--primary);
  color: var(--primary-text);
  text-align: center;
  padding: 20px;
  font-size: 13px;
  opacity: 0.9;
}

/* ─── Spinner ─────────────────────────────────────────────────────────────── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.hidden { display: none; }

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 500px) {
  #site-header { padding: 20px 16px; }
  .booking-container { margin: 20px auto; }
  .confirmation-card { padding: 32px 20px; }
  .slots-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ─── RoofersMaven theme ─────────────────────────────────────────────────── */
body[data-theme="rm"] {
  --primary: #00194C;      /* navy */
  --primary-text: #ffffff;
  --accent: #0055FF;       /* brand blue */
  --accent-hover: #0044cc;
  --bg: #E6EEFF;           /* light blue */
}

/* --- AI Automators theme --- */
body[data-theme="aia"] {
  --primary: #00194C;
  --primary-text: #ffffff;
  --accent: #0055FF;
  --accent-hover: #0044cc;
  --bg: #E6EEFF;
}
