/* Mandantenportal – Engelhardt Rechtsanwaltskanzlei
   Farben & Schriften angelehnt an engelhardt-rechtsanwaelte.de */

@font-face { font-family: "Figtree"; font-weight: 600; font-display: swap; src: url("fonts/figtree-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 700; font-display: swap; src: url("fonts/figtree-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url("fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url("fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 700; font-display: swap; src: url("fonts/source-sans-3-latin-700-normal.woff2") format("woff2"); }

:root {
  --primary: #194A54;
  --secondary: #13343B;
  --text: #22343A;
  --text-2: #4A5B60;
  --gold: #C2AA78;
  --gold-dark: #7A6032;
  --gold-light: #E7DDC6;
  --sand: #F5F2EA;
  --line: #DCD6C8;
  --moos: #6F949B;
  --ice: #DDE7E9;
  --error: #B3261E;
  --error-bg: #FBEDEC;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(19, 52, 59, .08);
  --font-head: "Figtree", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body { margin: 0; font-family: var(--font-body); font-size: 18px; line-height: 1.55; color: var(--text); background: #fff; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--primary); }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--primary); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 600; letter-spacing: -.4px; }
h2 { font-size: clamp(24px, 3vw, 30px); font-weight: 600; }
h3 { font-size: 20px; font-weight: 700; }
h4 { font-size: 17px; font-weight: 700; color: var(--secondary); }
p { margin: 0 0 1em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Kopf ---------- */
.topbar { background: var(--primary); color: #fff; font-size: 15px; }
.topbar .wrap { display: flex; justify-content: flex-end; gap: 28px; padding-top: 9px; padding-bottom: 9px; flex-wrap: wrap; }
.topbar a { color: #fff; text-decoration: none; font-family: var(--font-head); font-weight: 700; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 86px; }
.site-header .logo img { width: 180px; display: block; }
.site-header nav { display: flex; align-items: center; gap: 26px; }
.site-header nav a { font-family: var(--font-head); font-weight: 600; text-decoration: none; font-size: 17px; }
@media (max-width: 760px) {
  .site-header .wrap { min-height: 68px; }
  .site-header .logo img { width: 150px; }
  .site-header nav .hide-mobile, .topbar .hide-mobile { display: none; }
  body { font-size: 17px; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--font-head); font-weight: 600; font-size: 17px; border: 0; border-radius: var(--radius); padding: 15px 24px; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s, box-shadow .15s; line-height: 1.2; }
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--secondary); }
.btn-gold:hover { background: #b59c67; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--secondary); }
.btn-ghost { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--primary); }
.btn-ghost:hover { background: var(--ice); }
.btn-small { padding: 9px 14px; font-size: 15px; border-radius: 10px; }
.btn-link { background: none; border: 0; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }
.btn-link.danger { color: var(--error); }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; }
.hero .lead { font-size: 22px; max-width: 760px; color: var(--text); }
.hero .eyebrow { color: var(--gold-dark); font-size: 16px; margin-bottom: 14px; }
.hero.small { padding: 44px 0 20px; }
.hero.small h1 { font-size: clamp(28px, 4vw, 42px); }

/* ---------- Startseite: Kacheln ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 22px; padding-bottom: 30px; }
.tile { background: var(--sand); border-radius: var(--radius); padding: 28px 26px 24px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 10px; border: 1px solid transparent; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile:hover { border-color: var(--gold); box-shadow: var(--shadow); transform: translateY(-2px); }
.tile .icon { width: 46px; height: 46px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--primary); }
.tile .icon svg { width: 24px; height: 24px; }
.tile h3 { margin: 8px 0 0; }
.tile p { margin: 0; color: var(--text-2); font-size: 17px; }
.tile .more { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-family: var(--font-head); font-weight: 600; color: var(--primary); display: flex; justify-content: space-between; align-items: center; }
.tile .more::after { content: "→"; color: var(--gold); font-size: 20px; }
.tile .meta { font-size: 15px; color: var(--gold-dark); }

.trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 20px 0 70px; }
.trust div { border-left: 3px solid var(--gold); padding: 4px 0 4px 16px; font-size: 16px; color: var(--text-2); }
.trust strong { display: block; color: var(--primary); font-family: var(--font-head); }

/* ---------- Formular-Layout ---------- */
.form-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; padding-bottom: 80px; }
.form-layout.no-toc { grid-template-columns: minmax(0, 860px); justify-content: center; }
.toc { position: sticky; top: 110px; font-size: 16px; }
.toc h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-dark); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 7px 0 7px 16px; margin-left: -2px; border-left: 2px solid transparent; text-decoration: none; color: var(--text-2); line-height: 1.3; }
.toc li a:hover, .toc li a.active { color: var(--primary); border-left-color: var(--gold); }
.toc .badge { display: inline-block; background: var(--gold-light); color: var(--gold-dark); border-radius: 20px; font-size: 13px; padding: 0 8px; margin-left: 6px; font-weight: 600; }
@media (max-width: 980px) {
  .form-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 32px; margin-bottom: 24px; box-shadow: var(--shadow); }
.card > h2 { display: flex; gap: 12px; align-items: baseline; }
.card > h2 .num { color: var(--gold); font-size: .8em; }
.card .intro { color: var(--text-2); }
@media (max-width: 600px) { .card { padding: 22px 18px; } }

.note { background: var(--sand); border-radius: 10px; padding: 16px 20px; font-size: 16px; color: var(--text-2); margin: 0 0 20px; }
.note strong { color: var(--text); }
.note.example { border-left: 3px solid var(--gold); }
.note.info { background: var(--ice); }
.note p:last-child { margin-bottom: 0; }
.note ul { margin: 6px 0; padding-left: 20px; }

/* ---------- Felder ---------- */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px 18px; margin-bottom: 18px; }
.grid > * { grid-column: span 12; }
.grid > .w-3 { grid-column: span 3; } .grid > .w-4 { grid-column: span 4; } .grid > .w-5 { grid-column: span 5; }
.grid > .w-6 { grid-column: span 6; } .grid > .w-7 { grid-column: span 7; } .grid > .w-8 { grid-column: span 8; } .grid > .w-9 { grid-column: span 9; }
@media (max-width: 700px) { .grid > [class*="w-"] { grid-column: span 12; } }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.grid > .field { margin-bottom: 0; }
.field > label, .field > .label { font-weight: 600; font-size: 16px; color: var(--secondary); }
.hint { font-size: 14px; color: var(--text-2); }
.req { color: var(--gold-dark); margin-left: 2px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], select, textarea {
  font: inherit; font-size: 17px; color: var(--text); width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s; min-height: 48px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(25, 74, 84, .15); }
input::placeholder, textarea::placeholder { color: #9aa6a9; }
.suffix-wrap { position: relative; }
.suffix-wrap input { padding-right: 56px; }
.suffix-wrap .suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-2); font-size: 15px; pointer-events: none; }
.field.has-error input, .field.has-error select, .field.has-error textarea, .has-error .sigpad { border-color: var(--error); background: var(--error-bg); }
.error-msg { color: var(--error); font-size: 14px; font-weight: 600; }

/* Checkboxen & Radios */
.choice { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 6px 0; font-size: 17px; }
.choice input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 2px 0 0; border: 1.5px solid var(--moos); border-radius: 6px; background: #fff; display: grid; place-items: center; cursor: pointer; transition: background .12s, border-color .12s; }
.choice input[type=radio] { border-radius: 50%; }
.choice input:checked { background: var(--primary); border-color: var(--primary); }
.choice input[type=checkbox]:checked::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.choice input[type=radio]:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.choice input:focus-visible { box-shadow: 0 0 0 3px rgba(25, 74, 84, .25); }
.radio-group { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.radio-group.vertical { flex-direction: column; }
.sub { margin: 6px 0 10px 34px; padding: 14px 0 2px 18px; border-left: 2px solid var(--gold-light); }
.consent { background: var(--sand); border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; }
.consent.has-error { background: var(--error-bg); }

/* Checklisten (Beschwerden) */
.checkgroup { margin: 0 0 22px; }
.checkgroup h4 { margin: 0 0 6px; }
.checklist { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.check-item { padding: 10px 16px; border-top: 1px solid var(--line); background: #fff; transition: background .12s; }
.check-item:first-child { border-top: 0; }
.check-item.on { background: var(--sand); }
.check-item .choice { padding: 2px 0; }
.check-item .details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 8px 0 4px 34px; }
.check-item .details .field { margin: 0; }
.check-item .details label { font-size: 14px; font-weight: 600; }
.check-item .details input { min-height: 42px; padding: 8px 12px; font-size: 16px; }
@media (max-width: 640px) { .check-item .details { grid-template-columns: 1fr; margin-left: 0; } }

details.group { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; background: #fff; }
details.group > summary { list-style: none; cursor: pointer; padding: 18px 22px; display: flex; align-items: center; gap: 12px; font-family: var(--font-head); font-weight: 700; font-size: 19px; color: var(--primary); }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::after { content: ""; margin-left: auto; width: 10px; height: 10px; border: solid var(--gold); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .15s; }
details.group[open] > summary::after { transform: rotate(-135deg); }
details.group > .body { padding: 0 22px 18px; }
.count { font-family: var(--font-body); font-size: 14px; font-weight: 600; background: var(--gold-light); color: var(--gold-dark); padding: 1px 10px; border-radius: 20px; }
.count:empty { display: none; }

/* Wiederholbare Zeilen */
.repeat { margin-bottom: 18px; }
.repeat-row { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px 4px; margin-bottom: 12px; background: #fff; }
.repeat-row .row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.repeat-row .row-title { font-family: var(--font-head); font-weight: 700; color: var(--gold-dark); font-size: 15px; text-transform: uppercase; letter-spacing: .06em; }
.repeat-row .grid { margin-bottom: 12px; }
.repeat-row .field input, .repeat-row .field select { min-height: 44px; }
.repeat .empty { color: var(--text-2); font-style: italic; font-size: 16px; margin: 0 0 12px; }

/* Tätigkeitstabelle (Haushalt) */
.acts { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.acts .act-row { display: grid; grid-template-columns: var(--act-cols); gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); align-items: center; }
.acts .act-row:first-child { border-top: 0; }
.acts .act-head { background: var(--sand); font-size: 14px; font-weight: 700; color: var(--secondary); line-height: 1.25; }
.acts .act-name { font-weight: 600; }
.acts input { min-height: 42px; padding: 8px 12px; font-size: 16px; }
.acts .mini-label { display: none; font-size: 13px; color: var(--text-2); font-weight: 600; }
.acts .del { justify-self: end; }
@media (max-width: 760px) {
  .acts .act-head { display: none; }
  .acts .act-row { grid-template-columns: 1fr 1fr !important; }
  .acts .act-name, .acts .act-row > .full { grid-column: 1 / -1; }
  .acts .mini-label { display: block; margin-bottom: 3px; }
}

/* Rechtstexte */
.legal { border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 16px; }
.legal > summary { cursor: pointer; padding: 14px 18px; font-family: var(--font-head); font-weight: 700; color: var(--primary); }
.legal .legal-body { padding: 0 20px 16px; font-size: 16px; color: var(--text-2); max-height: 420px; overflow: auto; }
.legal .legal-body h4 { margin-top: 16px; }
.legal .legal-body ol, .legal .legal-body ul { padding-left: 22px; }
.legal .legal-body li { margin-bottom: 6px; }
.doc-text { background: var(--sand); border-radius: 10px; padding: 22px 24px; font-size: 16px; margin-bottom: 18px; }
.doc-text ol { padding-left: 22px; } .doc-text li { margin-bottom: 6px; }
.doc-text .insachen { font-size: 17px; background: #fff; border: 1px dashed var(--gold); border-radius: 8px; padding: 12px 16px; margin: 0 0 14px; }
.doc-text .insachen b { color: var(--primary); }

/* Unterschrift */
.sigwrap { margin-bottom: 18px; }
.sigpad { position: relative; border: 1.5px dashed var(--moos); border-radius: 10px; background: #fff; height: 200px; touch-action: none; }
.sigpad canvas { width: 100%; height: 100%; display: block; cursor: crosshair; border-radius: 10px; }
.sigpad .baseline { position: absolute; left: 24px; right: 24px; bottom: 46px; border-bottom: 1.5px solid var(--line); pointer-events: none; }
.sigpad .placeholder { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: #9aa6a9; font-size: 15px; pointer-events: none; }
.sigpad.signed .placeholder { display: none; }
.sigtools { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 14px; color: var(--text-2); gap: 10px; flex-wrap: wrap; }

/* Uploads */
.upload { border: 1.5px dashed var(--moos); border-radius: 10px; padding: 22px; text-align: center; background: var(--sand); cursor: pointer; transition: background .15s; }
.upload:hover, .upload.drag { background: var(--gold-light); }
.upload input { display: none; }
.filelist { list-style: none; padding: 0; margin: 10px 0 0; }
.filelist li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; font-size: 16px; background: #fff; }
.filelist .size { color: var(--text-2); font-size: 14px; white-space: nowrap; }

/* Absenden */
.submit-card { background: var(--secondary); color: #fff; border: 0; }
.submit-card h2, .submit-card h4 { color: #fff; }
.submit-card .consent { background: rgba(255,255,255,.06); }
.submit-card .consent.has-error { background: rgba(179,38,30,.35); }
.submit-card .choice { color: #fff; }
.submit-card .choice input { border-color: var(--gold); background: transparent; }
.submit-card .choice input:checked { background: var(--gold); border-color: var(--gold); }
.submit-card a { color: var(--gold); }
.submit-card .actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 20px; }
.submit-card .hint { color: #c9d4d6; font-size: 15px; }
.submit-card .error-msg { color: #ffb4ab; }
.form-error { background: var(--error-bg); color: var(--error); border-radius: 10px; padding: 14px 18px; font-weight: 600; margin-top: 16px; }
.submit-card .form-error { background: #fff; }

.success { text-align: center; padding: 50px 30px; }
.success .check { width: 76px; height: 76px; border-radius: 50%; background: var(--gold-light); color: var(--primary); display: grid; place-items: center; margin: 0 auto 20px; }
.success .check svg { width: 40px; height: 40px; }
.success .actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 24px; }

.spinner { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Fuß ---------- */
.site-footer { background: var(--secondary); color: #dfe6e7; font-size: 16px; }
.site-footer .wrap { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 30px; padding-top: 60px; padding-bottom: 40px; }
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 12px; }
.site-footer a { color: #dfe6e7; text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer .logo { width: 180px; margin-bottom: 22px; }
.site-footer p { margin: 0 0 8px; }
.site-footer .bottom { border-top: 1px solid rgba(255,255,255,.12); }
.site-footer .bottom .wrap { display: flex; justify-content: space-between; padding-top: 18px; padding-bottom: 22px; font-size: 14px; grid-template-columns: none; flex-wrap: wrap; gap: 10px; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }

noscript .card { margin: 30px 0; }
