/* ============================================================
   GRÜNEWALD SCHADENSMELDUNG – DESIGN SYSTEM
   Primärfarbe: #97BF04 (Grünewald Grün)
   ============================================================ */

:root {
  --primary:        #97BF04;
  --primary-dark:   #739106;
  --primary-light:  #f2f8e0;
  --bg-page:        #f7faf0;
  --bg-white:       #ffffff;
  --text-dark:      #1a1a1a;
  --text-mid:       #555555;
  --text-light:     #999999;
  --border:         #e0e0e0;
  --shadow:         0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover:   0 6px 24px rgba(0,0,0,0.13);
  --radius-card:    16px;
  --radius-btn:     999px;
  --radius-input:   10px;
  --loader-color:   #97BF04;
}

/* ============================================================
   RESET & BASE
   ============================================================ */

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

html, body {
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: var(--text-dark);
  background: var(--bg-page);
}

body {
  outline: 3px solid var(--primary);
  outline-offset: -3px;
}

/* ============================================================
   PAGE WRAPPER
   ============================================================ */

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 680px;
  margin: 0 auto;
  background: var(--bg-white);
  box-shadow: 0 0 0 1px var(--border);
}

/* ============================================================
   HEADER
   ============================================================ */

.funnel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 60px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Zurück-Button */
.header-back-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary);
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
}

.funnel-header.show-back .header-back-btn {
  opacity: 1;
  pointer-events: auto;
}

.header-back-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* Logo */
.header-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-logo img {
  display: block;
  width: auto;
  height: clamp(28px, 4.2vw, 42px);
  max-width: min(72vw, 400px);
  object-fit: contain;
}

/* Menü-Button */
.header-menu-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.header-menu-btn:hover {
  background: var(--primary-light);
}

/* ============================================================
   PROGRESS STEPPER
   ============================================================ */

.progress-stepper {
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 16px 16px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.progress-stepper.visible {
  display: flex;
}

.stepper-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
}

.stepper-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-light);
  transition: all 0.3s;
}

.stepper-label {
  font-size: 0.72rem;
  color: var(--text-light);
  white-space: normal;
  text-align: center;
  line-height: 1.25;
  max-width: 120px;
  font-weight: 500;
  transition: color 0.3s;
}

.stepper-line {
  flex: 0 0 clamp(26px, 5vw, 42px);
  height: 2px;
  background: var(--border);
  margin-top: 14px;
  min-width: 24px;
  max-width: 42px;
  transition: background 0.3s;
}

/* Active phase */
.stepper-item.active .stepper-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.stepper-item.active .stepper-label {
  color: var(--primary);
  font-weight: 700;
}

/* Completed phase */
.stepper-item.completed .stepper-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.stepper-item.completed .stepper-label {
  color: var(--primary-dark);
}

.stepper-line.done {
  background: var(--primary);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

.funnel-main {
  flex: 1;
  padding: 8px 20px;
}

/* ============================================================
   HOME CARDS (Step 0)
   ============================================================ */

.funnel-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

.funnel-card:hover {
  box-shadow: var(--shadow-hover);
}

.card-icon-wrap {
  margin-bottom: 6px;
}

.card-icon-wrap svg {
  display: block;
  width: 64px;
  height: 50px;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.card-desc {
  font-size: 0.95rem;
  color: var(--text-mid);
  margin-bottom: 14px;
  line-height: 1.5;
}

.card-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  padding: 10px 24px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.card-action-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(151,191,4,0.35);
}

.card-action-btn:active {
  transform: translateY(0);
}

/* ============================================================
   FUNNEL STEPS (Step 2–12)
   ============================================================ */

div[id^="step"] {
  display: none;
  animation: fadeIn 0.35s ease;
}

/* Step 0 überschreibt die allgemeine Regel – muss danach stehen */
div[id="step0"] {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.8vh, 16px);
  max-width: 100%;
  min-height: calc(100vh - 60px - 64px - 20px);
}

#step0 .funnel-card {
  width: 100%;
  height: 100%;
  padding: clamp(18px, 2.2vw, 24px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#step0 .card-title {
  margin-top: clamp(4px, 0.8vw, 8px);
  margin-bottom: clamp(6px, 1vw, 10px);
}

#step0 .card-desc {
  margin-bottom: clamp(10px, 1.4vw, 16px);
}

#loader, #loader2 {
  display: none;
}

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

.funnel-step {
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

/* Schritt-Titel */
.step-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.4;
}

.step-hint {
  font-size: 0.9rem;
  color: var(--text-mid);
  text-align: center;
  margin-bottom: 28px;
}

/* ============================================================
   RADIO BUTTONS (inline mit Kreisen)
   ============================================================ */

.radio-group-inline {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 28px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 4px;
}

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

.radio-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-white);
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.2s;
}

.radio-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--primary);
  transition: transform 0.2s;
}

.radio-option input[type="radio"]:checked + .radio-dot {
  border-color: var(--primary);
}

.radio-option input[type="radio"]:checked + .radio-dot::after {
  transform: translate(-50%, -50%) scale(1);
}

.radio-text {
  font-size: 1rem;
  color: var(--text-dark);
  font-weight: 500;
}

/* ============================================================
   KENNZEICHEN INPUT
   ============================================================ */

.kennzeichen-input-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
}

.kennzeichen-input {
  width: 100%;
  max-width: 440px;
  padding: 22px 20px;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  border: 2px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--bg-white);
  color: var(--text-dark);
  letter-spacing: 0.05em;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.kennzeichen-input::placeholder {
  color: var(--border);
  font-weight: 400;
}

.kennzeichen-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(151,191,4,0.2);
}

.kennzeichen-input.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220,53,69,0.15);
}

.kennzeichen-error {
  display: none;
  color: #dc3545;
  font-size: 0.85rem;
  margin-top: 8px;
  font-weight: 500;
}

.kennzeichen-input.is-invalid ~ .kennzeichen-error {
  display: block;
}

/* ============================================================
   FILE UPLOAD
   ============================================================ */

.upload-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
}

.file-input {
  display: none;
}

.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 48px;
  background: var(--primary-light);
  border: 2px dashed var(--primary);
  border-radius: var(--radius-card);
  cursor: pointer;
  min-width: 260px;
  text-align: center;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  color: var(--primary-dark);
}

.upload-label:hover {
  background: #e6f2b0;
  border-color: var(--primary-dark);
  transform: translateY(-2px);
}

.upload-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.upload-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.file-name {
  margin-top: 12px;
  color: var(--text-mid);
  font-size: 0.85rem;
  text-align: center;
  max-width: 320px;
  line-height: 1.5;
}

.document-upload-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto 28px;
}

.document-upload-card {
  width: 100%;
}

.document-upload-label {
  display: grid;
  grid-template-columns: 84px 1fr 42px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 108px;
  padding: 18px 20px;
  background: var(--primary-light);
  border: 2px dashed var(--primary);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.document-upload-label:hover {
  transform: translateY(-2px);
  background: #e6f2b0;
  border-color: var(--primary-dark);
}

.document-upload-thumb {
  display: grid;
  grid-template-rows: 10px 1fr;
  width: 100%;
  aspect-ratio: 1.7 / 1;
  border-radius: 6px;
  border: 1px solid rgba(151, 191, 4, 0.18);
  background: linear-gradient(90deg, #efe5d3 0%, #e3ebd8 50%, #d7e0c6 100%);
  position: relative;
  overflow: hidden;
}

.document-upload-thumb-header {
  display: block;
  width: 100%;
  background: linear-gradient(90deg, #f3ebdd 0%, #ecf1e4 100%);
  border-bottom: 1px solid rgba(120, 120, 120, 0.15);
}

.document-upload-thumb-lines {
  position: relative;
  display: block;
  margin: 10px 8px 8px;
  border-radius: 1px;
  background:
    linear-gradient(to bottom,
      rgba(118, 149, 92, 0.22) 0 2px,
      transparent 2px 8px,
      rgba(118, 149, 92, 0.2) 8px 10px,
      transparent 10px 16px,
      rgba(118, 149, 92, 0.22) 16px 18px,
      transparent 18px 24px,
      rgba(118, 149, 92, 0.18) 24px 26px,
      transparent 26px 100%);
}

.document-upload-thumb-lines::before,
.document-upload-thumb-lines::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32%;
  border-right: 1px solid rgba(120, 120, 120, 0.12);
  background:
    linear-gradient(to bottom,
      rgba(151, 191, 4, 0.1) 0 3px,
      transparent 3px 11px,
      rgba(151, 191, 4, 0.12) 11px 14px,
      transparent 14px 22px,
      rgba(151, 191, 4, 0.1) 22px 25px,
      transparent 25px 100%);
}

.document-upload-thumb-lines::before {
  left: 0;
}

.document-upload-thumb-lines::after {
  left: 36%;
}

.document-upload-thumb-front::after,
.document-upload-thumb-back::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 18px;
  height: 12px;
  border-radius: 2px;
  background: rgba(80, 120, 80, 0.16);
}

.document-upload-thumb-front::before {
  content: "V";
  position: absolute;
  left: 8px;
  top: 18px;
  font-size: 17px;
  font-weight: 700;
  color: rgba(120, 150, 110, 0.28);
}

.document-upload-thumb-back::before {
  content: "R";
  position: absolute;
  left: 8px;
  top: 18px;
  font-size: 17px;
  font-weight: 700;
  color: rgba(120, 150, 110, 0.28);
}

.document-upload-copy {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.document-upload-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--primary);
  flex-shrink: 0;
}

.document-upload-icon svg {
  width: 34px;
  height: 34px;
}

#step3 .file-name {
  margin-top: 8px;
  font-size: 0.8rem;
}

.diagonal-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 620px;
  margin: 0 auto 28px;
}

.diagonal-upload-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diagonal-upload-preview {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--bg-white);
}

.diagonal-upload-label {
  min-width: 100%;
  padding: 20px 24px;
}

#step5 .file-name {
  max-width: 100%;
}

.damage-example {
  width: 100%;
  max-width: 520px;
  margin: 0 auto 28px;
}

.damage-example-title {
  margin-bottom: 12px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
}

.damage-example-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--bg-white);
}

/* ============================================================
   FORM INPUTS (Step 9 + Step 10)
   ============================================================ */

.form-field-group,
.contact-form {
  max-width: 480px;
  margin: 0 auto;
}

.form-control {
  border-radius: var(--radius-input) !important;
  border-color: var(--border) !important;
  font-size: 0.95rem;
}

.form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(151,191,4,0.2) !important;
}

.form-check-input:checked {
  background-color: var(--primary) !important;
  border-color: var(--primary-dark) !important;
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(151,191,4,0.2) !important;
  border-color: var(--primary) !important;
}

.form-check-label a {
  color: var(--primary-dark);
  text-decoration: underline;
}

.datenschutz {
  display: block !important;
}

/* ============================================================
   NAVIGATION BUTTONS
   ============================================================ */

.funnel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
  padding-bottom: 8px;
}

/* Zurück-Pfeil */
.nav-btn-back {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--bg-white);
  color: var(--text-mid);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.nav-btn-back:hover {
  border-color: var(--text-dark);
  color: var(--text-dark);
  background: #f5f5f5;
}

/* Weiter-Button */
.nav-btn-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text-dark);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  padding: 13px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.nav-btn-next:hover {
  background: #333;
  transform: translateY(-1px);
}

/* Absenden-Button */
.nav-btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  padding: 13px 32px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  letter-spacing: 0.03em;
}

.nav-btn-submit:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(151,191,4,0.35);
}

/* ============================================================
   LOADER
   ============================================================ */

.loader-step {
  text-align: center;
  padding: 48px 24px;
}

.custom-loader {
  margin: 32px auto 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: conic-gradient(#0000 10%, var(--loader-color));
  -webkit-mask: radial-gradient(farthest-side, #0000 calc(100% - 12px), #000 0);
  mask: radial-gradient(farthest-side, #0000 calc(100% - 12px), #000 0);
  animation: spin 1.5s infinite linear;
}

@keyframes spin {
  to { transform: rotate(1turn); }
}

/* ============================================================
   SUCCESS & ERROR STEPS
   ============================================================ */

.success-step,
.error-step {
  text-align: center;
  padding: 48px 24px;
}

.success-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--primary);
}

.error-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
  color: #dc3545;
}

.success-step h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--text-dark);
}

.error-step h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-dark);
}

.error-step p {
  color: var(--text-mid);
  margin-bottom: 28px;
}

/* ============================================================
   FOOTER
   ============================================================ */

.funnel-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-light);
  background: var(--bg-white);
}

/* ============================================================
   COOKIE SETTINGS BUTTON
   ============================================================ */

.cookie-settings-btn {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.75rem;
  color: var(--text-mid);
  cursor: pointer;
  z-index: 9999;
  transition: background 0.2s;
  box-shadow: var(--shadow);
}

.cookie-settings-btn:hover {
  background: var(--primary-light);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 600px) {
  .page-wrapper {
    max-width: 100%;
  }

  .funnel-main {
    padding: 16px;
  }

  .step-title {
    font-size: 1.15rem;
  }

  .kennzeichen-input {
    font-size: 1.5rem;
    padding: 18px 14px;
  }

  .radio-group-inline {
    gap: 12px;
  }

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

  .funnel-card {
    padding: 24px 20px;
  }

  div[id="step0"] {
    gap: 10px;
    min-height: calc(100dvh - 60px - 56px - 32px);
  }

  #step0 .funnel-card {
    min-height: 0;
  }

  .upload-label {
    padding: 24px 32px;
    min-width: 200px;
  }

  .document-upload-label {
    grid-template-columns: 68px 1fr 34px;
    gap: 12px;
    min-height: 94px;
    padding: 14px;
  }

  .document-upload-copy {
    font-size: 0.88rem;
  }

  .diagonal-upload-grid {
    grid-template-columns: 1fr;
  }

  .stepper-label {
    font-size: 0.64rem;
    max-width: 96px;
  }

  .stepper-line {
    min-width: 18px;
    max-width: 30px;
  }
}

@media (max-width: 480px) {
  .funnel-main {
    padding: 10px 12px 12px;
  }

  div[id="step0"] {
    gap: 8px;
    min-height: calc(100dvh - 60px - 52px - 22px);
  }

  #step0 .funnel-card {
    padding: 14px 16px;
  }

  #step0 .card-icon-wrap {
    margin-bottom: 2px;
  }

  #step0 .card-icon-wrap svg {
    width: 44px;
    height: 34px;
  }

  #step0 .card-title {
    font-size: 1rem;
    line-height: 1.25;
    margin-top: 2px;
    margin-bottom: 4px;
  }

  #step0 .card-desc {
    font-size: 0.86rem;
    line-height: 1.35;
    margin-bottom: 10px;
  }

  #step0 .card-action-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 18px;
    font-size: 0.8rem;
  }

  .funnel-footer {
    padding: 14px 16px;
    font-size: 0.7rem;
  }

  .cookie-settings-btn {
    bottom: 10px;
    right: 10px;
    padding: 6px 10px;
    font-size: 0.68rem;
  }
}
