/* ── CSS Variables (White-Label Theming) ──────────────────────────── */
:root {
  --primary:       #6366f1;
  --primary-dark:  #4f46e5;
  --primary-light: #e0e7ff;
  --accent:        #10b981;
  --accent-light:  #d1fae5;
  --bg:            #f1f5f9;
  --surface:       #ffffff;
  --border:        #e2e8f0;
  --text:          #0f172a;
  --text-muted:    #64748b;
  --error:         #ef4444;
  --error-light:   #fee2e2;
  --warning:       #f59e0b;
  --success:       #22c55e;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:        0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg:     0 20px 60px rgba(0,0,0,.10);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     20px;
  --font:          'Inter', system-ui, -apple-system, sans-serif;
  --transition:    all .2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Header ────────────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.site-header .inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.logo-img { height: 40px; width: 40px; object-fit: contain; border-radius: 8px; }
.logo-placeholder {
  width: 40px; height: 40px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 18px;
}
.logo-text h1 { font-size: 17px; font-weight: 700; line-height: 1.2; }
.logo-text p  { font-size: 12px; color: var(--text-muted); }
.header-contact { font-size: 13px; color: var(--text-muted); text-align: right; display: flex; flex-direction: column; gap: 2px; }
.header-contact a { color: var(--primary); text-decoration: none; font-weight: 500; }

/* ── Hero ──────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 56px 24px;
  text-align: center;
  color: #fff;
}
.hero h2 { font-size: 32px; font-weight: 700; margin-bottom: 10px; }
.hero p  { font-size: 16px; opacity: .85; max-width: 480px; margin: 0 auto; }

/* ── Wizard Container ──────────────────────────────────────────────── */
.wizard-wrap {
  max-width: 720px;
  margin: -40px auto 60px;
  padding: 0 16px;
}

/* ── Progress Bar ──────────────────────────────────────────────────── */
.progress-bar {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px 32px;
  margin-bottom: 4px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  position: relative;
  cursor: default;
}
.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 2px;
  background: var(--border);
  transition: background .3s;
}
.step-item.done:not(:last-child)::after { background: var(--accent); }
.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
  position: relative; z-index: 1;
}
.step-item.active .step-dot  { border-color: var(--primary); background: var(--primary); color: #fff; }
.step-item.done .step-dot    { border-color: var(--accent); background: var(--accent); color: #fff; }
.step-label { font-size: 11px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.step-item.active .step-label { color: var(--primary); }
.step-item.done .step-label   { color: var(--accent); }

/* ── Card ──────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow);
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card-title {
  font-size: 22px; font-weight: 700;
  margin-bottom: 6px;
}
.card-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }

/* ── Treatment Type Toggle ─────────────────────────────────────────── */
.type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}
.type-btn {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  cursor: pointer;
  background: var(--surface);
  transition: var(--transition);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.type-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.type-btn.selected { border-color: var(--primary); background: var(--primary-light); }
.type-btn .type-icon {
  width: 48px; height: 48px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.type-btn.selected .type-icon { background: var(--primary); }
.type-btn .type-label { font-weight: 600; font-size: 15px; }
.type-btn .type-desc  { font-size: 12px; color: var(--text-muted); }

/* ── Treatment Grid ────────────────────────────────────────────────── */
.treatment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.treatment-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; gap: 12px;
}
.treatment-card:hover    { border-color: var(--primary); background: var(--primary-light); }
.treatment-card.selected { border-color: var(--primary); background: var(--primary-light); }
.treatment-card .tc-radio {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.treatment-card.selected .tc-radio { border-color: var(--primary); background: var(--primary); }
.treatment-card.selected .tc-radio::after {
  content: ''; width: 8px; height: 8px;
  background: #fff; border-radius: 50%;
}
.treatment-card .tc-name { font-weight: 500; font-size: 14px; }
.treatment-card .tc-type { font-size: 12px; color: var(--text-muted); }

/* ── Calendar ──────────────────────────────────────────────────────── */
.calendar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cal-nav {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: var(--transition);
}
.cal-nav:hover { background: var(--primary-light); border-color: var(--primary); }
.cal-month-year { font-weight: 700; font-size: 16px; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day-header {
  text-align: center; font-size: 11px; font-weight: 600;
  color: var(--text-muted); padding: 6px 0; text-transform: uppercase;
}
.cal-day {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  position: relative;
}
.cal-day.empty    { cursor: default; }
.cal-day.disabled { color: var(--border); cursor: not-allowed; }
.cal-day.past     { color: var(--border); cursor: not-allowed; }
.cal-day.today    { font-weight: 700; }
.cal-day.today::after {
  content: ''; width: 4px; height: 4px;
  background: var(--primary);
  border-radius: 50%;
  position: absolute;
  bottom: 3px; left: 50%; transform: translateX(-50%);
}
.cal-day.has-slots:not(.disabled):not(.past) { color: var(--text); }
.cal-day.has-slots:not(.disabled):not(.past):hover { background: var(--primary-light); border-color: var(--primary); }
.cal-day.selected { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Time Slots ────────────────────────────────────────────────────── */
.slots-label { font-weight: 600; margin: 24px 0 12px; }
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}
.slot-btn {
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  font-size: 14px; font-weight: 500;
  transition: var(--transition);
}
.slot-btn:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.slot-btn.selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.slots-empty { color: var(--text-muted); font-size: 14px; padding: 20px 0; text-align: center; }

/* ── Form Fields ───────────────────────────────────────────────────── */
.form-grid { display: grid; gap: 20px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }

.field {
  display: flex; flex-direction: column; gap: 6px;
}
.field label {
  font-size: 13px; font-weight: 600; color: var(--text);
}
.field label .req { color: var(--error); margin-left: 2px; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  transition: var(--transition);
  outline: none;
  appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.field input::placeholder { color: var(--text-muted); }
.field textarea { resize: vertical; min-height: 90px; }
.field select    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; cursor: pointer; }
.field .hint { font-size: 12px; color: var(--text-muted); }
.field .err  { font-size: 12px; color: var(--error); display: none; }
.field.has-error input, .field.has-error select { border-color: var(--error); }
.field.has-error .err { display: block; }

/* ── Upload Zone ───────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-zone input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-icon { font-size: 36px; margin-bottom: 8px; }
.upload-text   { font-weight: 600; font-size: 15px; }
.upload-subtext{ font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.upload-preview {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  margin-top: 12px;
}
.upload-preview img { height: 56px; width: 56px; object-fit: cover; border-radius: 6px; }
.preview-pdf { font-size: 36px; }
.preview-info { flex: 1; text-align: left; }
.preview-name { font-weight: 600; font-size: 13px; }
.preview-size { font-size: 12px; color: var(--text-muted); }
.remove-file {
  background: none; border: none; cursor: pointer; color: var(--error); font-size: 18px; padding: 4px;
}

/* ── Summary ───────────────────────────────────────────────────────── */
.summary-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 0; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 24px;
}
.summary-row {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.summary-row:nth-child(even) { background: var(--bg); }
.summary-row:last-child, .summary-row:nth-last-child(2) { border-bottom: none; }
.summary-row .s-label { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); letter-spacing: .05em; }
.summary-row .s-value { font-size: 14px; font-weight: 500; }

.appointment-box {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex; gap: 16px; align-items: center;
}
.appt-icon { font-size: 32px; }
.appt-date  { font-size: 18px; font-weight: 700; }
.appt-time  { font-size: 14px; opacity: .85; }
.appt-treatment { font-size: 13px; opacity: .75; margin-top: 4px; }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn-row { display: flex; gap: 12px; margin-top: 28px; }
.btn-row.end { justify-content: flex-end; }

.btn {
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  transition: var(--transition);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,.35); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-success { background: var(--accent); color: #fff; }
.btn-success:hover { background: #059669; }

/* ── Success Screen ────────────────────────────────────────────────── */
.success-screen {
  text-align: center;
  padding: 20px 0;
}
.success-icon {
  width: 72px; height: 72px;
  background: var(--accent-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; margin: 0 auto 20px;
}
.success-title   { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.success-text    { color: var(--text-muted); font-size: 15px; max-width: 400px; margin: 0 auto 24px; }
.success-id      { font-size: 12px; color: var(--text-muted); margin-top: 20px; }
.success-id code { background: var(--bg); padding: 2px 8px; border-radius: 4px; font-family: monospace; }

/* ── Loading Spinner ───────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Badge ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.badge-pending   { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: var(--primary-light); color: var(--primary-dark); }
.badge-completed { background: var(--accent-light); color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }

/* ── DSGVO Consent ─────────────────────────────────────────────────── */
.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  line-height: 1.5;
}
.consent-label input[type=checkbox] {
  width: 18px !important;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--primary);
  cursor: pointer;
}
#f-consent.has-error .consent-label { color: var(--error); }
#consent-err { display: none; font-size: 12px; color: var(--error); }
#f-consent.has-error #consent-err { display: block; }

/* ── Footer ────────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 28px 24px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.site-footer a { color: var(--primary); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ── Alert ─────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  margin-bottom: 20px;
  display: flex; gap: 10px; align-items: flex-start;
}
.alert-error   { background: var(--error-light); color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: var(--accent-light); color: #065f46; border: 1px solid #6ee7b7; }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero { padding: 36px 16px; }
  .hero h2 { font-size: 22px; }
  .hero p  { font-size: 14px; }

  .wizard-wrap { margin-top: -28px; }

  .card { padding: 20px 16px; }
  .card-title { font-size: 18px; }

  .type-toggle { grid-template-columns: 1fr; }
  .treatment-grid { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }

  .progress-bar { padding: 14px 12px; gap: 0; }
  .step-label { display: none; }
  .step-dot { width: 28px; height: 28px; font-size: 12px; }

  .site-header .inner { height: 56px; }
  .logo-text h1 { font-size: 14px; }
  .header-contact { display: none; }

  .btn { padding: 11px 20px; font-size: 13px; }
  .btn-row { flex-direction: column; }
  .btn-row .btn { width: 100%; justify-content: center; }

  .appointment-box { flex-direction: column; gap: 8px; text-align: center; }

  .upload-zone { padding: 20px 16px; }

  .summary-row:nth-last-child(2) { border-bottom: 1px solid var(--border); }
}
