@font-face { font-family: Poppins; font-weight: 400; font-display: swap; src: url(fonts/poppins-400.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 500; font-display: swap; src: url(fonts/poppins-500.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 600; font-display: swap; src: url(fonts/poppins-600.woff2) format("woff2"); }

:root {
  --navy: #1c2548;
  --blue: #2e55e4;
  --blue-2: #7089e6;
  --ink: #1c2548;
  --text: #3a4060;
  --muted: #6b7088;
  --line: #dfe3ee;
  --field: #f6f7fb;
  --bg: #eef1f8;
  --white: #fff;
  --error: #c62f3c;
  --ok: #1f9d6b;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(112,137,230,.28), transparent 60%),
    radial-gradient(900px 400px at -10% 10%, rgba(46,85,228,.12), transparent 60%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* Header */
.topbar { padding: 22px 0; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { height: 40px; width: auto; display: block; }
.badge {
  font-size: 12px; font-weight: 500; color: var(--navy);
  background: rgba(255,255,255,.7); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}

/* Intro */
.intro { padding: 28px 0 28px; }
h1 { font-size: clamp(28px, 6vw, 40px); line-height: 1.15; color: var(--navy); font-weight: 600; margin: 0 0 12px; letter-spacing: -.01em; }
.lead { font-size: 16px; max-width: 600px; margin: 0 0 22px; }
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--navy); font-weight: 500; }
.steps li { display: flex; align-items: center; gap: 8px; }
.steps span {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: #fff; font-size: 12px; font-weight: 600;
}

/* Card */
.card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(28,37,72,.06), 0 12px 40px rgba(28,37,72,.08);
  padding: 8px 32px 32px;
  margin-bottom: 40px;
}
fieldset { border: 0; margin: 0; padding: 26px 0 6px; border-bottom: 1px solid var(--line); }
fieldset:last-of-type { border-bottom: 0; }
legend {
  display: flex; align-items: center; gap: 10px; float: left; width: 100%;
  font-size: 17px; font-weight: 600; color: var(--navy); margin-bottom: 18px;
}
legend small { font-weight: 400; color: var(--muted); font-size: 14px; }
legend + * { clear: both; }
.num { font-size: 12px; font-weight: 600; color: var(--blue); background: rgba(46,85,228,.09); border-radius: 6px; padding: 2px 7px; }

/* Fields */
.row { display: flex; gap: 16px; }
.grow { flex: 1; min-width: 0; }
.plz { width: 120px; flex: none; }
.narrow input { max-width: 220px; }
.field { margin-bottom: 18px; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--navy); margin-bottom: 6px; }
input[type=text], input[type=email], input:not([type]) {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--field); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 11px 14px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder { color: #a5aac0; }
input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(46,85,228,.12); }
input.readonly { color: var(--muted); cursor: default; }
input.readonly:focus { border-color: var(--line); box-shadow: none; background: var(--field); }
#kundennummer { font-size: 18px; font-weight: 600; letter-spacing: .12em; }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.error-msg { display: none; font-size: 12.5px; color: var(--error); margin: 6px 0 0; font-weight: 500; }
.field.invalid input { border-color: var(--error); background: #fff8f8; }
.field.invalid .error-msg, .error-msg.block.show { display: block; }
.field.invalid .sig { border-color: var(--error); }

/* Contract */
.contract {
  display: flex; gap: 18px; align-items: center; justify-content: space-between;
  background: var(--field); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 18px;
}
.contract p { margin: 0 0 6px; font-size: 14px; }
.contract p:last-child { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; font-weight: 400; color: var(--text); margin-bottom: 12px; cursor: pointer; }
.check input { appearance: none; flex: none; width: 20px; height: 20px; margin: 2px 0 0; border: 1.5px solid #b8bed3; border-radius: 6px; background: #fff; cursor: pointer; display: grid; place-items: center; transition: background .15s, border-color .15s; }
.check input::after { content: ""; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px,-1px); opacity: 0; }
.check input:checked { background: var(--blue); border-color: var(--blue); }
.check input:checked::after { opacity: 1; }
.check input:focus-visible { box-shadow: 0 0 0 4px rgba(46,85,228,.18); outline: none; }
.check.invalid input { border-color: var(--error); }

/* Signature */
.sig {
  position: relative; height: 190px; border: 1.5px dashed #b8bed3; border-radius: var(--radius);
  background: #fff; touch-action: none; overflow: hidden; transition: border-color .15s;
}
.sig.active { border-style: solid; border-color: var(--blue); }
.sig canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.sig-placeholder { position: absolute; left: 0; right: 0; top: 42%; text-align: center; color: #a5aac0; font-size: 14px; pointer-events: none; transition: opacity .2s; }
.sig.signed .sig-placeholder { opacity: 0; }
.sig-line { position: absolute; left: 24px; right: 24px; bottom: 40px; border-bottom: 1px solid #c9cee0; pointer-events: none; }
.sig-clear {
  position: absolute; right: 10px; top: 10px; font: inherit; font-size: 12.5px; font-weight: 500;
  color: var(--muted); background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; cursor: pointer;
}
.sig-clear:hover { color: var(--navy); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: inherit; font-weight: 500; font-size: 15px; text-decoration: none; cursor: pointer;
  border-radius: 12px; padding: 13px 22px; border: 0; transition: transform .1s, box-shadow .15s, background .15s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%); box-shadow: 0 6px 20px rgba(46,85,228,.3); }
.btn-primary:hover { box-shadow: 0 8px 26px rgba(46,85,228,.4); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { color: var(--navy); background: #fff; border: 1.5px solid var(--line); white-space: nowrap; flex: none; }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

.submit-row { padding-top: 26px; }
.submit-row .btn-primary { width: 100%; font-size: 16px; padding: 16px; }
.spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.loading .spinner { display: inline-block; }
.loading { pointer-events: none; opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-error { color: var(--error); font-weight: 500; font-size: 14px; margin: 12px 0 0; text-align: center; }
.form-error:empty { display: none; }
.privacy { font-size: 12px; color: var(--muted); margin: 16px 0 0; text-align: center; }
.privacy a { color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Success */
.success { text-align: center; padding: 48px 32px 36px; }
.success h2 { color: var(--navy); font-size: 22px; font-weight: 600; margin: 18px 0 8px; }
.success p { margin: 0 auto 22px; max-width: 480px; }
.success .muted { margin: 18px 0 0; }
.success-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue), var(--blue-2)); box-shadow: 0 8px 24px rgba(46,85,228,.3); }
.success-icon svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.note-warn { background: #fff7e8; border: 1px solid #f2d9a6; color: #7a5410; border-radius: 10px; padding: 12px 16px; font-size: 14px; text-align: left; }

/* Footer */
.footer { margin-top: auto; padding: 22px 0 28px; font-size: 12.5px; color: var(--muted); }
.footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 18px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--navy); }

@media (max-width: 600px) {
  .card { padding: 4px 18px 22px; border-radius: 16px; }
  .row { flex-direction: column; gap: 0; }
  .plz { width: 100%; }
  .contract { flex-direction: column; align-items: stretch; }
  .logo { height: 32px; }
  .badge { display: none; }
  .sig { height: 170px; }
}
