/* ==========================================
   HypoKompass Buchungssystem – Mobile First
   ========================================== */

:root {
  --primary: #1a3a6b;
  --primary-light: #2a5298;
  --accent: #e8b84b;
  --green: #22c55e;
  --red: #ef4444;
  --gray: #9ca3af;
  --bg: #f4f6fb;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius: 14px;
  --shadow: 0 2px 16px rgba(26,58,107,0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

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

.app { max-width: 480px; margin: 0 auto; padding-bottom: 40px; }

/* Header */
.header {
  background: #032744;
  border-radius: 28px;
  margin: 12px 12px 0;
  text-align: center;
  padding: 32px 24px 28px;
}
.logo {
  height: 110px;
  object-fit: contain;
  display: block;
  margin: 0 auto 20px;
}
.logo-text { color: #fff; font-size: 28px; font-weight: 700; }

/* Hero (inside header) */
.hero { color: #fff; }
.hero h1 { font-size: 21px; font-weight: 700; margin-bottom: 10px; line-height: 1.3; }
.hero p { font-size: 14px; opacity: 0.88; line-height: 1.6; max-width: 360px; margin: 0 auto; }

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  background: #fff;
  border-radius: 16px;
  margin: 10px 12px 0;
  box-shadow: var(--shadow);
  gap: 0;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.4;
  transition: opacity 0.2s;
}
.step.active, .step.done { opacity: 1; }
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  transition: all 0.2s;
}
.step.active .step-num { background: var(--primary); color: #fff; }
.step.done .step-num { background: var(--green); color: #fff; }
.step-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.step.active .step-label { color: var(--primary); font-weight: 600; }
.step-line { flex: 1; height: 2px; background: var(--border); min-width: 16px; max-width: 32px; margin: 0 4px; margin-bottom: 16px; }

/* Card */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  margin: 16px 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: var(--primary); }

/* Beratungsart-Auswahl */
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.type-card {
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 24px 12px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.type-card:hover { border-color: var(--primary); background: #f0f4ff; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(26,58,107,0.12); }
.type-card.selected { border-color: var(--primary); background: #f0f4ff; box-shadow: 0 4px 16px rgba(26,58,107,0.15); }
.type-icon { font-size: 36px; line-height: 1; }
.type-title { font-size: 16px; font-weight: 700; color: var(--primary); }
.type-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* Calendar */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 18px;
  cursor: pointer;
  color: var(--primary);
  transition: all 0.15s;
}
.nav-btn:hover { background: var(--primary); color: #fff; }
.nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
#month-label { font-weight: 600; font-size: 16px; color: var(--text); }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0 8px;
  text-transform: uppercase;
}
.cal-day {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.cal-day.available {
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
}
.cal-day.available:hover {
  background: var(--green);
  color: #fff;
  transform: scale(1.08);
}
.cal-day.available.selected {
  background: var(--primary);
  color: #fff;
  transform: scale(1.08);
}
.cal-day.unavailable { color: var(--gray); cursor: not-allowed; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.empty { }

.calendar-legend {
  display: flex; gap: 16px; margin-top: 12px;
  font-size: 12px; color: var(--text-muted);
}
.legend-item { display: flex; align-items: center; gap: 5px; }
.dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.dot.green { background: var(--green); }
.dot.gray { background: var(--border); }

/* Slots */
.selected-date-label {
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 16px;
  background: #f0f4ff;
  padding: 8px 12px;
  border-radius: 8px;
}
.slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.slot-btn {
  padding: 14px 8px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text);
  text-align: center;
}
.slot-btn.available { border-color: var(--green); color: #166534; background: #f0fdf4; }
.slot-btn.available:hover { background: var(--green); color: #fff; border-color: var(--green); transform: translateY(-1px); }
.slot-btn.available.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.slot-btn.busy { background: #f9fafb; color: var(--gray); cursor: not-allowed; border-color: var(--border); }
.slot-btn.busy::after { content: '✗'; display: block; font-size: 11px; }

/* Form */
.booking-summary {
  background: #f0f4ff;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
.form-group input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
  -webkit-appearance: none;
}
.form-group input:focus { border-color: var(--primary); }
.form-group input.error { border-color: var(--red); }

.privacy-note { margin-bottom: 20px; }
.checkbox-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13px; line-height: 1.4; }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; accent-color: var(--primary); }
.checkbox-label a { color: var(--primary); }

.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}
.btn-primary:hover { background: var(--primary-light); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,58,107,0.3); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Success */
.success-icon {
  width: 64px; height: 64px;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
}
#step-4 h2 { text-align: center; color: var(--green); }
.success-text { text-align: center; color: var(--text-muted); margin-bottom: 16px; font-size: 15px; }
.confirmation-box {
  background: #f0f4ff;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}
.email-hint { text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.action-buttons { display: flex; flex-direction: column; gap: 10px; }
.btn-secondary {
  width: 100%; padding: 14px;
  background: var(--accent);
  color: var(--text);
  border: none; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:hover { filter: brightness(0.95); }
.btn-outline {
  width: 100%; padding: 14px;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary); border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.btn-outline:hover { background: var(--primary); color: #fff; }

/* Misc */
.back-btn {
  background: none; border: none;
  color: var(--primary); font-size: 14px;
  cursor: pointer; padding: 0; margin-bottom: 12px;
  font-weight: 600;
}
.hidden { display: none !important; }
.loader { text-align: center; color: var(--text-muted); padding: 20px; font-size: 14px; }

.footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--text-muted);
}
.footer a { color: var(--primary); text-decoration: none; }

/* Toast */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #1a1a2e; color: #fff;
  padding: 12px 24px; border-radius: 24px;
  font-size: 14px; z-index: 999;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; }
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }

/* Manage page */
.manage-card { text-align: center; }
.manage-card .icon { font-size: 48px; margin-bottom: 12px; }
.manage-detail {
  background: #f0f4ff; border-radius: 10px; padding: 16px;
  margin: 16px 0; text-align: left;
}
.manage-detail .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; border-bottom: 1px solid #e0e8ff; }
.manage-detail .row:last-child { border-bottom: none; }
.manage-detail .label { color: var(--text-muted); }
.manage-detail .value { font-weight: 600; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.badge.confirmed { background: #dcfce7; color: #166534; }
.badge.cancelled { background: #fee2e2; color: #991b1b; }
.warning-box {
  background: #fff7ed; border: 1px solid #fed7aa;
  border-radius: 8px; padding: 12px; margin: 12px 0;
  font-size: 13px; color: #9a3412;
}
.btn-danger {
  width: 100%; padding: 14px;
  background: var(--red); color: #fff;
  border: none; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 8px;
}

/* Desktop uplift */
@media (min-width: 640px) {
  .app { padding: 20px 0 60px; }
  .hero { border-radius: 0 0 20px 20px; }
  .card { margin: 20px auto; max-width: 460px; }
  .slots-grid { grid-template-columns: repeat(4, 1fr); }
}
