/* ===== Foundation ===== */
*,*::before,*::after{box-sizing:border-box}

:root {
  --blue: #005aa9;
  --blue-dark: #003d73;
  --orange: #f58220;
  --orange-light: #fff5eb;
  --bg: #f3f6fa;
  --white: #ffffff;
  --gray-50: #f8f9fb;
  --gray-100: #f0f2f5;
  --gray-200: #e1e5eb;
  --gray-300: #c9cfd8;
  --gray-400: #9ca3ae;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --danger: #dc2626;
  --success: #16a34a;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
  --transition: 0.15s ease;
}

html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--gray-800);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ===== Page layout ===== */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 40px;
}

.card {
  width: 100%;
  max-width: 680px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 32px 28px 36px;
  position: relative;
}

/* ===== Header ===== */
.header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-200);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 16px;
}

.logo {
  height: 36px;
  width: auto;
  display: block;
}

.contact-info {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.contact-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-800);
}

.contact-role {
  font-size: 12px;
  color: var(--gray-400);
}

.header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.3;
}

.subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--gray-600);
}

/* ===== Form structure ===== */
#leadForm {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.section {
  padding: 22px 0 18px;
  border-top: 1px solid var(--gray-200);
}

.section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
  margin: 0 0 16px;
}

.section-hint {
  font-size: 13px;
  color: var(--gray-600);
  margin: -8px 0 12px;
}

.muted {
  color: var(--gray-400);
}

/* ===== Fields ===== */
.field {
  margin-bottom: 14px;
}

.field:last-child {
  margin-bottom: 0;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 5px;
}

.field label abbr {
  color: var(--orange);
  text-decoration: none;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="date"],
.field select {
  display: block;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.field select {
  cursor: pointer;
}

.field input:focus,
.field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 90, 169, 0.1);
}

.field input::placeholder {
  color: var(--gray-400);
}

/* Two-column row */
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.row-2 .field {
  margin-bottom: 14px;
}

/* Half-width field on desktop */
.field-half {
  max-width: 50%;
}

/* ===== Chips (Mehrfachauswahl) ===== */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: #f0f5fb;
}

/* Hide the native checkbox completely */
.chip input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Active / checked state */
.chip:has(input:checked),
.chip.is-checked {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
  box-shadow: 0 1px 4px rgba(0, 90, 169, 0.2);
}

.chip:has(input:checked):hover,
.chip.is-checked:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: var(--white);
}

/* Disabled state (max reached) */
.chip.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.field-hint {
  font-size: 12px;
  color: var(--orange);
  margin: 6px 0 0;
  min-height: 16px;
}

/* ===== Consent row ===== */
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 14px;
  transition: border-color var(--transition);
}

.consent-row:hover {
  border-color: var(--blue);
}

.consent-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 2px solid var(--gray-300);
  border-radius: 4px;
  background: var(--white);
  margin-top: 1px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
}

.consent-row input[type="checkbox"]:checked {
  background: var(--blue);
  border-color: var(--blue);
}

.consent-row input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.consent-row span {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  line-height: 1.45;
}

.consent-row abbr {
  color: var(--orange);
  text-decoration: none;
}

/* ===== Form footer ===== */
.form-footer {
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
  margin-top: 4px;
}

.form-status {
  font-size: 13px;
  margin: 0 0 10px;
  min-height: 18px;
  color: var(--danger);
}

.form-status:empty {
  margin: 0;
}

.form-status.success {
  color: var(--success);
}

/* Submit button */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  padding: 0 24px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  background: linear-gradient(135deg, var(--orange), #ff9e4d);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform var(--transition), filter var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(245, 130, 32, 0.25);
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245, 130, 32, 0.35);
  filter: brightness(1.03);
}

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

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  display: none;
  animation: spin 0.8s linear infinite;
}

.btn-submit.is-loading .btn-label { display: none; }
.btn-submit.is-loading .btn-spinner { display: block; }

/* ===== Success banner ===== */
.success-banner {
  position: absolute;
  inset: 0;
  background: var(--white);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 28px;
  z-index: 10;
}

.success-banner[hidden] {
  display: none;
}

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #dcfce7;
  color: var(--success);
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.success-banner h2 {
  margin: 0;
  font-size: 22px;
  color: var(--gray-900);
}

.success-banner p {
  margin: 8px 0 24px;
  font-size: 14px;
  color: var(--gray-600);
  max-width: 36ch;
  line-height: 1.55;
}

.btn-secondary {
  height: 40px;
  padding: 0 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  background: transparent;
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: var(--blue);
  color: var(--white);
}

/* ===== Page footer ===== */
.page-footer {
  margin-top: 20px;
  text-align: center;
}

.page-footer a {
  font-size: 12px;
  color: var(--gray-400);
  text-decoration: none;
}

.page-footer a:hover {
  color: var(--blue);
}

/* ===== Animations ===== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Responsive ===== */
@media (min-width: 640px) {
  .page { padding: 40px 20px 60px; }
  .card { padding: 40px 36px 44px; }
  .header h1 { font-size: 22px; }
  .logo { height: 40px; }
}

@media (max-width: 540px) {
  .card { padding: 24px 18px 28px; border-radius: var(--radius); }
  .row-2 { grid-template-columns: 1fr; gap: 0; }
  .field-half { max-width: 100%; }
  .header-top { flex-wrap: wrap; }
  .logo { height: 30px; }
  .header h1 { font-size: 18px; }
  .chip { font-size: 12px; height: 30px; padding: 0 11px; }
  .section { padding: 18px 0 14px; }
}
