/* ══════════════════════════════════════════════════════════════════════════
   Kunden-Portal — Voice-First-Reklamationserfassung
   Mobile-first, große Touch-Targets, freundliche UX
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  --c-primary: #00a7b7;
  --c-primary-dark: #008b9a;
  --c-primary-darker: #006b76;
  --c-primary-light: #cdf0f3;
  --c-primary-lighter: #e6f7f9;
  --c-primary-soft: rgba(0, 167, 183, 0.10);
  --c-bg: #f6f8f9;
  --c-card: #ffffff;
  --c-border: #e6ebee;
  --c-text: #0f1f23;
  --c-text-muted: #6b7a80;
  --c-success: #10b981;
  --c-success-light: #d1fae5;
  --c-warning: #f59e0b;
  --c-error: #ef4444;
  --c-error-light: #fee2e2;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(15, 31, 35, 0.04), 0 1px 3px rgba(15, 31, 35, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 31, 35, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 107, 118, 0.18);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--c-bg); color: var(--c-text); font-family: var(--font); -webkit-font-smoothing: antialiased; line-height: 1.5; }

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

/* ── Kopfzeile mit Progress ────────────────────────────────────────────── */
.portal-header {
  background: white;
  border-bottom: 1px solid var(--c-border);
  padding: 14px 20px;
}
.portal-header .brand {
  font-size: 13px;
  color: var(--c-text-muted);
  margin-bottom: 10px;
}
.portal-header .brand strong { color: var(--c-text); }

.progress-label {
  font-size: 12px; color: var(--c-primary-darker);
  font-weight: 600; letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.progress-bar {
  display: flex;
  gap: 6px;
}
.progress-bar .dot {
  flex: 1;
  height: 4px;
  background: var(--c-border);
  border-radius: 2px;
  transition: background 0.3s;
}
.progress-bar .dot.active {
  background: var(--c-primary);
}
.progress-bar .dot.done {
  background: var(--c-success);
}

/* ── Haupt-Container ───────────────────────────────────────────────────── */
.portal-main {
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  padding: 32px 20px 48px;
}

.step {
  display: none;
  animation: fadeIn 0.3s ease-out;
}
.step.active { display: block; }

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

.step h1 {
  font-size: 28px;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.step .subtitle {
  color: var(--c-text-muted);
  font-size: 16px;
  margin: 0 0 24px;
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.info-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.info-card h2 { margin: 0 0 8px; font-size: 16px; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.info-card p { margin: 0; font-size: 16px; }

.hinweis-liste {
  background: var(--c-primary-light);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 15px;
}
.hinweis-liste ol { margin: 8px 0 0; padding-left: 20px; }
.hinweis-liste li { margin-bottom: 4px; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  border-radius: var(--radius);
  border: none;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 56px;
  text-decoration: none;
}
.btn-primary { background: var(--c-primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--c-primary-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: white;
  color: var(--c-text);
  border: 1px solid var(--c-border);
}
.btn-secondary:hover { border-color: var(--c-primary); color: var(--c-primary); }

.btn-ghost {
  background: transparent;
  color: var(--c-text-muted);
  padding: 12px 16px;
  min-height: 44px;
  font-weight: 500;
}
.btn-ghost:hover { color: var(--c-text); }

.btn-block { width: 100%; }

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.btn-row .btn { flex: 1; min-width: 140px; }

/* ── Voice-Recorder ────────────────────────────────────────────────────── */
.recorder {
  text-align: center;
  padding: 24px 0;
}
.mic-button {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: none;
  background: var(--c-primary);
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: var(--shadow-lg);
}
.mic-button:hover:not(:disabled) {
  transform: scale(1.05);
  background: var(--c-primary-dark);
}
.mic-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.mic-button.recording {
  background: var(--c-error);
  animation: pulse 1.4s infinite;
}
.mic-button.recording::before {
  content: '';
  position: absolute;
  inset: -8px;
  border: 3px solid var(--c-error);
  border-radius: 50%;
  animation: pulseRing 1.4s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
}
@keyframes pulseRing {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}
.mic-button svg { width: 48px; height: 48px; }

.recorder-status {
  margin-top: 16px;
  font-size: 17px;
  font-weight: 500;
  min-height: 24px;
}
.recorder-timer {
  margin-top: 4px;
  color: var(--c-text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}

/* ── Transkript-Editor ─────────────────────────────────────────────────── */
.transkript-box {
  margin-top: 24px;
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px;
}
.transkript-box label {
  display: block;
  font-size: 13px;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.transkript-box textarea {
  width: 100%;
  min-height: 96px;
  border: none;
  outline: none;
  resize: vertical;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--c-text);
  background: transparent;
}

/* ── Rueckfrage-Bubble ─────────────────────────────────────────────────── */
.rueckfrage {
  background: var(--c-primary-light);
  border-radius: var(--radius-lg);
  border-top-left-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 17px;
}
.rueckfrage-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

/* ── Foto-Upload ───────────────────────────────────────────────────────── */
.foto-upload {
  border: 2px dashed var(--c-border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 16px;
}
.foto-upload:hover {
  border-color: var(--c-primary);
  background: var(--c-primary-light);
}
.foto-upload input { display: none; }
.foto-upload .icon { font-size: 32px; margin-bottom: 8px; }
.foto-upload .text { color: var(--c-text-muted); font-size: 15px; }

.foto-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.foto-preview {
  position: relative;
  aspect-ratio: 1;
  background: var(--c-bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--c-border);
}
.foto-preview img { width: 100%; height: 100%; object-fit: cover; }
.foto-preview button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* ── Zusammenfassung & Bestaetigung ────────────────────────────────────── */
.summary {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.summary dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; }
.summary dt { color: var(--c-text-muted); font-size: 14px; }
.summary dd { margin: 0; font-size: 15px; font-weight: 500; }
.summary dd.prio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.prio-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--c-text-muted);
}
.prio-1 { background: #94a3b8; }
.prio-2 { background: #64748b; }
.prio-3 { background: #f59e0b; }
.prio-4 { background: #ef4444; }
.prio-5 { background: #dc2626; }

.erfolg {
  text-align: center;
  padding: 48px 20px 32px;
}
.erfolg .icon {
  width: 88px; height: 88px;
  background: var(--c-success-light);
  color: var(--c-success);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  animation: pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.erfolg .icon svg { width: 44px; height: 44px; }
.erfolg h1 { font-size: 28px; margin-bottom: 8px; letter-spacing: -0.01em; }
.erfolg .subtitle { color: var(--c-text-muted); margin: 0 0 20px; font-size: 16px; }
.erfolg .referenz {
  display: inline-block;
  margin: 8px 0 16px;
  padding: 14px 24px;
  background: var(--c-primary-light);
  border-radius: var(--radius);
  font-size: 22px;
  font-weight: 700;
  color: var(--c-primary-darker);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.erfolg .sla-hinweis {
  color: var(--c-text-muted);
  font-size: 15px;
  margin-top: 0;
  line-height: 1.5;
}

/* ── Laden / Spinner ───────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.lade-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.lade-overlay.show { display: flex; }
.lade-overlay .lade-box {
  background: white;
  border-radius: var(--radius);
  padding: 24px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-lg);
}
.lade-overlay .spinner { width: 32px; height: 32px; }

/* ── Fehler-Banner ─────────────────────────────────────────────────────── */
.fehler-banner {
  background: var(--c-error-light);
  color: var(--c-error);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}
.fehler-banner.hidden { display: none; }

/* ── Mobile Anpassungen ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .portal-main { padding: 20px 16px 32px; }
  .step h1 { font-size: 24px; }
  .mic-button { width: 96px; height: 96px; }
  .mic-button svg { width: 40px; height: 40px; }
}
