/* ============================================================
   GastroAudit Wizard — Styles (neuland.ai konsistent)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #ffffff;
  --section:   #f8f8f7;
  --card:      #ffffff;
  --border:    #e8e6e3;
  --primary:   #3547B8;
  --primary-h: #2a3a9e;
  --orange:    #F7AD4D;
  --purple:    #8A38F5;
  --success:   #16a34a;
  --danger:    #dc2626;
  --warn:      #fbbf24;
  --text:      #1A1817;
  --medium:    #4B4845;
  --muted:     #8A8785;
  --radius:    12px;
  --font:      "General Sans", system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 80% 20%, rgba(53,71,184,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(247,173,77,0.05) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ── HEADER ── */
.hdr {
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  z-index: 100;
}
.hdr-brand { display: flex; align-items: center; gap: 8px; }
.brand-text { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.brand-ai { color: var(--primary); }
.brand-divider { color: var(--border); font-size: 18px; }
.brand-product { font-weight: 600; color: var(--medium); font-size: 15px; }
.tagline {
  font-size: 12.5px;
  color: var(--purple);
  background: rgba(138,56,245,0.08);
  border: 1px solid rgba(138,56,245,0.2);
  border-radius: 20px;
  padding: 4px 14px;
  font-weight: 600;
}

/* ── HERO ── */
.hero {
  text-align: center;
  padding: 48px 32px 32px;
}
.hero h1 {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text);
}
.hero h1 span { color: var(--primary); }
.hero p {
  font-size: 16px;
  color: var(--medium);
  max-width: 580px;
  margin: 0 auto;
}

/* ── WRAPPER ── */
.wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* ── STAGE PROGRESS ── */
.stages-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.stage-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 8px 12px;
  background: var(--section);
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin: 0 4px;
  transition: all 0.2s;
}
.stage-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.stage-pill.done {
  background: rgba(22,163,74,0.1);
  border-color: var(--success);
  color: var(--success);
}
.pill-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.stage-pill:not(.active):not(.done) .pill-num {
  background: var(--border);
  color: var(--medium);
}
.stage-pill.done .pill-num { background: var(--success); color: #fff; }

/* ── CARDS ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(26,24,23,0.05);
  margin-bottom: 20px;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--section);
}
.card-head h2 { font-size: 17px; font-weight: 700; flex: 1; }
.card-icon { font-size: 22px; }
.demo-pill {
  font-size: 11px;
  font-weight: 600;
  background: rgba(247,173,77,0.12);
  color: #92400e;
  border: 1px solid rgba(247,173,77,0.4);
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.card-body { padding: 22px; }
.card-intro { color: var(--medium); margin-bottom: 18px; }

/* ── DATA-GRID (Stammdaten) ── */
.data-grid { display: grid; grid-template-columns: 1fr; gap: 0; margin-bottom: 18px; }
.data-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.data-row:last-child { border-bottom: none; }
.data-label { width: 200px; color: var(--muted); font-size: 13px; font-weight: 600; flex-shrink: 0; }
.data-val { flex: 1; font-size: 14px; }
.data-val.warn { color: var(--danger); font-weight: 500; }

/* ── UPLOAD-MOCK ── */
.upload-mock {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--section);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  margin: 18px 0;
}
.upload-icon { font-size: 24px; }
.upload-text { font-size: 14px; line-height: 1.5; }
.upload-text code { background: #fff; padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.upload-hint { color: var(--muted); font-size: 13px; }

/* ── KPI GRID ── */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; margin: 18px 0; }
@media (max-width: 720px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }
.kpi {
  background: var(--section);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); font-weight: 600; }
.kpi-val { font-size: 22px; font-weight: 800; color: var(--primary); display: block; margin-top: 6px; letter-spacing: -0.5px; }

/* ── VENDOR LIST ── */
.vendor-list { margin: 14px 0; }
.vendor {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.vendor:last-child { border-bottom: none; }
.vendor-name { font-weight: 600; }
.vendor-count { color: var(--medium); font-size: 13.5px; }
.vendor-sum { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── BUTTONS ── */
.btn-primary, .btn-secondary, .btn-audit {
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.15s;
  font-family: var(--font);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-h); border-color: var(--primary-h); }
.btn-secondary { background: var(--section); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #eeece9; }
.btn-audit {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  border-color: transparent;
  font-size: 15px;
  padding: 14px 28px;
  font-weight: 700;
}
.btn-audit:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(53,71,184,0.3); }
.btn-audit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.row-buttons { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }

/* ── PIPELINE ── */
.pipeline-card .card-head { background: linear-gradient(135deg, rgba(53,71,184,0.04), rgba(138,56,245,0.04)); }
.pipeline-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  position: relative;
  margin: 8px 0 24px;
}
.pipe-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 1;
}
.pipe-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px; left: 50%;
  width: 100%; height: 2px;
  background: var(--border);
  z-index: 0;
  transition: background 0.4s;
}
.pipe-step.done:not(:last-child)::after { background: var(--success); }
.pipe-step.active:not(:last-child)::after {
  background: linear-gradient(90deg, var(--success), var(--border));
}
.pipe-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--section);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  color: var(--muted);
  z-index: 2;
  position: relative;
  transition: all 0.3s;
}
.pipe-step.active .pipe-num {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  animation: pulseNum 1.2s ease-in-out infinite;
}
.pipe-step.done .pipe-num {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.pipe-step.done .pipe-num::before { content: '✓'; }
.pipe-step.done .pipe-num span { display: none; }
@keyframes pulseNum {
  0%, 100% { box-shadow: 0 0 0 0 rgba(53,71,184,0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(53,71,184,0); }
}
.pipe-label {
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--medium);
  max-width: 100px;
}
.pipe-step.active .pipe-label { color: var(--primary); }

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin: 4px 0 22px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  width: 0%;
  transition: width 0.4s ease-out;
}

/* ── KB STREAM ── */
.kb-stream {
  background: linear-gradient(135deg, rgba(53,71,184,0.04), rgba(247,173,77,0.04));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px 24px;
  min-height: 100px;
}
.kb-snippet {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
  opacity: 0;
  transition: opacity 0.35s;
}
.kb-snippet.kb-active { opacity: 1; }
.kb-snippet .kb-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--purple);
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  margin-right: 8px;
  vertical-align: middle;
}
.kb-snippet code {
  background: #fff;
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12.5px;
}

/* ── REPORT FRAME ── */
.report-wrap { display: block; }
.report-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.report-frame {
  width: 100%;
  height: 1200px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 4px 16px rgba(26,24,23,0.06);
}

/* ── AUDIT STATUS BAR (über dem iframe) ── */
.audit-status {
  background: var(--section, #f8f8f7);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 14px;
}
.audit-status-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) { .audit-status-row { grid-template-columns: 1fr 1fr;} }
.audit-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.audit-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
}
.audit-stat-val {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text);
}
.audit-stat-val.critical { color: #ef4444; }
.audit-coverage-bar {
  margin-top: 6px;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.audit-coverage-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary, #3547B8), var(--orange, #F7AD4D));
  width: 0%;
  transition: width 0.4s ease-out;
}
.audit-coverage-bar.low .audit-coverage-fill { background: #6366f1; }

.audit-ampel {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.audit-ampel-rot   { background: #fee2e2; border-color: #ef4444; color: #991b1b; }
.audit-ampel-gelb  { background: #fef3c7; border-color: #fbbf24; color: #92400e; }
.audit-ampel-gruen { background: #d1fae5; border-color: #10b981; color: #065f46; }
.audit-ampel-ungepruft { background: #e0e7ff; border-color: #6366f1; color: #3730a3; }
.audit-ampel-blank { background: #f3f4f6; border-color: #d1d5db; color: #6b7280; }

.audit-status-note {
  margin-top: 12px;
  padding: 10px 14px;
  background: #e0e7ff;
  border: 1px solid #6366f1;
  border-radius: 8px;
  font-size: 13.5px;
  color: #3730a3;
  line-height: 1.5;
}
.audit-status-note strong { color: #1e1b4b; }

/* ── FOOTER ── */
.ftr {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
