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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 15px;
  color: #333;
  background: #fff;
}

.wrapper {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  color: #222;
  margin-bottom: 28px;
  line-height: 1.3;
}

/* ── Layout ─────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 700px) {
  .layout { grid-template-columns: 1fr; gap: 32px; }
  .benefits-col { order: -1; }
}

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
  padding: 10px 22px;
  border: none;
  background: #1a7a8a;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.3px;
}

.tab-btn:not(.active) {
  background: #5ba0ae;
}

.tab-btn:hover:not(.active) {
  background: #1a7a8a;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Form fields ─────────────────────────────────────────── */
.field-group {
  margin-bottom: 18px;
}

.field-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 6px;
}

.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1a7a8a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  flex-shrink: 0;
  user-select: none;
  position: relative;
}
.help-icon .help-bubble {
  display: none;
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  width: 280px;
  padding: 10px 12px;
  background: #fff;
  color: #333;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  border: 1px solid #e0e0e0;
  z-index: 100;
  cursor: default;
}
.help-icon:hover .help-bubble,
.help-icon:focus .help-bubble {
  display: block;
}

.field-hint {
  display: block;
  font-size: 12px;
  color: #1a7a8a;
  margin-bottom: 4px;
}
.field-hint.warning {
  color: #c97a00;
}

select, input[type="text"], input[type="email"], input[type="tel"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
  color: #333;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: border-color 0.15s;
}

select:focus, input:focus {
  outline: none;
  border-color: #1a7a8a;
  box-shadow: 0 0 0 2px rgba(26,122,138,0.12);
}

select:disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

input[type="text"], input[type="email"], input[type="tel"] {
  background-image: none;
  cursor: text;
}

/* Row for month + year */
.inline-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Row for PKW + Transporter dropdowns: flex so a hidden box yields full width */
.modell-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.modell-row > .field-group {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}
@media (max-width: 600px) {
  .modell-row { flex-direction: column; gap: 0; }
  .modell-row > .field-group { margin-bottom: 16px; }
}

/* ── Statisches Label bei genau 1 Kandidat (Modellvariante etc.) ── */
.static-value {
  padding: 10px 12px;
  background: #f5f7f8;
  border: 1px solid #d8dde0;
  border-radius: 6px;
  color: #333;
  font-weight: 500;
}

/* ── Loading state ───────────────────────────────────────── */
.field-group.loading select {
  color: #aaa;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='12' cy='12' r='10' stroke='%23ccc' stroke-width='2'/%3E%3Cpath d='M12 2a10 10 0 0 1 10 10' stroke='%231a7a8a' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 16px;
}

/* ── Warning / error ─────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.alert.warning {
  background: #fff8e1;
  border: 1px solid #f5c518;
  color: #7a5900;
  display: block;
}

.alert.error {
  background: #fdecea;
  border: 1px solid #e57373;
  color: #b71c1c;
  display: block;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: #6abf3e;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #5aaf2e;
}

.btn-primary:disabled {
  background: #b0b0b0;
  cursor: not-allowed;
}

.btn-secondary {
  background: #1a7a8a;
  color: #fff;
}

.btn-secondary:hover:not(:disabled) {
  background: #156878;
}

/* ── Cascade container ───────────────────────────────────── */
#cascade-container .field-group {
  animation: fadeSlideIn 0.3s ease;
}

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

/* ── Contact ─────────────────────────────────────────────── */
#section-contact {
  margin-top: 8px;
  padding-top: 24px;
  border-top: 2px solid #e0e0e0;
}

#section-contact h3 {
  font-size: 16px;
  font-weight: 700;
  color: #222;
  margin-bottom: 16px;
}

/* ── Thank-you screen ────────────────────────────────────── */
#danke {
  text-align: center;
  padding: 40px 20px;
}

.danke-check {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #6abf3e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.danke-check svg { width: 32px; height: 32px; }

#danke h2 {
  font-size: 22px;
  color: #222;
  margin-bottom: 10px;
}

#danke p {
  color: #555;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Benefits column ─────────────────────────────────────── */
.benefits-col {
  padding-top: 8px;
}

.benefit {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}

.benefit-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #6abf3e;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.benefit-text h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1a7a8a;
  margin-bottom: 6px;
  line-height: 1.3;
}

.benefit-text p {
  font-size: 13px;
  color: #555;
  line-height: 1.6;
}

/* ── Schlüsselnummer tab ─────────────────────────────────── */
.hsn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

.key-hint {
  font-size: 12px;
  color: #888;
  margin-top: 5px;
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  background: #fff;
  border-radius: 8px;
  padding: 28px 24px 24px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.modal-box h3 {
  font-size: 16px;
  font-weight: 700;
  color: #222;
  margin-bottom: 10px;
}

.modal-box p {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ── Separator ───────────────────────────────────────────── */
.section-divider {
  height: 2px;
  background: #e8f4f7;
  margin: 20px 0;
}

/* ── Inline row with field-groups ────────────────────────── */
.inline-row > .field-group { margin-bottom: 0; }

/* ── Extras checkboxes ───────────────────────────────────── */
.extras-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 12px;
  margin-top: 4px;
}

@media (max-width: 700px) {
  .extras-grid { grid-template-columns: repeat(2, 1fr); }
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #1a7a8a;
}

.serie-tag {
  color: #888;
  font-size: 11px;
  font-style: italic;
  margin-left: 2px;
}

.extras-loading {
  color: #888;
  font-size: 13px;
  font-style: italic;
  padding: 8px 0;
}

/* ── Extras: compact trigger + chip summary ─────────────── */
.extras-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  padding: 12px 16px;
  background: #fff;
  border: 2px solid #1a7a8a;
  border-radius: 8px;
  color: #1a7a8a;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.extras-trigger:hover { background: #f0f7f8; box-shadow: 0 2px 8px rgba(26,122,138,.15); }
.extras-trigger-count {
  background: #1a7a8a;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.extras-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.extras-chip {
  display: inline-block;
  padding: 4px 10px;
  background: #eef3f6;
  border: 1px solid #d4dde3;
  border-radius: 12px;
  color: #333;
  font-size: 12px;
  line-height: 1.4;
}

/* ── Modal ──────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-backdrop.is-open { display: flex; }
.extras-modal {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.extras-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 4px;
}
.extras-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: #222;
}
.extras-modal-close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: #888;
  cursor: pointer;
  padding: 4px 8px;
}
.extras-modal-close:hover { color: #222; }
.extras-modal-body {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
}
.extras-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 20px;
}
@media (max-width: 800px) {
  .extras-modal-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .extras-modal-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; }
  .extras-modal { max-height: 100vh; border-radius: 0; }
}
.extras-modal-footer {
  padding: 14px 24px 18px;
  border-top: 1px solid #eee;
}
.btn-modal-done {
  width: 100%;
  padding: 14px;
  background: #6abf3e;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-modal-done:hover { background: #5aaf2e; }

/* ── Textarea ─────────────────────────────────────────────── */
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
  color: #333;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

textarea:focus {
  outline: none;
  border-color: #1a7a8a;
  box-shadow: 0 0 0 2px rgba(26,122,138,0.12);
}

/* ── File upload ─────────────────────────────────────────── */
.upload-area {
  border: 2px dashed #ccc;
  border-radius: 6px;
  padding: 28px 16px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: #1a7a8a;
  background: #f0f8fa;
}

.upload-placeholder svg {
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
}

.upload-placeholder p {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin: 0;
}

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}

.upload-file {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f0f8fa;
  border: 1px solid #b2d8df;
  border-radius: 4px;
  padding: 4px 8px 4px 6px;
  font-size: 12px;
  color: #333;
}

.upload-file img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 2px;
}

.upload-file-del {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 15px;
  padding: 0 2px;
  line-height: 1;
}

.upload-file-del:hover { color: #e57373; }
