/* =============================================
   KFZ Terminbuchung – Public Styles
   Fonts: vom Theme geerbt (kein @import)
   ============================================= */

:root {
  --kfz-navy:     #25307e;
  --kfz-orange:   #e64c14;
  --kfz-orange-h: #c93e0e;
  --kfz-bg:       #f4f6f9;
  --kfz-white:    #ffffff;
  --kfz-border:   #dde4ee;
  --kfz-text:     #1c2b42;
  --kfz-muted:    #6b7a93;
  --kfz-light:    #edf1f7;
  --kfz-radius:   6px;
  --kfz-shadow:   0 2px 16px rgba(14,30,53,.09);
}

/* Alle Elemente erben die Schrift des Themes */
.kfz-tb-wrap,
.kfz-tb-wrap * {
  box-sizing: border-box;
}

.kfz-tb-wrap {
  color: var(--kfz-text);
  max-width: 1080px;
  margin: 0 auto;
  padding: 0;
}

/* ── Layout ───────────────────────────── */
.kfz-tb-layout {
  display: grid;
  grid-template-columns: 1fr 336px;
  gap: 32px;
  align-items: start;
}
/* Unter md (768px): umbrechen, Sidebar sticky aufheben, Formular oben */
@media (max-width: 767px) {
  .kfz-tb-layout {
    grid-template-columns: 1fr;
  }
  .kfz-tb-form-col {
    order: 1;
  }
  .kfz-tb-sidebar {
    order: 2;
    position: static;
    top: auto;
  }
}

/* ── Utilities ────────────────────────── */
.kfz-hidden { display: none !important; }
.kfz-fade-in { animation: kfzFd .3s ease both; }
@keyframes kfzFd {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ── Block cards ──────────────────────── */
.kfz-block {
  background: var(--kfz-white);
  border: 1px solid var(--kfz-border);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 16px;
  transition: opacity .25s;
}
.kfz-block.kfz-locked {
  opacity: .42;
  pointer-events: none;
  user-select: none;
}
.kfz-block-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.kfz-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--kfz-navy);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .25s;
  line-height: 1;
}
.kfz-step-num.done { background: var(--kfz-orange); }
.kfz-block-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--kfz-navy);
  margin: 0;
}

/* ── Buttons ──────────────────────────── */
.kfz-tb-btn-group { display: flex; flex-wrap: wrap; gap: 8px; }

.kfz-tb-btn {
  padding: 8px 16px;
  border: 1.5px solid var(--kfz-border);
  border-radius: var(--kfz-radius);
  background: var(--kfz-white);
  color: var(--kfz-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .16s;
  white-space: nowrap;
  line-height: 1.4;
}
.kfz-tb-btn:hover {
  border-color: var(--kfz-navy);
  color: var(--kfz-navy);
  background: var(--kfz-white);
}
.kfz-tb-btn.active {
  background: var(--kfz-navy);
  border-color: var(--kfz-navy);
  color: #fff;
}

/* ── Vehicle grid ─────────────────────── */
.kfz-tb-vehicle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 575px) {
  .kfz-tb-vehicle-grid { grid-template-columns: repeat(2, 1fr); }
}

.kfz-vehicle-card {
  border: 1.5px solid var(--kfz-border);
  border-radius: 10px;
  background: var(--kfz-white);
  padding: 16px 8px 16px;
  text-align: center;
  cursor: pointer;
  transition: all .18s;
  position: relative;
  user-select: none;
}
.kfz-vehicle-card:hover {
  border-color: var(--kfz-navy);
  box-shadow: 0 4px 14px rgba(14,30,53,.10);
  transform: translateY(-2px);
}
.kfz-vehicle-card.active {
  border-color: var(--kfz-orange);
  background: #fff7f3;
}
.kfz-vehicle-card .kfz-check {
  display: none;
  position: absolute;
  top: 8px; right: 8px;
  width: 20px; height: 20px;
  background: var(--kfz-orange);
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.kfz-vehicle-card.active .kfz-check { display: flex; }
.kfz-vehicle-icon {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 9px;
}
.kfz-vehicle-icon img {
  width: 64px;
  height: 48px;
  object-fit: contain;
  /* Farbe auf Navy tonen – Icons sind schwarz, wir colorieren sie */
  filter: brightness(0) saturate(100%) invert(17%) sepia(46%) saturate(1200%) hue-rotate(200deg) brightness(90%);
}
.kfz-vehicle-card.active .kfz-vehicle-icon img {
  filter: brightness(0) saturate(100%) invert(17%) sepia(46%) saturate(1200%) hue-rotate(200deg) brightness(90%);
}
.kfz-vlabel {
  font-size: 13px;
  font-weight: 600;
  color: var(--kfz-text);
  display: block;
}

/* ── Addons ───────────────────────────── */
.kfz-addon-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--kfz-navy);
  margin-bottom: 8px;
  display: block;
}
.kfz-addon-toggle { display: flex; gap: 8px; }
.kfz-addon-yes,
.kfz-addon-no {
  padding: 8px 24px;
  border: 1.5px solid var(--kfz-border);
  border-radius: var(--kfz-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .16s;
  background: var(--kfz-white);
  color: var(--kfz-text);
  line-height: 1.4;
}
.kfz-addon-yes.active {
  background: var(--kfz-navy);
  border-color: var(--kfz-navy);
  color: #fff;
}
.kfz-addon-no.active {
  background: var(--kfz-orange);
  border-color: var(--kfz-orange);
  color: #fff;
}
.kfz-addon-detail { margin-top: 14px; }
.kfz-addon-plate-wrap {
  display: flex;
  align-items: stretch;
  max-width: 290px;
}
.kfz-plate-prefix {
  background: var(--kfz-navy);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--kfz-radius) 0 0 var(--kfz-radius);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
}
.kfz-plate-input {
  flex: 1;
  border: 1.5px solid var(--kfz-border);
  border-left: none;
  border-radius: 0 var(--kfz-radius) var(--kfz-radius) 0;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  outline: none;
  color: var(--kfz-text);
  background: var(--kfz-white);
  transition: border-color .16s;
}
.kfz-plate-input:focus { border-color: var(--kfz-navy); }

/* ── Sub labels ───────────────────────── */
.kfz-sub-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--kfz-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 9px;
  display: block;
}

/* ── Select ───────────────────────────── */
.kfz-tb-select {
  padding: 8px 36px 8px 16px;
  border: 1.5px solid var(--kfz-border);
  border-radius: var(--kfz-radius);
  font-size: 14px;
  color: var(--kfz-text);
  background: var(--kfz-white);
  appearance: none;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%230e1e35' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  min-width: 180px;
  transition: border-color .16s;
}
.kfz-tb-select:focus { border-color: var(--kfz-navy); }

/* ── Contact fields ───────────────────── */
.kfz-tb-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}
@media (max-width: 575px) { .kfz-tb-row-2 { grid-template-columns: 1fr; } }

.kfz-tb-field { display: flex; flex-direction: column; gap: 4px; }
.kfz-tb-field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--kfz-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin: 0;
}
.kfz-tb-input {
  padding: 8px 16px;
  border: 1.5px solid var(--kfz-border);
  border-radius: var(--kfz-radius);
  font-size: 14px;
  color: var(--kfz-text);
  background: var(--kfz-white);
  outline: none;
  transition: border-color .16s;
  width: 100%;
}
.kfz-tb-input:focus { border-color: var(--kfz-navy); }
.kfz-tb-input.error { border-color: #e53e3e; }

.kfz-tb-privacy { margin-top: 8px; }
.kfz-tb-check-label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 13px;
  color: var(--kfz-muted);
  line-height: 1.55;
}
.kfz-tb-check-label input[type="checkbox"] {
  margin-top: 3px;
  width: 15px; height: 15px;
  flex-shrink: 0;
  accent-color: var(--kfz-orange);
  cursor: pointer;
}
.kfz-tb-check-label a {
  color: var(--kfz-navy);
  font-weight: 600;
  text-decoration: none;
}

/* ── Submit ───────────────────────────── */
.kfz-tb-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--kfz-orange);
  color: #fff;
  border: none;
  border-radius: var(--kfz-radius);
  padding: 16px 32px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s, transform .14s;
  margin-top: 20px;
  line-height: 1;
}
.kfz-tb-submit-btn:hover {
  background: var(--kfz-orange-h);
  transform: translateY(-1px);
}
.kfz-tb-submit-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}
.kfz-btn-spinner {
  width: 17px; height: 17px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: kfzSp .7s linear infinite;
  flex-shrink: 0;
}
@keyframes kfzSp { to { transform: rotate(360deg); } }

/* ── Messages ─────────────────────────── */
.kfz-tb-messages {
  margin-top: 14px;
  padding: 8px 16px;
  border-radius: var(--kfz-radius);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid;
  line-height: 1.5;
}
.kfz-tb-messages.error { background: #fff5f5; border-color: #fcc; color: #c53030; }
.kfz-tb-messages.success { background: #f0fff4; border-color: #b7f5d0; color: #1a6640; }

/* ════════════════════════════════════════
   SIDEBAR – sticky summary
   ════════════════════════════════════════ */
.kfz-tb-sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kfz-tb-price-card,
.kfz-tb-contact-card {
  background: var(--kfz-white);
  border: 1px solid var(--kfz-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--kfz-shadow);
}

/* Price card header */
.kfz-tb-price-header {
  background: var(--kfz-navy);
  padding: 16px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kfz-price-header-icon {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.12);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kfz-price-header-text { flex: 1; }
.kfz-price-header-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin: 0;
}
.kfz-price-header-sub {
  font-size: 12px;
  color: rgba(255,255,255,.5);
  margin-top: 2px;
}

/* Selection rows */
.kfz-sel-rows { padding: 16px 16px 8px; }
.kfz-sel-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--kfz-light);
}
.kfz-sel-row:last-child { border-bottom: none; }
.kfz-sel-row-icon {
  width: 28px; height: 28px;
  background: var(--kfz-light);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--kfz-muted);
}
.kfz-sel-row.kfz-row-filled .kfz-sel-row-icon {
  background: #f8f9fc;
  color: var(--kfz-navy);
}
.kfz-sel-row-label {
  font-size: 11px;
  color: var(--kfz-muted);
  line-height: 1;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: .4px;
  font-weight: 600;
  display: block;
}
.kfz-sel-row-value {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--kfz-text);
  margin: 0;
}
.kfz-sel-row-value.kfz-placeholder {
  color: #bbc3d0;
  font-weight: 400;
}

/* No-price placeholder */
.kfz-price-placeholder-state {
  padding: 24px 16px;
  text-align: center;
}
.kfz-ph-icon {
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
}
.kfz-price-placeholder-state p {
  font-size: 13px;
  color: var(--kfz-muted);
  line-height: 1.55;
  margin: 0;
}

/* Price separator */
.kfz-price-sep {
  height: 1px;
  background: var(--kfz-border);
  margin: 0 16px;
}

/* Price lines */
.kfz-price-lines { padding: 16px 16px 8px; }
.kfz-price-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13.5px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--kfz-light);
}
.kfz-price-line:last-child { border-bottom: none; }
.kfz-line-label { color: var(--kfz-navy); font-weight: 500; }
.kfz-line-price { font-weight: 700; color: var(--kfz-text); white-space: nowrap; }

/* Includes */
.kfz-price-includes { padding: 0 16px 16px; }
.kfz-include-item {
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  color: var(--kfz-muted);
  margin-bottom: 5px;
  align-items: flex-start;
  line-height: 1.45;
}
.kfz-include-item::before {
  content: '✓';
  color: var(--kfz-orange);
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Total band */
.kfz-tb-total-row {
  background: var(--kfz-navy);
  padding: 16px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kfz-total-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  margin: 0;
}
.kfz-total-note {
  font-size: 11px;
  color: rgba(255,255,255,.4);
  margin-top: 1px;
}
.kfz-total-amount {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

/* Contact card */
.kfz-tb-contact-header {
  padding: 8px 16px;
  background: var(--kfz-light);
  border-bottom: 1px solid var(--kfz-border);
  font-size: 13px;
  font-weight: 700;
  color: var(--kfz-navy);
}
.kfz-tb-contact-body {
  padding: 16px 16px;
  font-size: 13.5px;
  color: var(--kfz-muted);
  line-height: 1.7;
}
.kfz-tb-contact-body p { margin: 2px 0; }
.kfz-tb-contact-body a {
  color: var(--kfz-navy);
  font-weight: 600;
  text-decoration: none;
}

/* ── Success ──────────────────────────── */
.kfz-tb-success { text-align: center; padding: 48px 16px; }
.kfz-success-icon {
  width: 70px; height: 70px;
  background: var(--kfz-orange);
  color: #fff;
  border-radius: 50%;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.kfz-tb-success h3 {
  font-size: 24px;
  font-weight: 800;
  color: var(--kfz-navy);
  margin-bottom: 8px;
}
.kfz-tb-success p { color: var(--kfz-muted); font-size: 15px; margin: 0; }
.kfz-success-ref {
  display: inline-block;
  margin-top: 16px;
  background: var(--kfz-light);
  border: 1px solid var(--kfz-border);
  border-radius: var(--kfz-radius);
  padding: 8px 24px;
  font-weight: 800;
  color: var(--kfz-navy);
  font-size: 17px;
  letter-spacing: 1.5px;
}

/* ── Service Badge (fester Service oben) ── */
.kfz-service-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--kfz-navy);
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: .2px;
}
.kfz-service-badge svg {
  opacity: .75;
  flex-shrink: 0;
}
.kfz-service-badge img {
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}

/* ── Date input ───────────────────────── */
input[type="date"].kfz-tb-input {
  cursor: pointer;
  min-width: 160px;
}
input[type="date"].kfz-tb-input::-webkit-calendar-picker-indicator {
  opacity: .5;
  cursor: pointer;
}

.kfz-date-hint {
  font-size: 12px;
  margin-top: 5px;
  display: block;
  min-height: 18px;
  line-height: 1.4;
}
.kfz-hint-err { color: #c53030; }
.kfz-hint-ok  { color: #1a7340; font-weight: 600; }

/* ── Upload fields ────────────────────── */
.kfz-upload-fields { margin-top: 16px; }

.kfz-upload-intro {
  font-size: 13px;
  color: var(--kfz-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.kfz-upload-field {
  margin-bottom: 14px;
}

.kfz-upload-field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--kfz-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  display: block;
  margin-bottom: 8px;
}
.kfz-upload-field label .kfz-req { color: var(--kfz-orange); }

.kfz-upload-zone {
  border: 2px dashed var(--kfz-border);
  border-radius: var(--kfz-radius);
  padding: 16px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all .18s;
  background: var(--kfz-white);
  position: relative;
}
.kfz-upload-zone:hover,
.kfz-upload-zone.dragover {
  border-color: var(--kfz-navy);
  background: #f8f9fc;
}
.kfz-upload-zone.has-file {
  border-color: var(--kfz-orange);
  border-style: solid;
  background: #fff7f3;
}
.kfz-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.kfz-upload-icon {
  width: 36px; height: 36px;
  background: var(--kfz-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--kfz-navy);
}
.kfz-upload-zone.has-file .kfz-upload-icon {
  background: rgba(232,84,10,.1);
  color: var(--kfz-orange);
}
.kfz-upload-text { flex: 1; min-width: 0; }
.kfz-upload-text .kfz-upload-hint {
  font-size: 13px;
  color: var(--kfz-muted);
}
.kfz-upload-text .kfz-upload-filename {
  font-size: 13px;
  font-weight: 600;
  color: var(--kfz-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}
.kfz-upload-remove {
  background: none;
  border: none;
  color: var(--kfz-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  flex-shrink: 0;
  transition: color .15s;
}
.kfz-upload-remove:hover { color: #c53030; }

/* ── Upload groups (Vorder-/Rückseite nebeneinander) ── */
.kfz-upload-group {
  margin-bottom: 18px;
}

.kfz-upload-group-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--kfz-navy);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kfz-upload-group-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--kfz-border);
}

.kfz-upload-group-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.kfz-upload-group-row .kfz-upload-field {
  margin-bottom: 0;
}

/* Kompaktere Zone in Gruppen */
.kfz-upload-group-row .kfz-upload-zone {
  padding: 8px;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.kfz-upload-group-row .kfz-upload-text {
  width: 100%;
}

.kfz-upload-group-row .kfz-upload-hint {
  font-size: 12px;
}

.kfz-upload-group-row .kfz-upload-filename {
  font-size: 12px;
  max-width: 100%;
}

/* ── Express-Option ───────────────────── */
.kfz-step-express-icon {
  width: 32px;
  height: 32px;
  background: var(--kfz-orange);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.kfz-express-desc {
  font-size: 14px;
  color: var(--kfz-muted);
  margin-bottom: 8px !important;
  line-height: 1.5;
}

.kfz-express-desc strong {
  color: var(--kfz-orange);
}
