/* === Variables === */
:root {
  --primary: #1a365d;
  --primary-light: #2a4a7f;
  --accent: #38a169;
  --accent-light: #48bb78;
  --accent-dark: #2f855a;
  --red: #e53e3e;
  --bg: #f7fafc;
  --card-bg: #ffffff;
  --text: #1a202c;
  --text-secondary: #4a5568;
  --text-light: #718096;
  --border: #e2e8f0;
  --border-focus: #38a169;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(26, 54, 93, 0.08);
  --shadow-hover: 0 8px 32px rgba(26, 54, 93, 0.12);
  --transition: 0.25s ease;
}

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 30px 16px 60px;
}

h2 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.55rem;
  color: var(--primary);
  margin-bottom: 4px;
}

/* === Form Container === */
.form-container {
  width: 100%;
  max-width: 620px;
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 36px 32px 28px;
  position: relative;
}

/* === Header === */
.form-header {
  margin-bottom: 28px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--primary);
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 0.82rem;
  color: var(--text-light);
  font-weight: 500;
}

/* === Progress Bar === */
.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
  padding: 0 8px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--border);
  color: var(--text-light);
  transition: var(--transition);
  border: 2px solid transparent;
}

.step.active .step-circle {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.step.completed .step-circle {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.step-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-light);
  text-align: center;
  transition: var(--transition);
  white-space: nowrap;
}

.step.active .step-label,
.step.completed .step-label {
  color: var(--primary);
}

.step-line {
  flex: 1;
  height: 3px;
  background: var(--border);
  margin: 0 4px;
  margin-bottom: 22px;
  border-radius: 2px;
  transition: var(--transition);
  min-width: 30px;
}

.step-line.active {
  background: var(--accent);
}

/* === Form Steps === */
.form-step {
  display: none;
  animation: slideUp 0.4s ease;
}

.form-step.active {
  display: block;
}

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

.step-description {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* === Form Groups === */
.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 8px;
}

.required {
  color: var(--red);
}

.optional {
  color: var(--text-light);
  font-weight: 400;
  font-size: 0.82rem;
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 10px;
  line-height: 1.4;
}

.form-row {
  display: flex;
  gap: 14px;
}

.form-group.half {
  flex: 1;
}

/* === Inputs === */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  transition: var(--transition);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.12);
}

input.invalid,
select.invalid,
.card-select.invalid,
.radio-group.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
  animation: shake 0.35s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

textarea {
  resize: vertical;
  min-height: 70px;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* === Card Select === */
.card-select {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.card-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  background: #fff;
}

.card-option:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
}

.card-option.selected {
  border-color: var(--accent);
  background: rgba(56, 161, 105, 0.05);
  box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.12);
}

.card-icon {
  font-size: 1.6rem;
  line-height: 1;
  color: var(--primary);
}

.card-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}

.card-desc {
  font-size: 0.72rem;
  color: var(--text-light);
  line-height: 1.3;
}

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

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

.kontakt-select {
  grid-template-columns: repeat(3, 1fr);
}

/* === Radio Group === */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.franchise-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.radio-option {
  position: relative;
  cursor: pointer;
}

.radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-label {
  display: block;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  transition: var(--transition);
  background: #fff;
}

.radio-option input[type="radio"]:checked + .radio-label {
  border-color: var(--accent);
  background: rgba(56, 161, 105, 0.05);
  color: var(--accent-dark);
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.12);
}

.radio-option:hover .radio-label {
  border-color: var(--primary-light);
}

.inline-radio {
  display: flex;
  gap: 10px;
}

.inline-radio .radio-label {
  min-width: 80px;
}

/* === Checkbox Group === */
.checkbox-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  background: #fff;
}

.checkbox-option:hover {
  border-color: var(--primary-light);
}

.checkbox-option input[type="checkbox"] {
  display: none;
}

.checkbox-option input[type="checkbox"]:checked ~ .checkbox-label {
  color: var(--accent-dark);
  font-weight: 600;
}

.checkbox-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(56, 161, 105, 0.05);
  box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.12);
}

.checkbox-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.checkbox-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  transition: var(--transition);
}

/* === Consent === */
.consent-group {
  margin-top: 8px;
}

.consent-checkbox {
  border: none !important;
  padding: 0 !important;
  background: none !important;
  box-shadow: none !important;
  align-items: flex-start;
}

.consent-checkbox input[type="checkbox"] {
  display: block !important;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

.consent-checkbox .checkbox-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.consent-checkbox .checkbox-label a {
  color: var(--accent);
  text-decoration: underline;
}

/* === Buttons === */
.form-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  gap: 12px;
}

.btn {
  padding: 13px 32px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-back {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid var(--border);
}

.btn-back:hover {
  background: var(--bg);
  border-color: var(--text-light);
}

.btn-next,
.btn-submit {
  background: var(--accent);
  color: #fff;
  margin-left: auto;
}

.btn-next:hover,
.btn-submit:hover {
  background: var(--accent-dark);
  box-shadow: 0 4px 16px rgba(56, 161, 105, 0.3);
}

.btn-submit {
  background: var(--primary);
}

.btn-submit:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 16px rgba(26, 54, 93, 0.3);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Success Screen === */
.success-screen {
  text-align: center;
  padding: 24px 0;
}

.success-icon {
  margin-bottom: 20px;
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.success-screen h2 {
  color: var(--accent);
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.success-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 400px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.success-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

.info-icon {
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
}

/* === Trust Badges === */
.trust-badges {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 500;
}

.badge-icon {
  font-size: 1rem;
}

/* === Footer === */
.form-footer {
  text-align: center;
  margin-top: 16px;
  padding-top: 14px;
  font-size: 0.78rem;
  color: var(--text-light);
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.form-footer a {
  color: var(--text-light);
  text-decoration: none;
  transition: var(--transition);
}

.form-footer a:hover {
  color: var(--accent);
}

/* === Responsive === */
@media (max-width: 520px) {
  body {
    padding: 12px 8px 40px;
  }

  .form-container {
    padding: 24px 18px 20px;
    border-radius: 16px;
  }

  h2 {
    font-size: 1.3rem;
  }

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

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

  .kontakt-select {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .checkbox-group {
    grid-template-columns: 1fr;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .step-label {
    font-size: 0.62rem;
  }

  .step-circle {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .trust-badges {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .inline-radio {
    flex-wrap: wrap;
  }

  .btn {
    padding: 12px 24px;
    font-size: 0.9rem;
  }
}
