/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ============================================================
   BEAMTEN-KV FUNNEL — style.css
   Design: Apple + Heyflow — clean, premium, edel
   ============================================================ */

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

:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-shadow: rgba(37, 99, 235, 0.20);

  --text-dark: #0f172a;
  --text-medium: #334155;
  --text-light: #64748b;
  --text-muted: #94a3b8;

  --bg-page: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f8fafc;

  --border: #e2e8f0;
  --border-focus: #2563eb;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-blue: 0 4px 14px rgba(37, 99, 235, 0.22);

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-med: 250ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Legacy compat aliases */
  --primary: #0f172a;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --bg: #ffffff;
  --white: #ffffff;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-800: #0f172a;
  --text: #0f172a;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  --radius: 14px;
  --transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: 'cv02','cv03','cv04','cv11';
  background: var(--bg-page);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* === FUNNEL CONTAINER === */
.funnel-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

/* === PROFILE PHOTO === */
.profile-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--border);
  flex-shrink: 0;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* === PROGRESS BAR (Heyflow-Style Segmente) === */
.progress-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 36px;
  width: 100%;
  max-width: 280px;
}

.progress-segment {
  flex: 1;
  height: 3px;
  border-radius: 9999px;
  background: var(--border);
  transition: background var(--transition-med);
}

.progress-segment.done,
.progress-segment.active {
  background: var(--primary-color);
}

/* Legacy: progress-dots still styled (fallback) */
.progress-dots {
  display: flex;
  gap: 4px;
  margin-bottom: 36px;
  width: 100%;
  max-width: 280px;
}

.dot {
  flex: 1;
  height: 3px;
  border-radius: 9999px;
  background: var(--border);
  transition: background var(--transition-med);
}

.dot.active,
.dot.done {
  background: var(--primary-color);
}

/* === STEPS === */
.step {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.step.active {
  display: flex;
}

/* === SLIDE ANIMATIONS === */
.slide-enter-right {
  animation: slideInRight 280ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.slide-enter-left {
  animation: slideInLeft 280ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.slide-exit-left {
  animation: slideOutLeft 280ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.slide-exit-right {
  animation: slideOutRight 280ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-32px); }
}
@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(32px); }
}

/* Legacy fade (used nowhere active now) */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === HEADLINE (außerhalb Card, Step 1) === */
.step-headline {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.step-subline {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 4px;
  line-height: 1.6;
}

.step-subline + .step-subline {
  margin-bottom: 24px;
}

/* === CARD === */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  width: 100%;
  position: relative;
}

/* === BACK BUTTON === */
.back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 0;
  margin-bottom: 20px;
  transition: color var(--transition-fast);
  align-self: flex-start;
  line-height: 1;
}

.back-btn:hover { color: var(--text-dark); }
.back-btn svg { width: 20px; height: 20px; }

/* === CARD TYPOGRAPHY === */
.card-question {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.card-subtext {
  font-size: 0.9375rem;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.6;
}

.card-badge {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
  letter-spacing: 0.01em;
}

/* === CHOICE CARDS === */
.choices {
  display: grid;
  gap: 10px;
  width: 100%;
}

.choices.two-col {
  grid-template-columns: 1fr 1fr;
}

.choices.three-col {
  grid-template-columns: 1fr 1fr;
}

.choices.list {
  grid-template-columns: 1fr;
}

.choice-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  cursor: pointer;
  transition: border-color var(--transition-fast),
              background var(--transition-fast),
              box-shadow var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.choice-card:hover {
  border-color: var(--primary-color);
  background: var(--primary-light);
}

.choice-card.selected {
  border-color: var(--primary-color);
  border-width: 2px;
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.choice-card:active {
  transform: scale(0.97);
  transition: transform 80ms;
}

.choice-card .emoji {
  font-size: 2rem;
  line-height: 1;
}

.choice-card .label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  text-align: center;
  line-height: 1.35;
}

/* List-Style (1 Spalte) */
.choices.list .choice-card {
  flex-direction: row;
  justify-content: flex-start;
  padding: 16px 20px;
  gap: 14px;
}

.choices.list .choice-card .emoji {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.choices.list .choice-card .label {
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: left;
}

/* === FORM === */
.form-group {
  width: 100%;
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-medium);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--bg-input);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-group input:focus {
  border-color: var(--border-focus);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.form-group input.error {
  border-color: #ef4444;
}

.form-group .error-msg {
  font-size: 0.78rem;
  color: #ef4444;
  margin-top: 4px;
  display: none;
}

.form-group .error-msg.visible {
  display: block;
}

/* === CTA / SUBMIT BUTTON (primary) === */
.btn-primary,
.submit-btn {
  width: 100%;
  padding: 16px 24px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background var(--transition-fast),
              box-shadow var(--transition-fast),
              transform 80ms;
  box-shadow: var(--shadow-blue);
  -webkit-tap-highlight-color: transparent;
  margin-top: 6px;
}

.btn-primary:hover,
.submit-btn:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.30);
}

.btn-primary:active,
.submit-btn:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-blue);
}

.btn-primary:disabled,
.submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.form-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
}

/* === SPINNER (inside submit button) === */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

/* === SUBMIT ERROR BANNER === */
.submit-error-banner {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.875rem;
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.4;
}

/* === END SCREENS === */
.end-screen {
  text-align: center;
  padding: 12px 0;
}

.end-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
  display: block;
}

.end-headline {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.end-text {
  font-size: 0.9375rem;
  color: var(--text-light);
  line-height: 1.6;
  max-width: 340px;
  margin: 0 auto;
}

/* === TRUST FOOTER === */
.trust-footer {
  text-align: center;
  padding: 0 20px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.trust-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.trust-footer a:hover {
  color: var(--text-light);
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
  .funnel-container {
    padding: 28px 16px 60px;
  }

  .card {
    padding: 24px 20px;
    border-radius: var(--radius-lg);
  }

  .step-headline {
    font-size: 1.625rem;
  }

  .card-question {
    font-size: 1.1rem;
  }

  .choice-card .emoji {
    font-size: 1.75rem;
  }

  .profile-photo {
    width: 64px;
    height: 64px;
  }
}

@media (min-width: 481px) {
  .step-headline {
    font-size: 2.375rem;
  }
}
