:root {
  --page: #f4f7f9;
  --surface: #ffffff;
  --surface-subtle: #f8fafb;
  --ink: #14283a;
  --copy: #2c4255;
  --muted: #5f7181;
  --line: #d9e2e9;
  --line-strong: #bdcbd6;
  --navy: #0b2a47;
  --blue: #1768d2;
  --blue-dark: #0f56b3;
  --blue-pale: #edf5ff;
  --blue-wash: #f6faff;
  --green: #16745a;
  --red: #aa2e25;
  --red-pale: #fff3f1;
  --shadow: 0 18px 55px rgba(24, 55, 80, 0.08);
  --reader-body-size: 17.5px;
  --reader-copy-size: 18px;
  --reader-choice-size: 16.5px;
  --reader-field-size: 17px;
  --reader-label-size: 13.5px;
  --reader-hero-size: 17.5px;
}

html[data-reader-size="0"] {
  --reader-body-size: 16.5px;
  --reader-copy-size: 17px;
  --reader-choice-size: 15.5px;
  --reader-field-size: 16px;
  --reader-label-size: 13px;
  --reader-hero-size: 16.5px;
}

html[data-reader-size="2"] {
  --reader-body-size: 19.5px;
  --reader-copy-size: 20px;
  --reader-choice-size: 18px;
  --reader-field-size: 18.5px;
  --reader-label-size: 14.5px;
  --reader-hero-size: 19px;
}

html[data-reader-size="3"] {
  --reader-body-size: 21px;
  --reader-copy-size: 21.5px;
  --reader-choice-size: 19.5px;
  --reader-field-size: 20px;
  --reader-label-size: 15.5px;
  --reader-hero-size: 20.5px;
}

html[data-reader-size="4"] {
  --reader-body-size: 23px;
  --reader-copy-size: 23.5px;
  --reader-choice-size: 21.5px;
  --reader-field-size: 22px;
  --reader-label-size: 17px;
  --reader-hero-size: 22.5px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(220, 232, 241, 0.34), transparent 260px),
    var(--page);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--reader-body-size);
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
label,
summary {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--blue-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid rgba(191, 204, 214, 0.9);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
}

.site-header-inner {
  width: min(1460px, calc(100% - 48px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-logo {
  width: 62px;
  height: 54px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
}

.site-logo img {
  width: 62px;
  height: 54px;
  display: block;
  object-fit: contain;
}

.site-title-block {
  min-width: 0;
  padding-left: 18px;
  border-left: 1px solid var(--line-strong);
}

.site-title-main {
  color: var(--navy);
  font-size: 18px;
  font-weight: 790;
  letter-spacing: -0.025em;
}

.site-title-sub {
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0.025em;
}

.text-size-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
}

.text-size-label {
  margin-right: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.text-size-button {
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--navy);
  background: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: 150ms ease;
}

.text-size-status {
  min-width: 48px;
  color: #526779;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 780;
  text-align: center;
}

.text-size-button:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue-dark);
  background: var(--blue-wash);
}

.text-size-button:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(23, 104, 210, 0.2);
  outline-offset: 2px;
}

.text-size-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-wrapper {
  width: min(1460px, calc(100% - 48px));
  margin: 0 auto;
}

.form-card {
  padding-bottom: 54px;
}

.form-intro {
  position: relative;
  padding: clamp(38px, 5vw, 70px) 0 clamp(30px, 4vw, 52px);
  border-bottom: 1px solid var(--line-strong);
}

.form-intro::before {
  content: "";
  width: 58px;
  height: 5px;
  margin-bottom: 24px;
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), #58a7ed);
}

.form-intro h1 {
  max-width: 1300px;
  margin: 0;
  color: var(--navy);
  font-size: clamp(32px, 3.7vw, 52px);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.048em;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-wrap: balance;
}

.form-intro > p {
  max-width: 920px;
  margin: 20px 0 0;
  color: var(--copy);
  font-size: var(--reader-hero-size);
  line-height: 1.62;
}

#checklistForm {
  padding-top: 22px;
}

.flow-progress {
  position: sticky;
  z-index: 40;
  top: 78px;
  margin: 0 0 28px;
  padding: 14px 0 12px;
  border-bottom: 1px solid rgba(193, 207, 218, 0.94);
  background: rgba(244, 247, 249, 0.97);
  backdrop-filter: blur(15px);
}

.flow-progress-head {
  margin-bottom: 10px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.flow-progress-copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.flow-progress-label {
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.flow-current-title {
  overflow: hidden;
  color: var(--navy);
  font-size: 14px;
  font-weight: 730;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-progress-percent {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.flow-progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe7ed;
}

.flow-progress-value {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #48a6e8);
  transition: width 260ms ease;
}

.flow-step-list {
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
  list-style: none;
}

.flow-step-button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 6px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: 150ms ease;
}

.flow-step-button:hover:not(:disabled) {
  border-color: #cbdceb;
  color: var(--blue-dark);
  background: rgba(255, 255, 255, 0.8);
}

.flow-step-button:disabled {
  color: #a6b2bc;
  cursor: not-allowed;
  opacity: 0.58;
}

.flow-step-index {
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.flow-step-name {
  max-width: 100%;
  overflow: hidden;
  font-size: 10px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-step-button.is-current {
  border-color: #b8d6f3;
  color: var(--blue-dark);
  background: #fff;
  box-shadow: 0 5px 16px rgba(33, 88, 132, 0.08);
}

.flow-step-button.is-complete {
  color: var(--green);
}

.flow-enabled .flow-step {
  display: none;
}

.flow-enabled .flow-step.is-active {
  display: block;
  animation: section-in 220ms ease-out;
}

@keyframes section-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.form-section,
.flow-final-step {
  width: 100%;
  margin: 0;
  scroll-margin-top: 220px;
  padding: clamp(28px, 3.6vw, 52px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow:
    0 1px 1px rgba(24, 55, 80, 0.025),
    0 18px 55px rgba(24, 55, 80, 0.075);
}

.form-section-header {
  margin-bottom: clamp(26px, 3vw, 40px);
  padding-bottom: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid var(--line);
}

.form-section-title,
.signature-title {
  max-width: 1120px;
  color: var(--navy);
  font-size: clamp(26px, 2.5vw, 38px);
  font-weight: 760;
  line-height: 1.18;
  letter-spacing: -0.04em;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.form-section-code {
  min-width: 46px;
  height: 46px;
  padding: 0 10px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #bed8ef;
  border-radius: 14px;
  color: var(--blue-dark);
  background: var(--blue-pale);
  font-size: 13px;
  font-weight: 850;
}

.form-section-body {
  display: block;
}

.section-text {
  width: min(100%, 1080px);
  color: var(--copy);
  font-size: var(--reader-copy-size);
  line-height: 1.72;
}

.section-text p {
  margin: 0 0 15px;
}

.section-text p:last-child,
.section-text ul:last-child {
  margin-bottom: 0;
}

.section-text strong {
  color: var(--navy);
  font-weight: 780;
}

.section-text ul {
  margin: 6px 0 18px;
  padding-left: 1.35em;
}

.section-text li {
  margin-bottom: 8px;
  padding-left: 0.25em;
}

.contact-block {
  margin: 20px 0;
  padding: 18px 20px;
  border-left: 4px solid var(--blue);
  color: var(--copy);
  background: var(--surface-subtle);
}

.section-input-panel {
  position: static;
  width: 100%;
  margin-top: clamp(30px, 4vw, 48px);
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid #bcd5ea;
  border-top: 5px solid var(--blue);
  border-radius: 18px;
  background: var(--blue-wash);
  box-shadow: none;
}

.section-input-panel-title {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-size: clamp(18px, 1.6vw, 23px);
  font-weight: 790;
  letter-spacing: -0.025em;
}

.section-input-panel-title::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border: 3px solid #9dc8ec;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(23, 104, 210, 0.08);
}

.checkbox-list {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  list-style: none;
}

.checkbox-list li {
  min-height: 62px;
  padding: 13px 14px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid #cfdeea;
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
  transition: 150ms ease;
}

.checkbox-list li:hover {
  border-color: #94bee4;
  transform: translateY(-1px);
}

.checkbox-list li.is-checked {
  border-color: #72b49d;
  background: #edf8f3;
  box-shadow: inset 0 0 0 1px rgba(22, 116, 90, 0.08);
}

.checkbox-list input[type="checkbox"],
.kundentyp-row input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--blue);
}

.checkbox-label-text {
  color: var(--copy);
  font-size: var(--reader-choice-size);
  line-height: 1.48;
  cursor: pointer;
}

.notes-label,
.form-label {
  display: block;
  color: #344b5e;
  font-size: var(--reader-label-size);
  font-weight: 790;
  letter-spacing: 0.01em;
}

.notes-label {
  margin: 22px 0 8px;
}

.notes-textarea,
.form-input,
.form-textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  font-size: var(--reader-field-size);
  transition: 150ms ease;
}

.form-input {
  min-height: 50px;
  padding: 11px 13px;
}

.notes-textarea,
.form-textarea {
  min-height: 118px;
  padding: 13px 14px;
  resize: vertical;
  line-height: 1.58;
}

.notes-textarea:hover,
.form-input:hover,
.form-textarea:hover {
  border-color: #91aac0;
}

.notes-textarea:focus,
.form-input:focus,
.form-textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(23, 104, 210, 0.13);
}

[aria-invalid="true"] {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(170, 46, 37, 0.1) !important;
}

.customer-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 30px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-col {
  min-width: 0;
  margin-bottom: 18px;
  flex: 1 1 0;
}

.form-col.address-number {
  flex: 0 1 150px;
}

.form-col.address-postcode {
  flex: 0 1 180px;
}

.kundentyp-row {
  margin-bottom: 18px;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-subtle);
}

.kundentyp-row-label {
  grid-column: 1 / -1;
  color: #344b5e;
  font-size: var(--reader-label-size);
  font-weight: 790;
}

.kundentyp-row > label {
  min-height: 52px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #d1dde6;
  border-radius: 12px;
  color: var(--copy);
  background: #fff;
  cursor: pointer;
}

.kundentyp-row > label.is-selected {
  border-color: #78abe0;
  color: var(--navy);
  background: var(--blue-pale);
}

.info-icon {
  width: 20px;
  height: 20px;
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

details.kundentyp-popup {
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid #ccdae5;
  border-radius: 12px;
  background: #fff;
}

.kundentyp-popup summary {
  min-height: 48px;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 780;
  list-style: none;
  cursor: pointer;
}

.kundentyp-popup summary::-webkit-details-marker {
  display: none;
}

.kundentyp-popup summary::after {
  content: "+";
  width: 26px;
  height: 26px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: var(--blue-dark);
  background: var(--blue-pale);
  font-size: 18px;
  transition: transform 160ms ease;
}

.kundentyp-popup[open] summary::after {
  transform: rotate(45deg);
}

.kundentyp-popup-content {
  padding: 0 16px 16px;
  color: var(--copy);
  font-size: 15px;
  line-height: 1.64;
}

.flow-actions {
  margin-top: 24px;
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
}

.flow-action-button,
.button-secondary,
.button-primary {
  min-height: 48px;
  padding: 11px 19px;
  border-radius: 12px;
  font-weight: 790;
  cursor: pointer;
  transition: 150ms ease;
}

.flow-action-button,
.button-secondary {
  border: 1px solid var(--line-strong);
  color: var(--navy);
  background: #fff;
}

.flow-action-button:hover:not(:disabled),
.button-secondary:hover {
  border-color: #93b7d7;
  background: var(--blue-wash);
}

.flow-action-button[data-flow-next],
.button-primary {
  margin-left: auto;
  border: 1px solid var(--blue);
  color: #fff;
  background: linear-gradient(135deg, #2578d8, var(--blue-dark));
  box-shadow: 0 10px 24px rgba(23, 104, 210, 0.18);
}

.flow-action-button[data-flow-next]:hover,
.button-primary:hover {
  background: linear-gradient(135deg, #1b68c4, #0d4da0);
  transform: translateY(-1px);
}

.flow-action-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.signature-wrapper {
  width: min(100%, 1120px);
}

.signature-desc {
  margin: 14px 0 20px;
  color: var(--copy);
  font-size: var(--reader-copy-size);
  line-height: 1.68;
}

.signature-pad-container {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background:
    linear-gradient(180deg, transparent calc(100% - 40px), #e6edf2 calc(100% - 39px), transparent calc(100% - 38px)),
    #fff;
}

#signature-pad {
  width: 100%;
  height: 210px;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

.signature-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.signature-actions .signature-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-submit-row {
  margin-top: 28px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid #bdd5eb;
  border-radius: 16px;
  background: var(--blue-wash);
}

.submit-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.error-message {
  position: sticky;
  z-index: 45;
  bottom: 16px;
  width: min(760px, calc(100% - 24px));
  margin: 18px auto 0;
  padding: 14px 17px;
  border: 1px solid #e5a9a3;
  border-radius: 13px;
  color: #91251e;
  background: rgba(255, 243, 241, 0.98);
  box-shadow: 0 14px 36px rgba(80, 31, 26, 0.14);
  font-weight: 680;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
}

.site-footer-inner {
  width: min(1460px, calc(100% - 48px));
  min-height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 12px;
}

.footer-left,
.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-sep {
  color: #a4b1bb;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 1040px) {
  .flow-step-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .customer-data-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (max-width: 720px) {
  .site-header-inner,
  .page-wrapper,
  .site-footer-inner {
    width: min(100% - 22px, 1460px);
  }

  .site-header-inner {
    min-height: 70px;
    gap: 11px;
  }

  .site-logo,
  .site-logo img {
    width: 52px;
    height: 46px;
  }

  .site-title-block {
    padding-left: 11px;
  }

  .site-title-main {
    font-size: 15px;
  }

  .site-title-sub,
  .text-size-label {
    display: none;
  }

  .text-size-status {
    min-width: 42px;
    font-size: 10px;
  }

  .text-size-button {
    width: 36px;
    height: 36px;
  }

  .form-intro {
    padding: 32px 0 29px;
  }

  .form-intro::before {
    width: 42px;
    height: 4px;
    margin-bottom: 18px;
  }

  .form-intro h1 {
    font-size: clamp(26px, 8vw, 38px);
    line-height: 1.1;
  }

  .form-intro > p {
    margin-top: 15px;
  }

  #checklistForm {
    padding-top: 12px;
  }

  .flow-progress {
    top: 70px;
    margin-bottom: 18px;
    padding-top: 10px;
  }

  .flow-progress-copy {
    display: block;
  }

  .flow-current-title {
    display: block;
    margin-top: 1px;
  }

  .flow-step-list {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .flow-step-list li {
    min-width: 96px;
  }

  .form-section,
  .flow-final-step {
    padding: 23px 18px;
    scroll-margin-top: 205px;
    border-radius: 18px;
  }

  .form-section-header {
    margin-bottom: 25px;
    padding-bottom: 16px;
  }

  .form-section-title,
  .signature-title {
    font-size: clamp(24px, 7vw, 31px);
  }

  .form-section-code {
    min-width: 40px;
    height: 40px;
  }

  .section-text {
    line-height: 1.68;
  }

  .section-input-panel {
    margin-top: 28px;
    padding: 19px 15px;
    border-radius: 14px;
  }

  .checkbox-list,
  .kundentyp-row {
    grid-template-columns: 1fr;
  }

  .form-row {
    display: block;
  }

  .form-col.address-number,
  .form-col.address-postcode {
    max-width: none;
  }

  .flow-actions {
    align-items: stretch;
  }

  .flow-action-button {
    flex: 1 1 0;
  }

  .signature-actions,
  .form-submit-row,
  .site-footer-inner {
    align-items: stretch;
    flex-direction: column;
  }

  .button-primary {
    width: 100%;
  }

  .footer-sep {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .site-header,
  .flow-progress,
  .flow-actions,
  .site-footer {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .page-wrapper {
    width: 100%;
  }

  .flow-enabled .flow-step,
  .form-section,
  .flow-final-step {
    display: block !important;
    break-inside: avoid;
    box-shadow: none;
  }
}
