/* ═══════════════════════════════════════════════════════════
   D2D FORMULAR STYLES
   Optimiert für Tablet & Smartphone an der Haustür
   ═══════════════════════════════════════════════════════════ */

/* HERO SECTION */
.d2d-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  padding: 60px 0 40px;
}

.d2d-head {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px;
}

.d2d-head h1 {
  margin-bottom: 16px;
  font-size: clamp(32px, 5vw, 52px);
  color: var(--white);
}

.d2d-head p {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 60ch;
  margin: 0 auto;
}

/* FORTSCHRITTSANZEIGE */
.progress-container {
  max-width: 800px;
  margin: 0 auto;
}

.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.progress-step {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 18px;
  transition: all 0.3s ease;
}

.progress-step.active {
  background: #4CAF50;
  color: var(--white);
  transform: scale(1.1);
}

/* FORMULAR SECTION */
.d2d-section {
  padding: 60px 0;
  background: var(--surface-soft);
}

.d2d-form {
  max-width: 900px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

/* FORM SCHRITTE */
.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

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

.step-header {
  margin-bottom: 32px;
  text-align: center;
}

.step-label {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary-light);
  margin-bottom: 12px;
}

.step-header h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  color: var(--text);
}

.step-intro {
  margin: 12px auto 0;
  max-width: 60ch;
  color: var(--text-muted);
  text-align: center;
}

/* BUTTON GRIDS */
.button-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.button-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.button-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

/* OPTION BUTTONS */
.option-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 20px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  min-height: 100px;
}

.option-btn:hover {
  background: var(--surface-soft);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.option-btn.selected {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  border-color: var(--primary);
}

.option-btn.selected .option-icon {
  filter: brightness(0) invert(1);
}

.option-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.option-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.option-text strong {
  font-family: 'Manrope', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.option-text small {
  font-size: 14px;
  opacity: 0.8;
}

/* KLEINE OPTION BUTTONS */
.option-btn-sm {
  padding: 16px 12px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.option-btn-sm:hover {
  background: var(--surface-soft);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.option-btn-sm.selected {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  border-color: var(--primary);
}

.option-btn-full {
  width: 100%;
  padding: 16px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 15px;
  text-align: center;
}

.option-btn-full:hover {
  background: var(--surface-soft);
  border-color: var(--primary-light);
}

.option-btn-full.selected {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* FORM GRUPPEN */
.form-group {
  margin-bottom: 28px;
}

.form-group label {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--text);
}

.form-group label.required::after {
  content: '*';
  color: #e53935;
  margin-left: 4px;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"] {
  width: 100%;
  padding: 16px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 18px;
  transition: border-color 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

/* INPUT MIT BUTTONS */
.input-with-voice,
.input-with-gps {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.voice-btn,
.gps-btn {
  padding: 16px 20px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 20px;
  white-space: nowrap;
}

.voice-btn:hover,
.gps-btn:hover {
  background: var(--surface-soft);
  border-color: var(--primary-light);
}

.gps-btn {
  font-size: 15px;
  font-weight: 600;
  font-family: 'Manrope', sans-serif;
}

/* HINWEISE */
.hint {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
  margin-bottom: 0;
}

/* ZUSAMMENFASSUNG */
.lead-summary {
  margin-bottom: 28px;
  padding: 24px;
  border: 2px solid #b7e4c7;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f0fff4, #e8f8ed);
}

.lead-summary h3 {
  margin: 0 0 18px;
  color: var(--primary);
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
}

.lead-summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 0;
}

.lead-summary-list > div {
  padding: 12px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
}

.lead-summary-list dt {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lead-summary-list dd {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.summary-note {
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* PRIVACY BOX */
.privacy-box {
  background: linear-gradient(135deg, #f5f9ff, #e8f4ff);
  border: 2px solid #bbdefb;
  border-radius: var(--radius-sm);
  padding: 24px;
  margin-bottom: 24px;
}

.privacy-box h3 {
  margin: 0 0 16px;
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  color: var(--primary);
}

.privacy-box p {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
}

.privacy-box ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.privacy-box ul li {
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--text);
}

.privacy-box a {
  color: var(--primary);
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* CHECKBOX */
.checkbox-group {
  margin-bottom: 32px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.marketing-box {
  margin: -8px 0 30px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

/* SIGNATURE PAD */
.signature-pad {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}

#signatureCanvas {
  width: 100%;
  height: 200px;
  display: block;
  cursor: crosshair;
}

.clear-signature {
  padding: 12px 20px;
  background: transparent;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.clear-signature:hover {
  background: var(--surface-soft);
  color: var(--text);
}

/* FORM NAVIGATION */
.form-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 2px solid var(--border);
}

.btn-prev,
.btn-next,
.btn-submit {
  min-height: 54px;
  padding: 16px 32px;
  border-radius: 999px;
  border: none;
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-prev {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-prev:hover {
  background: var(--surface-soft);
}

.btn-next {
  background: var(--primary);
  color: var(--white);
}

.btn-next:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, #4CAF50, #8BC34A);
  color: var(--white);
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-submit:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(76, 175, 80, 0.4);
}

.trust-text {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ERFOLGSMELDUNG */
.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 17, 31, 0.85);
  display: grid;
  place-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.success-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
  max-width: 500px;
  animation: slideUp 0.4s ease;
}

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

.success-icon {
  font-size: 64px;
  margin-bottom: 24px;
}

.success-box h2 {
  margin: 0 0 16px;
  font-family: 'Manrope', sans-serif;
  font-size: 32px;
  color: var(--primary);
}

.success-box p {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--text);
}

.btn-close {
  margin-top: 24px;
  padding: 16px 32px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 999px;
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-close:hover {
  background: var(--primary-dark);
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .d2d-form {
    padding: 32px 24px;
  }

  .button-group,
  .button-grid-2x2 {
    grid-template-columns: 1fr;
  }

  .button-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-nav {
    flex-direction: column;
  }

  .btn-prev,
  .btn-next {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .d2d-hero {
    padding: 40px 0 30px;
  }

  .d2d-head h1 {
    font-size: 28px;
  }

  .d2d-head p {
    font-size: 17px;
  }

  .progress-step {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .d2d-section {
    padding: 40px 0;
  }

  .d2d-form {
    padding: 24px 20px;
    border-radius: var(--radius-sm);
  }

  .step-header h2 {
    font-size: 24px;
  }

  .option-btn {
    padding: 20px 16px;
    min-height: 90px;
  }

  .option-icon {
    font-size: 28px;
  }

  .option-text strong {
    font-size: 16px;
  }

  .option-btn-sm {
    padding: 14px 10px;
    font-size: 13px;
  }

  .input-with-voice,
  .input-with-gps {
    grid-template-columns: 1fr;
  }

  .voice-btn,
  .gps-btn {
    width: 100%;
  }

  .gps-btn {
    font-size: 14px;
  }

  .signature-pad {
    border-radius: var(--radius-sm);
  }

  #signatureCanvas {
    height: 160px;
  }

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

  .lead-summary {
    padding: 20px;
  }

  .success-box {
    padding: 32px 24px;
  }

  .success-icon {
    font-size: 48px;
  }

  .success-box h2 {
    font-size: 26px;
  }

  .success-box p {
    font-size: 16px;
  }
}
