/**
 * MyInvest24 Funnel Core CSS
 * Gemeinsame Basis-Styles fuer alle Funnels.
 * Wird als <link> eingebunden, inline-Styles in den HTMLs
 * ueberschreiben bei Bedarf (Spezifitaet).
 */

:root {
  --primary: #0f172a;
  --primary-light: #1e293b;
  --accent: #0369a1;
  --accent-light: #0284c7;
  --accent-dark: #075985;
  --accent-glow: rgba(3, 105, 161, 0.15);
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-500: #475569;
  --gray-600: #475569;
  --success: #10b981;
  --warning: #f59e0b;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Scroll-Fix: scroll-margin/padding auf 0 in Funnels */
html:has(.funnel-main) {
  scroll-behavior: auto;
  scroll-padding-top: 0 !important;
  scroll-padding-bottom: 0 !important;
}

html:has(.funnel-main) .funnel-main *,
html:has(.funnel-main) .funnel-main [id],
body:has(.funnel-main) input,
body:has(.funnel-main) select,
body:has(.funnel-main) textarea,
body:has(.funnel-main) button,
body:has(.funnel-main) label {
  scroll-margin: 0 !important;
  scroll-margin-top: 0 !important;
  scroll-margin-bottom: 0 !important;
}

/* Header */
.funnel-header {
  padding: 10px 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.funnel-header img {
  height: 28px;
  width: auto;
}

@media (min-width: 600px) {
  .funnel-header {
    padding: 24px 24px 0;
  }
  .funnel-header img {
    height: 30px;
  }
}

/* Advisor */
.funnel-advisor {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.funnel-advisor img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.funnel-advisor__name {
  font-weight: 700;
  font-size: 14px;
  color: var(--primary);
}

.funnel-advisor__role {
  font-size: 12px;
  color: var(--gray-500);
}

/* Progress */
.funnel-progress {
  padding: 0 20px;
  margin: 8px 0 0;
}

.funnel-progress-bar {
  height: 4px;
  background: var(--gray-100);
  border-radius: 2px;
  overflow: hidden;
}

.funnel-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.funnel-progress-text {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 6px;
  text-align: right;
  font-weight: 500;
}

/* Steps */
.funnel-step {
  display: none;
  padding: 4px 20px 40px;
}

.funnel-step.active {
  display: flex;
  flex-direction: column;
  animation: stepFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (min-width: 600px) {
  .funnel-step {
    padding: 24px 32px 36px;
  }
}

@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Step 5 (Contact): no transform to avoid breaking position:fixed */
#step5.funnel-step.active {
  animation: funnelStepFadeInContact 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes funnelStepFadeInContact {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Step title */
.funnel-step__title {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
  line-height: 1.2;
}

.funnel-step__subtitle {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 16px;
}

/* Form */
.funnel-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.funnel-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.funnel-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

.funnel-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  background: var(--gray-50);
  color: var(--primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.funnel-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.08);
}

/* Phone input group */
.phone-input-group {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.phone-input-group:focus-within {
  border-color: var(--accent);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.08);
}

.phone-prefix {
  padding: 12px 0 12px 14px;
  font-weight: 600;
  color: var(--gray-500);
  white-space: nowrap;
  user-select: none;
}

.phone-input {
  border: none !important;
  background: transparent !important;
  flex: 1;
  min-width: 0;
  padding-left: 12px !important;
}

.phone-input:focus {
  box-shadow: none !important;
}

/* Submit button */
.funnel-submit {
  width: 100%;
  padding: 14px 24px;
  background: var(--primary);
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s, transform 0.15s;
  font-family: inherit;
}

.funnel-submit:active {
  transform: scale(0.98);
}

.funnel-submit svg {
  width: 20px;
  height: 20px;
}

/* Focus-visible */
.funnel-option:focus-visible,
.funnel-intro-btn:focus-visible,
.funnel-back-btn:focus-visible,
.funnel-submit:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.funnel-option:focus:not(:focus-visible) {
  outline: none;
}

/* Trust footer */
.funnel-trust {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 12px 16px;
  flex-wrap: wrap;
}

.funnel-trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .funnel-step.active,
  .funnel-step.exiting {
    animation: none !important;
  }
}

/* Mobile form single column */
@media (max-width: 600px) {
  .funnel-form-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

/* iOS: prevent zoom on focus */
@media (max-width: 1023px) {
  body.funnel-step-contact .funnel-input,
  body.funnel-step-contact .phone-input-group {
    font-size: 16px !important;
  }
}
