:root {
  --ink: #12343a;
  --muted: #60767a;
  --teal: #0b6671;
  --teal-dark: #074b53;
  --teal-soft: #e8f3f4;
  --red: #a71f2b;
  --line: #d7e2e3;
  --paper: #ffffff;
  --canvas: #f3f7f7;
  --danger: #b42331;
  --shadow: 0 18px 45px rgba(18, 52, 58, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .7; }
a { color: inherit; }
.website-field { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.site-header {
  position: sticky; top: 0; z-index: 20; border-top: 7px solid #b40f18;
  border-bottom: 1px solid rgba(215, 226, 227, .9); background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.header-inner { width: 100%; max-width: 1180px; margin: 0 auto; padding: 12px 16px 11px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: block; flex: 0 0 auto; line-height: 0; }
.brand img { height: 48px; width: auto; max-width: none; object-fit: contain; display: block; }
.header-actions { display: flex; align-items: center; gap: 22px; font-size: .9rem; }
.header-actions a { text-decoration: none; white-space: nowrap; }
.practice-link { color: var(--muted); }
.practice-link:hover { color: var(--teal-dark); }
.whatsapp-link { padding: 9px 13px; border: 1px solid rgba(11, 102, 113, .28); border-radius: 999px; color: var(--teal-dark); font-weight: 750; background: rgba(232, 243, 244, .65); }
.whatsapp-link:hover { border-color: rgba(11, 102, 113, .48); background: var(--teal-soft); }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 36px auto 70px; }
.page-identifier { display: flex; align-items: center; gap: 9px; margin: 0 0 18px; color: var(--teal-dark); font-size: .95rem; font-weight: 750; letter-spacing: .01em; }
.page-identifier::before { content: ""; width: 18px; height: 2px; flex: 0 0 auto; background: #b40f18; }
.step-nav { position: relative; margin-bottom: 34px; }
.step-nav ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.step-nav li { display: flex; align-items: center; gap: 10px; color: #789095; font-size: .9rem; position: relative; }
.step-nav li:not(:last-child)::after { content: ""; height: 1px; background: var(--line); flex: 1; margin: 0 18px; }
.step-nav li span { width: 34px; height: 34px; border: 1px solid #bfcfd1; border-radius: 50%; display: grid; place-items: center; background: var(--canvas); font-weight: 700; }
.step-nav li.active, .step-nav li.done { color: var(--teal); }
.step-nav li.active span { background: var(--teal); border-color: var(--teal); color: #fff; box-shadow: 0 0 0 5px rgba(11,102,113,.1); }
.step-nav li.done span { background: var(--teal-soft); border-color: var(--teal); }
.progress-track { display: none; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 30px; align-items: start; }
.form-step { display: none; }
.form-step.active { display: block; animation: enter .25s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
.section-heading { margin: 0 0 24px; }
.eyebrow { margin: 0 0 8px !important; color: var(--red) !important; font-size: .78rem !important; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.section-heading h1 { margin: 0 0 8px; font: 700 clamp(1.75rem, 3vw, 2.35rem)/1.16 Georgia, serif; color: var(--teal-dark); }
.section-heading p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }

.card { background: var(--paper); border: 1px solid rgba(12,77,85,.12); border-radius: 18px; box-shadow: var(--shadow); }
.form-card { padding: 28px; margin-bottom: 18px; }
.form-card h2, .signature-card h2 { margin: 0 0 20px; font: 700 1.15rem/1.2 Georgia, serif; color: var(--teal-dark); }
.form-card.compact { padding-bottom: 24px; }
.field-grid { display: grid; gap: 20px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.address-grid { grid-template-columns: 2fr .75fr .75fr 1.5fr; }
.field-grid label, .typed-name { display: grid; gap: 8px; color: #274e54; font-size: .9rem; font-weight: 700; }
.field-grid label > span, .typed-name > span { color: var(--red); }
.field-grid label small { color: #8a9a9d; font-weight: 500; margin-left: 4px; }
input, select, textarea {
  width: 100%; min-height: 50px; border: 1px solid #cbd8da; border-radius: 10px; background: #fff;
  color: var(--ink); padding: 11px 13px; outline: none; transition: .15s border, .15s box-shadow;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11,102,113,.1); }
.invalid input, .invalid select, .invalid textarea { border-color: var(--danger); background: #fff8f8; }
.invalid::after { content: "Bitte ausfüllen"; color: var(--danger); font-size: .76rem; font-weight: 600; }

.help-card { position: sticky; top: 24px; padding: 26px; border: 1px solid #cfe1e3; background: var(--teal-soft); border-radius: 18px; color: var(--teal-dark); }
.help-mark { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--teal); font-weight: 900; }
.help-card h2 { margin: 18px 0 8px; font: 700 1.25rem Georgia, serif; }
.help-card p { color: #476a70; line-height: 1.55; font-size: .92rem; }
.help-divider { height: 1px; background: #c8dcde; margin: 22px 0; }
.help-card b, .help-card a, .help-card small { display: block; }
.help-card a { margin-top: 8px; font-weight: 800; text-decoration: none; }
.help-card small { margin-top: 5px; color: #668186; }

.pet-card { padding: 28px; margin-bottom: 18px; }
.pet-card-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 22px; }
.pet-index { color: var(--red); font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.pet-card-head h2 { margin: 4px 0 0; font: 700 1.35rem Georgia, serif; color: var(--teal-dark); }
.remove-pet { border: 0; background: none; color: var(--danger); font-size: .84rem; padding: 5px; }
.species-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 22px; }
.species-picker input { position: absolute; opacity: 0; pointer-events: none; }
.species-picker span { height: 64px; border: 1px solid #cbd8da; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; color: #43656b; }
.species-picker svg { width: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.species-picker input:checked + span { border: 2px solid var(--teal); background: var(--teal-soft); color: var(--teal-dark); }
.field-grid .full { grid-column: 1 / -1; }
.add-pet { width: 100%; padding: 20px; border: 1px dashed #91b6bb; border-radius: 16px; color: var(--teal); background: transparent; font-weight: 800; }
.add-pet span { font-size: 1.3rem; vertical-align: -1px; margin-right: 5px; }

.legal-card { padding: 28px; margin-bottom: 18px; }
.legal-title { display: flex; align-items: center; gap: 14px; }
.legal-title h2 { margin: 0; font: 700 1.25rem Georgia, serif; color: var(--teal-dark); }
.legal-title p { margin: 4px 0 0; color: var(--muted); font-size: .87rem; }
.legal-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-weight: 900; font-size: .8rem; }
.legal-copy { margin: 22px 0; padding: 18px 20px; background: #f7fafa; border-left: 3px solid #aacdd1; color: #48676c; font-size: .9rem; line-height: 1.6; }
.legal-copy p { margin: 0 0 10px; }
.legal-copy p:last-child { margin-bottom: 0; }
.check-row { display: flex; align-items: flex-start; gap: 12px; color: #294d52; line-height: 1.45; cursor: pointer; }
.check-row + .check-row { margin-top: 16px; }
.check-row input { width: 21px; min-height: 21px; margin-top: 1px; accent-color: var(--teal); flex: 0 0 auto; }
.check-row em { color: var(--red); font-style: normal; }
.check-row.optional { padding-top: 16px; border-top: 1px solid var(--line); color: #526e73; }
.signature-card { padding: 28px; }
.signature-card p { color: var(--muted); margin: -12px 0 20px; }
#signaturePad { width: 100%; height: 175px; border: 1px dashed #89aeb3; border-radius: 12px; background: linear-gradient(#fff 80%, #f4f8f8 80%); touch-action: none; display: block; }
.signature-actions { display: flex; justify-content: space-between; margin: 8px 0 20px; color: #819396; font-size: .8rem; }
.signature-actions button { border: 0; background: none; color: var(--teal); font-weight: 700; padding: 0; }
.signature-card.signature-invalid canvas { border-color: var(--danger); background: #fff8f8; }

.review-stack { display: grid; gap: 16px; }
.review-card { padding: 26px; }
.review-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.review-card h2 { margin: 0; font: 700 1.15rem Georgia, serif; color: var(--teal-dark); }
.review-card button { border: 0; background: none; color: var(--teal); font-weight: 800; }
.review-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px 24px; }
.review-item { display: grid; gap: 3px; }
.review-item small { color: #829397; }
.review-item span { color: #274a50; font-weight: 650; }
.final-note { margin-top: 18px; padding: 20px 22px; display: flex; gap: 14px; background: var(--teal-soft); box-shadow: none; }
.final-note svg { width: 30px; min-width: 30px; fill: none; stroke: var(--teal); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.final-note div { display: grid; gap: 4px; }
.final-note span { color: #5a7479; font-size: .88rem; }

.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 26px; }
.button { min-height: 52px; padding: 0 28px; border-radius: 10px; font-weight: 800; border: 1px solid transparent; }
.button.primary { color: #fff; background: var(--teal); box-shadow: 0 8px 20px rgba(11,102,113,.16); }
.button.primary:hover { background: var(--teal-dark); }
.button.secondary { border-color: #b8cbce; background: transparent; color: var(--teal); }
.button.submit { padding-inline: 34px; }
.submit-status { min-height: 1.4em; margin: 12px 0 0; color: var(--muted); text-align: right; font-size: .9rem; }
.submit-status.error { color: var(--danger); font-weight: 700; }
.registration-number { padding: 10px 12px; border-radius: 10px; background: var(--teal-soft); color: var(--teal-dark) !important; font-size: .85rem; overflow-wrap: anywhere; }

footer { min-height: 80px; padding: 22px clamp(20px, 5vw, 72px); background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; color: #718589; font-size: .8rem; }
footer span:last-child { display: flex; gap: 20px; }

dialog { width: min(520px, calc(100% - 32px)); border: 0; border-radius: 22px; padding: 38px; color: var(--ink); text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.2); }
dialog::backdrop { background: rgba(6,41,46,.68); backdrop-filter: blur(3px); }
.success-symbol { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-size: 2rem; font-weight: 900; }
dialog h2 { font: 700 1.7rem Georgia, serif; color: var(--teal-dark); margin: 0 0 12px; }
dialog p { color: var(--muted); line-height: 1.6; margin-bottom: 24px; }
.success-actions { display: grid; gap: 12px; }
.success-actions .button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.success-close { justify-self: center; padding: 6px 10px; border: 0; background: transparent; color: var(--teal); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

@media (max-width: 850px) {
  .header-inner { padding: 10px 14px 9px; gap: 14px; }
  .brand img { height: 42px; width: auto; max-width: none; object-fit: contain; display: block; }
  .practice-link { display: none; }
  .header-actions { gap: 0; font-size: .82rem; }
  .whatsapp-link { padding: 8px 11px; }
  .page-shell { width: min(100% - 28px, 720px); margin-top: 24px; }
  .page-identifier { margin-bottom: 14px; font-size: .9rem; }
  .workspace { display: block; }
  .help-card { display: none; }
  .step-nav ol li b { display: none; }
  .step-nav li { gap: 0; }
  .step-nav li:not(:last-child)::after { margin: 0 10px; }
  .step-nav li span { width: 30px; height: 30px; }
  .section-heading h1 { font-size: 1.75rem; }
  #registrationForm, .form-step, .field-grid, .field-grid > label, .pet-card, .pet-fields { min-width: 0; }
  input[type="date"] {
    display: block;
    width: 100%;
    inline-size: 100%;
    max-width: 100%;
    max-inline-size: 100%;
    min-width: 0;
    min-inline-size: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    overflow: hidden;
  }
}

@media (max-width: 620px) {
  .page-shell { width: calc(100% - 24px); margin-bottom: 45px; }
  .form-card, .pet-card, .legal-card, .signature-card { padding: 20px; border-radius: 15px; }
  .field-grid.two, .address-grid, .review-grid { grid-template-columns: 1fr; }
  .address-grid .street, .address-grid .city { grid-column: auto; }
  .species-picker { grid-template-columns: 1fr 1fr; }
  .pet-fields .full { grid-column: auto; }
  .form-actions { position: sticky; bottom: 0; z-index: 3; margin-inline: -12px; padding: 12px; background: rgba(243,247,247,.94); backdrop-filter: blur(8px); }
  .form-actions .button { flex: 1; padding-inline: 12px; }
  footer { display: grid; gap: 12px; }
}

@media print {
  .site-header, .step-nav, .help-card, .form-actions, footer { display: none !important; }
  .page-shell { width: 100%; margin: 0; }
  .workspace { display: block; }
  .form-step { display: none !important; }
  .form-step[data-step="3"] { display: block !important; }
  .card { box-shadow: none; break-inside: avoid; }
}
