/* ==========================================================================
   DENKCODE FUNNEL & KONFIGURATOR (endlichkunden Style)
   Optimiert für 100dvh – Kein Scrollen auf mobilen Geräten
   Angeschrägte A/B/C/D Buttons, Icons, High-Conversion Quiz Design
   ========================================================================== */

:root {
  --wa-bg: #f4f6fc;
  --wa-surface: #ffffff;
  --wa-heading: #03183b;
  --wa-text: #1e293b;
  --wa-muted: #5a6578;
  --wa-line: #dbe3f0;
  --wa-line-strong: #c7d3e6;
  --wa-accent: #0b438f;
  --wa-accent-hover: #062d63;
  --wa-accent-soft: #2563eb;
  --wa-accent-wash: #eff6ff;
  --wa-shadow: 0 10px 30px -5px rgba(3, 24, 59, 0.08), 0 4px 12px -2px rgba(3, 24, 59, 0.04);
  --wa-skew: -7deg;
  --wa-unskew: 7deg;
}

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

html, body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--wa-bg);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--wa-text);
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
}

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

/* Header Bar */
.wa-header {
  flex-shrink: 0;
  height: 52px;
  background: var(--wa-surface);
  border-bottom: 1px solid var(--wa-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(0.75rem, 3vw, 2rem);
  z-index: 10;
}

.wa-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  cursor: default;
  user-select: none;
}

.wa-brand img {
  height: 22px;
  width: auto;
  display: block;
}

.wa-brand-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wa-accent);
  background: var(--wa-accent-wash);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid #bfdbfe;
}

.wa-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wa-back-btn {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--wa-muted);
  background: transparent;
  border: 1px solid var(--wa-line);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.wa-back-btn:hover {
  color: var(--wa-heading);
  background: #eef2f9;
}

.wa-back-btn[hidden] {
  display: none !important;
}

.wa-close-btn {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--wa-muted);
  background: transparent;
  border: 1px solid var(--wa-line);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.wa-close-btn:hover {
  color: var(--wa-heading);
  background: #eef2f9;
}

.wa-step-counter {
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: baseline;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.wa-step-cur {
  color: var(--wa-accent);
}

.wa-step-sep {
  color: var(--wa-muted);
  margin: 0 0.2rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.wa-step-total {
  color: var(--wa-heading);
}

/* Slim Top Progress Bar */
.wa-bar {
  height: 4px;
  width: 100%;
  background: var(--wa-line);
  overflow: hidden;
  flex-shrink: 0;
}

.wa-bar__fill {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, #0b438f, #2563eb);
  transition: width 220ms ease;
}

/* Main Container (Screen-Fit, vertically centered) */
.wa-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.85rem 0.85rem;
  overflow: hidden;
  min-height: 0;
}

.wa-container {
  width: 100%;
  max-width: 620px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
}

.wa-form {
  background: var(--wa-surface);
  border: 1px solid var(--wa-line);
  border-radius: 12px;
  box-shadow: var(--wa-shadow);
  padding: clamp(0.75rem, 2.5vw, 1.4rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 100%;
}

.wa-alert {
  padding: 0.5rem 0.75rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 8px;
  font-size: 0.8125rem;
  margin-bottom: 0.6rem;
  flex-shrink: 0;
}

/* Step Layout */
.wa-step {
  display: flex;
  flex-direction: column;
  border: 0;
  min-width: 0;
  overflow: hidden;
  flex: 1;
}

.wa-step[hidden] {
  display: none !important;
}

.wa-step-intro {
  margin-bottom: 0.45rem;
  flex-shrink: 0;
}

.wa-eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wa-accent);
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.wa-eyebrow-chev {
  font-size: 0.85rem;
}

.wa-title {
  font-size: clamp(1.2rem, 3.2vw, 1.6rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--wa-heading);
  margin: 0;
}

.wa-legend {
  font-size: clamp(0.875rem, 2vw, 1rem);
  font-weight: 600;
  color: var(--wa-muted);
  margin-bottom: 0.65rem;
  padding: 0;
  flex-shrink: 0;
}

/* Angeschrägte Optionen im Quiz / A-B-C-D Style */
.wa-options {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 6px 4px 4px;
  flex: 1;
}

.wa-option {
  position: relative;
  display: block;
  background: #ffffff;
  border: 1px solid var(--wa-line-strong);
  border-radius: 6px;
  cursor: pointer;
  transform: skewX(var(--wa-skew));
  box-shadow: 0 2px 6px rgba(17, 24, 39, 0.03);
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
  user-select: none;
  flex-shrink: 0;
}

.wa-option:hover {
  border-color: var(--wa-accent);
  background: #f8fafd;
  box-shadow: 0 4px 12px rgba(11, 67, 143, 0.08);
}

.wa-option:has(input:checked) {
  border-color: var(--wa-accent);
  background: #eff6ff;
  box-shadow: 0 0 0 2px var(--wa-accent);
}

.wa-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.wa-opt-in {
  transform: skewX(var(--wa-unskew));
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.85rem 0.5rem 0.65rem;
  min-height: 44px;
}

/* Key Box (A, B, C, D) */
.wa-key {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #03183b;
  background: #eef2f9;
  border: 1px solid var(--wa-line-strong);
  border-radius: 4px;
  flex-shrink: 0;
}

.wa-option:has(input:checked) .wa-key {
  background: var(--wa-accent);
  color: #ffffff;
  border-color: var(--wa-accent);
}

/* Icon */
.wa-icon {
  width: 20px;
  height: 20px;
  color: var(--wa-accent);
  flex-shrink: 0;
}

.wa-opt-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.25;
  min-width: 0;
  flex: 1;
}

.wa-opt-text strong {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--wa-heading);
}

.wa-opt-text small {
  font-size: 0.72rem;
  color: var(--wa-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Checkmark on right of quiz option */
.wa-opt-check {
  width: 18px;
  height: 18px;
  color: var(--wa-accent);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 160ms ease, transform 160ms ease;
  flex-shrink: 0;
}

.wa-option:has(input:checked) .wa-opt-check {
  opacity: 1;
  transform: scale(1);
}

/* Schritt 5 Kontaktdaten */
.wa-contact-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.wa-field-full {
  grid-column: 1 / -1;
}

.wa-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--wa-heading);
  margin-bottom: 0.2rem;
}

.wa-field input,
.wa-field textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--wa-heading);
  background: #ffffff;
  border: 1px solid var(--wa-line-strong);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.03);
}

.wa-field input:focus,
.wa-field textarea:focus {
  outline: none;
  border-color: var(--wa-accent);
  box-shadow: 0 0 0 3px rgba(11, 67, 143, 0.15);
}

.wa-field textarea {
  min-height: 52px;
  resize: vertical;
}

.wa-muted-tag {
  font-weight: normal;
  color: var(--wa-muted);
}

.wa-privacy {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--wa-muted);
  cursor: pointer;
  margin-bottom: 0.35rem;
}

.wa-privacy input {
  margin-top: 0.12rem;
  accent-color: var(--wa-accent);
  flex-shrink: 0;
}

.wa-privacy a {
  color: var(--wa-accent);
  text-decoration: underline;
}

/* Action & Buttons */
.wa-nav {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--wa-line);
  flex-shrink: 0;
}

.wa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.65rem 1.25rem;
  min-height: 44px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  text-decoration: none;
}

.wa-btn--primary {
  background: linear-gradient(135deg, #0b438f 0%, #062d63 100%);
  color: #ffffff;
  flex: 1;
  box-shadow: 0 4px 14px rgba(11, 67, 143, 0.35);
}

.wa-btn--primary:hover {
  background: linear-gradient(135deg, #083674 0%, #041f45 100%);
  box-shadow: 0 6px 18px rgba(11, 67, 143, 0.45);
}

.wa-btn--ghost {
  background: transparent;
  color: var(--wa-muted);
  border: 1px solid var(--wa-line-strong);
}

.wa-btn--ghost:hover {
  color: var(--wa-heading);
  background: #eef2f9;
}

.wa-micro {
  font-size: 0.7rem;
  color: var(--wa-muted);
  text-align: center;
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.wa-honeypot {
  display: none !important;
  position: absolute;
  left: -9999px;
}

/* Responsive Anpassungen für mobile Displays */
@media (max-width: 480px) {
  .wa-header {
    padding: 0 0.65rem;
  }
  .wa-brand img {
    height: 19px;
  }
  .wa-brand-tag {
    display: none !important;
  }
  .wa-header-right {
    gap: 0.35rem;
  }
  .wa-back-btn,
  .wa-close-btn {
    padding: 0.22rem 0.45rem;
    font-size: 0.72rem;
  }
  .wa-step-counter {
    font-size: 0.9rem;
  }
  .wa-main {
    padding: 0.35rem 0.5rem 0.5rem;
  }
  .wa-form {
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
  }
  .wa-title {
    font-size: 1.15rem;
  }
  .wa-legend {
    font-size: 0.85rem;
    margin-bottom: 0.45rem;
  }
  .wa-options {
    gap: 0.35rem;
  }
  .wa-opt-in {
    padding: 0.4rem 0.65rem 0.4rem 0.5rem;
    min-height: 40px;
    gap: 0.5rem;
  }
  .wa-key {
    width: 25px;
    height: 25px;
    font-size: 0.75rem;
  }
  .wa-icon {
    width: 18px;
    height: 18px;
  }
  .wa-opt-text strong {
    font-size: 0.8125rem;
  }
  .wa-opt-text small {
    font-size: 0.6875rem;
  }
  .wa-contact-fields {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .wa-field input {
    font-size: 16px; /* iOS Safari Zoom prevention */
    padding: 0.4rem 0.55rem;
  }
  .wa-field textarea {
    font-size: 16px;
    min-height: 48px;
  }
}

@media (max-height: 720px) {
  .wa-header {
    height: 46px;
  }
  .wa-form {
    padding: 0.5rem 0.65rem;
  }
  .wa-title {
    font-size: 1rem;
  }
  .wa-legend {
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
  }
  .wa-options {
    gap: 0.28rem;
  }
  .wa-opt-in {
    padding: 0.3rem 0.5rem;
    min-height: 36px;
  }
  .wa-btn {
    min-height: 38px;
  }
}
