/* DIF Kontaktformular Styles — Tally-Original-Look */

.dif-form-wrapper {
  width: 100%;
  margin: 0 auto;
  padding: 12px 32px 6px;
  font-family: 'Urbanist', sans-serif;
  font-size: 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
}

/* Form-Container — kein vertikales Zentrieren, Content fängt oben an */
#form-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Inhalt zentriert als Block, Text bleibt linksbündig */
.form-step {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

/* Progress Bar — ausgeblendet */
.form-progress {
  display: none;
}

.progress-track {
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
}

#progress-bar {
  height: 100%;
  background: #438fb9;
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 0%;
}

#progress-text {
  display: none;
}

/* Step Image — volle Breite, natürliche Höhe */
.form-step-image {
  margin-bottom: 16px;
}

.form-step-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* finanzierungsart: Himmel oben 50px wegcroppen */
.form-step--finanzierungsart .form-step-image {
  overflow: hidden;
}

.form-step--finanzierungsart .form-step-image img {
  margin-top: -50px;
}

/* immobilienart: oben 20px, unten 10px wegcroppen */
.form-step--immobilienart .form-step-image {
  overflow: hidden;
}

.form-step--immobilienart .form-step-image img {
  margin-top: -35px;
  margin-bottom: -10px;
}

/* 2-Spalten-Grid für Radio-Optionen */
.options-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

/* Nebenkosten: Label | % | € in einer Zeile */
.nebenkosten-row {
  display: grid;
  grid-template-columns: 1fr 90px 120px;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.nebenkosten-label {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

.nebenkosten-pct input {
  text-align: center;
}

.nebenkosten-eur {
  font-size: 16px;
  font-weight: 700;
  color: #438fb9;
  text-align: right;
  white-space: nowrap;
}

/* Step Container */
.form-step {
  animation: fadeIn 0.3s ease;
}

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

/* Frage-Titel — kleiner als Intro-Titel */
.form-title {
  font-family: 'Urbanist', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0;
  line-height: 1.3;
  padding-bottom: 1rem;
}

/* Intro-Titel */
.form-title-main {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  padding-bottom: 1rem;
}


/* Intro: Weiter-Button zentriert und breiter */
.form-step--intro .form-buttons {
  justify-content: center;
  margin-top: 16px;
}

.form-step--intro .btn-next {
  margin-left: 0;
  min-width: 280px;
  font-size: 16px;
  height: 44px;
}

.form-subtitle {
  font-size: 15px;
  color: #666;
  margin-bottom: 20px;
  margin-top: -0.25rem;
  line-height: 1.5;
}

/* Intro Text */
.form-intro-text {
  padding: 0;
  margin-bottom: 12px;
}

.form-intro-text p {
  margin: 0 0 6px;
  color: #37352f;
  font-size: 14px;
  line-height: 1.5;
}

.form-intro-list {
  margin: 8px 0;
  padding-left: 24px;
  font-size: 14px;
  color: #37352f;
  line-height: 1.6;
}

.form-intro-list li {
  margin-bottom: 4px;
}

/* Farbiger Text wie Tally-Original */
.text-green {
  color: rgb(24, 151, 38);
}

.text-blue {
  color: rgb(0, 122, 255);
}

/* Field Groups */
.field-group {
  margin-bottom: 16px;
}

.field-group.hidden {
  display: none;
}

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}

.field-label .required {
  color: #e74c3c;
}

.field-hint {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
  font-style: italic;
}

/* Text Inputs — mit Rahmen und leichter Rundung */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  font-family: 'Urbanist', sans-serif;
  transition: border-color 0.2s ease, outline 0.2s ease;
  background: transparent;
  box-sizing: border-box;
  line-height: 1.5;
  min-height: 35px;
}

input:focus,
textarea:focus {
  border-color: #438fb9;
  outline: 4px solid rgba(110, 169, 201, 0.36);
  box-shadow: none;
}

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

/* Input with suffix */
.input-with-suffix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-suffix input {
  padding-right: 50px;
}

.input-suffix {
  position: absolute;
  right: 14px;
  color: #888;
  font-size: 14px;
  pointer-events: none;
}

/* Radio/Checkbox Options — Tally-Stil: klickbare Karten mit Kreis-Indikator */
.radio-option,
.checkbox-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  box-shadow: rgba(55, 53, 47, 0.09) 0px 0px 0px 1px;
  cursor: pointer;
  transition: background-color 100ms ease-in-out, box-shadow 100ms ease-in-out;
  margin-bottom: 8px;
  min-height: 35px;
}

.radio-option:hover,
.checkbox-option:hover {
  background: rgba(0, 0, 0, 0.04);
}

.radio-option.selected,
.checkbox-option.selected {
  box-shadow: #438fb9 0px 0px 0px 2px;
}

/* Native Input verstecken */
.radio-option input,
.checkbox-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: none;
  min-height: 0;
}

/* Kreis-Indikator (Radio) */
.radio-option::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(55, 53, 47, 0.3);
  flex-shrink: 0;
  transition: background-color 100ms ease-in-out, border-color 100ms ease-in-out;
  box-sizing: border-box;
}

.radio-option.selected::before {
  background-color: #438fb9;
  border-color: #438fb9;
}

/* Checkbox-Indikator (eckig) */
.checkbox-option::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid rgba(55, 53, 47, 0.3);
  flex-shrink: 0;
  transition: background-color 100ms ease-in-out, border-color 100ms ease-in-out;
  box-sizing: border-box;
}

.checkbox-option.selected::before {
  background-color: #438fb9;
  border-color: #438fb9;
}

.radio-option span,
.checkbox-option span {
  font-size: 16px;
  color: #37352f;
  line-height: 1.5;
}

/* Checkbox Single (Datenschutz) */
.checkbox-single {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  line-height: 1.4;
}

.checkbox-single input {
  width: auto;
  margin-top: 3px;
  accent-color: #438fb9;
  border: none;
  min-height: auto;
  padding: 0;
}

/* Calculated Fields */
.calculated-field {
  background: transparent;
  padding: 8px 0;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid #eee;
}

.calculated-value {
  font-size: 18px;
  font-weight: 700;
  color: #438fb9;
  font-family: 'Urbanist', sans-serif;
}

/* Hint */
.form-hint {
  font-size: 13px;
  color: #888;
  margin-top: 8px;
  font-style: italic;
}

/* Info Box */
.form-info-box {
  background: #f0f8ff;
  border-radius: 10px;
  padding: 16px 20px;
  margin: 16px 0;
}

.form-info-box p {
  margin: 0 0 6px;
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}

.form-info-box p:last-child {
  margin-bottom: 0;
}

.form-info-warning {
  background: #fff8e6;
  border-left: 4px solid #f0ad4e;
}

.form-info-warning p {
  color: #664d03;
}

/* Error */
.form-error {
  background: #fde8e8;
  color: #c0392b;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin: 12px 0;
}

/* Buttons — Tally-Stil: 8px radius, 36px Hoehe */
.form-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  gap: 12px;
}

.btn-next,
.btn-back {
  height: 36px;
  padding: 0 0.9em;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Urbanist', sans-serif;
  transition: all 0.2s ease;
}

.btn-next {
  background: #438fb9;
  color: #fff;
  margin-left: auto;
}

.btn-next:hover {
  background: rgba(67, 143, 185, 0.75);
}

.btn-next:focus {
  outline: 4px solid rgba(110, 169, 201, 0.36);
}

.btn-back {
  background: transparent;
  color: #888;
  border: none;
}

.btn-back:hover {
  color: #333;
}

/* Loading Spinner */
.form-loading {
  text-align: center;
  padding: 60px 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: #438fb9;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

/* Thank You */
.form-thankyou {
  background: #f0f8ff;
  padding: 24px;
  border-radius: 12px;
  margin-top: 20px;
}

.form-thankyou p {
  margin: 0 0 12px;
  font-size: 15px;
  color: #333;
  line-height: 1.6;
}

.form-signature {
  margin-top: 20px;
  font-style: italic;
  color: #438fb9;
}

.form-emoji {
  font-size: 24px;
  display: inline;
}

/* Kontaktseite: Hintergrund weiß */
#page-kontakt {
  background-color: #fff !important;
}


#page-kontakt .section-20 {
  min-height: 100vh;
  background-color: #fff !important;
  margin-left: 3.5%;
  margin-right: 3.5%;
  position: relative;
  z-index: 1;
  align-items: flex-start;
}

#page-kontakt .section-20 .w-container {
  max-width: 100%;
  min-width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

#page-kontakt .dif-form-wrapper {
  flex: 1;
}

/* Tablet (768–1280px): container-50 auf volle Breite zwingen */
@media screen and (min-width: 768px) and (max-width: 1280px) {
  .section-20 .container-50 {
    min-width: 100% !important;
    width: 100% !important;
  }
  .dif-form-wrapper {
    padding: 20px 24px;
  }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
  #page-kontakt .section-20 {
    display: flex !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  #page-kontakt .section-20 .w-container,
  #page-kontakt .section-20 .container-50 {
    max-width: 100% !important;
    min-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .dif-form-wrapper {
    padding: 16px;
  }

  .form-step {
    max-width: 100%;
    padding: 0 4px;
  }

  .form-title {
    font-size: 1.125rem;
    padding-bottom: 0.75rem;
  }

  .form-title-main {
    font-size: 1.75rem;
    padding-bottom: 1.5rem;
  }

  /* Radios: immer einspaltig auf Mobile */
  .field-group:not(.hidden) {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  /* ek-table: gestapeltes Layout — Label oben, Inputs darunter */
  .ek-table-header { display: none; }
  .ek-table-row {
    display: block !important;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: 0;
  }
  .ek-td--label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
  }
  .ek-td--motto { display: none; }
  .ek-td:not(.ek-td--label):not(.ek-td--motto) {
    display: inline-block;
    width: 48%;
    padding: 0 4px 0 0;
    vertical-align: top;
  }
  .ek-td:not(.ek-td--label):not(.ek-td--motto):last-of-type {
    padding: 0 0 0 4px;
  }

  /* Kredit-Tabelle: Header weg, data-label als Pseudo-Label */
  .kredit-table-header { display: none; }
  .kredit-table-row { grid-template-columns: 1fr 1fr !important; }
  .kredit-td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 3px;
  }

  /* Personen-Layout */
  .personen-layout { grid-template-columns: 1fr; }

  /* Beschäftigung: immer einspaltig auf Mobile */
  .perperson-grid--1,
  .perperson-grid--2,
  .perperson-grid--3,
  .perperson-grid--4 { grid-template-columns: 1fr !important; }

  /* Nebenkosten */
  .nebenkosten-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 0 !important;
  }
  .nebenkosten-label {
    grid-column: 1 / -1;
    font-size: 14px;
  }
  .nebenkosten-pct {
    /* Prozent-Input volle linke Hälfte */
  }
  .nebenkosten-eur {
    text-align: left;
    font-size: 15px;
    display: flex;
    align-items: center;
  }

  .form-buttons {
    position: sticky;
    bottom: 44px;
    background: #fff;
    padding: 12px 0 8px;
    z-index: 10;
  }
}

/* Personen-Layout: 2 Spalten */
.personen-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 8px;
}

.personen-left .radio-option {
  margin-bottom: 4px;
}

.personen-right-hint {
  color: #aaa;
  font-size: 14px;
  padding-top: 8px;
}

.personen-alter-row {
  margin-bottom: 12px;
}

.personen-alter-row .field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
}

/* perPersonFields: Beschäftigung je Person */
.perperson-grid {
  display: grid;
  gap: 16px 24px;
  align-items: start;
  margin-bottom: 8px;
}
.perperson-grid--1 { grid-template-columns: 1fr; }
.perperson-grid--2 { grid-template-columns: 1fr 1fr; }
.perperson-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.perperson-grid--4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.perperson-block {
  padding-bottom: 4px;
}

.perperson-label {
  font-size: 13px;
  font-weight: 700;
  color: #438fb9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid #e8f3f9;
}

.perperson-block .field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.perperson-block .radio-option {
  font-size: 14px;
}

@media (max-width: 600px) {
  .perperson-grid--3,
  .perperson-grid--4 { grid-template-columns: 1fr 1fr; }
}

.perperson-block .radio-option {
  flex: 0 0 auto;
  padding: 6px 14px;
  font-size: 14px;
}

@media (max-width: 600px) {
  .personen-layout { grid-template-columns: 1fr; }
}

/* Kredit-Details Tabelle */
.kredit-table {
  width: 100%;
  margin-bottom: 16px;
}

.kredit-table-header {
  display: grid;
  grid-template-columns: 1.4fr 1.3fr 1fr 1.2fr;
  padding: 0 0 8px 0;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 4px;
}

.kredit-th {
  font-size: 13px;
  font-weight: 700;
  color: #555;
  padding: 0 6px;
  line-height: 1.3;
}

.kredit-table-row {
  display: grid;
  grid-template-columns: 1.4fr 1.3fr 1fr 1.2fr;
  gap: 0;
  border-bottom: 1px solid #f0f0f0;
}

.kredit-td {
  padding: 6px 6px;
}

.kredit-td input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Urbanist', sans-serif;
  box-sizing: border-box;
  background: #fff;
  color: #333;
}

.kredit-td input:focus {
  border-color: #438fb9;
  outline: 3px solid rgba(110, 169, 201, 0.3);
}

.kredit-td input::placeholder {
  color: #bbb;
}

@media (max-width: 767px) {
  .kredit-table-header { display: none; }
  .kredit-table-row { grid-template-columns: 1fr 1fr; }
}

/* Eigenkapital Tabelle */
.ek-table {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid #e0e0e0;
}

.ek-table-header {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
}

.ek-th {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ek-table-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  align-items: center;
  border-top: 1px solid #e0e0e0;
}

.ek-row--green  { background: rgba(24, 151, 38, 0.06); }
.ek-row--yellow { background: rgba(240, 173, 78, 0.08); }
.ek-row--red    { background: rgba(192, 57, 43, 0.06); }

.ek-td {
  padding: 8px 10px;
}

.ek-td input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: 'Urbanist', sans-serif;
  min-height: 0;
  box-sizing: border-box;
  background: #fff;
}

.ek-td input:focus {
  border-color: #438fb9;
  outline: 3px solid rgba(110, 169, 201, 0.3);
}

.ek-td--label {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.ek-td--motto {
  font-size: 13px;
  font-weight: 600;
  font-style: italic;
  line-height: 1.3;
}

.ek-color--green  { color: rgb(24, 151, 38); }
.ek-color--yellow { color: rgb(200, 130, 0); }
.ek-color--red    { color: rgb(192, 57, 43); }

@media (max-width: 767px) {
  .ek-table-header,
  .ek-table-row {
    grid-template-columns: 1fr 1fr;
  }
  .ek-th:nth-child(3),
  .ek-th:nth-child(4),
  .ek-td:nth-child(3),
  .ek-td:nth-child(4) {
    display: none;
  }
}


/* Kredit-Tabelle: € innerhalb des Eingabefeldes */
.kredit-input-euro {
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.kredit-input-euro input {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  flex: 1;
  min-width: 0;
  padding: 8px;
  background: transparent;
}
.kredit-input-euro span {
  padding: 0 8px 0 2px;
  color: #555;
  font-size: 0.9em;
  white-space: nowrap;
  pointer-events: none;
}


/* Danke-Seite: Logo-Banner über dem Bild */
.form-thankyou-logo {
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 5%;
  margin-bottom: 0;
  border-radius: 12px 12px 0 0;
}

.form-thankyou-logo img {
  max-width: 100%;
  width: 100%;
  height: auto;
  display: block;
}

.form-thankyou-logo + .form-step-image img {
  border-radius: 0;
}

/* Danke-Seite: Titel auffälliger */
.form-title-thankyou {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #0a1e35;
  text-align: center;
}
