/* Wartungstermine – Gestaltung wie schaden.scheidt-immo.de
   (Anthrazit-Kopf mit Limettenlinie, weiße Karten auf hellgrauem Grund, Systemschrift) */
:root {
  --brand: #363636;
  --akzent: #d8dd05;
  --text: #1c2328;
  --muted: #5d6870;
  --bg: #f3f5f6;
  --card: #ffffff;
  --line: #d7dde1;
  --feld: #b9c3c9;
  --rot: #b42318;
  --rot-bg: #fef3f2;
  --gelb: #8a5a00;
  --gelb-bg: #fff8e6;
  --gruen: #067647;
  --gruen-bg: #ecfdf3;
  --zart: #eef2f4;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--brand); }
.wrap { max-width: 760px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap-breit { max-width: 1040px; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 28px 0 6px; text-wrap: balance; }
h2 { font-size: 1.25rem; line-height: 1.25; margin: 26px 0 10px; }
h3 { font-size: 1.05rem; margin: 0 0 10px; }
p { margin: 0 0 12px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px 14px; z-index: 10; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Kopf und Fuß */
.kopf { background: var(--brand); color: #fff; border-bottom: 4px solid var(--akzent); }
.kopf-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.logo-link { display: block; line-height: 0; color: #fff; text-decoration: none; }
.logo { height: 46px; width: auto; display: block; }
.firma { font-weight: 700; font-size: 1.15rem; line-height: 1.3; }
.kopf-titel { font-size: .9rem; opacity: .85; }
main { padding-bottom: 8px; }
.fuss { border-top: 1px solid var(--line); margin-top: 32px; padding: 18px 0 30px; font-size: .9rem; color: var(--muted); }
.fuss .wrap { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* Texte */
.lead { color: var(--muted); margin: 0 0 18px; max-width: 65ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; font-weight: 700; color: var(--muted); margin: 0 0 2px; }
.muted, .hint, .hilfe, .klein { color: var(--muted); }
.hint, .klein { font-size: .88rem; }
.hilfe { font-size: .95rem; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.break { word-break: break-all; }
.tnum { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.pflicht, .text-rot { color: var(--rot); }
.optional, .req { font-weight: 400; color: var(--muted); font-size: .9rem; }

/* Meldungen */
.msg { border-radius: var(--radius); padding: 12px 14px; margin: 20px 0 16px; font-weight: 600; background: var(--gruen-bg); border: 1px solid #abefc6; color: var(--gruen); }
.msg-err { background: var(--rot-bg); border-color: #fecdca; color: var(--rot); }
.erfolg { background: var(--gruen-bg); border: 1px solid #abefc6; }
.erfolg h1, .erfolg h2 { color: var(--gruen); margin-top: 0; }

/* Karten */
.card, .karte { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 16px; min-width: 0; }
.narrow { max-width: 560px; margin: 28px auto 16px; }
.narrow h1 { margin-top: 0; }
.confirm .eyebrow { color: var(--gruen); }
.card > h2:first-child, .karte > h2:first-child { margin-top: 0; }

.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--zart); vertical-align: middle; }
.pill-off { background: var(--gelb-bg); color: var(--gelb); }
.pill-on { background: var(--gruen-bg); color: var(--gruen); }

/* Formulare */
label { display: block; font-weight: 600; margin: 0 0 5px; font-size: .95rem; }
input[type="text"], input:not([type]), input[type="email"], input[type="tel"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="search"], select, textarea {
  width: 100%; font: inherit; color: inherit; background: #fff; border: 1px solid var(--feld); border-radius: 8px; padding: 10px 12px; min-height: 46px;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--brand) 30%, transparent); border-color: var(--brand); }
.stack { display: grid; gap: 4px; }
.stack label { margin-top: 10px; }
.stack .btn { margin-top: 14px; }
.code-input { font-family: ui-monospace, Consolas, monospace; font-size: 1.45rem; letter-spacing: .15em; text-transform: uppercase; text-align: center; }
.code-input.small { font-size: 1.1rem; max-width: 14rem; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.inline-form label { margin: 0; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 12rem; }
.fields, .gen-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
.field { min-width: 0; margin: 0 0 14px; }
.field-wide { grid-column: 1 / -1; }
.field .hint { margin: 4px 0 0; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 16px; }
.consent input { margin-top: 4px; width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--brand); }
.consent label { font-weight: 400; margin: 0; }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--brand); border-radius: 8px; background: #fff; color: var(--brand); font: inherit; font-weight: 700; padding: 10px 16px; min-height: 46px; cursor: pointer; text-align: center; text-decoration: none; }
.btn:hover { background: var(--zart); }
.btn-primary { background: var(--brand); color: #fff; font-size: 1.05rem; padding: 13px 18px; }
.btn-primary:hover { background: var(--brand); filter: brightness(1.15); }
.btn-zweit, .btn-quiet { background: #fff; color: var(--brand); }
.btn-quiet { border-color: var(--line); font-weight: 600; }
.btn-active { background: var(--zart); border-width: 2px; }
.btn-small { min-height: 36px; padding: 5px 12px; font-size: .88rem; }
.btn-danger, .btn-gefahr { border-color: var(--rot); color: var(--rot); }
.btn-danger:hover, .btn-gefahr:hover { background: var(--rot-bg); }
.narrow .btn-primary, .booking .btn-primary, .confirm .btn-primary, .karte > .btn-primary { width: 100%; }
.toolbar, .knoepfe { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.knoepfe .btn { flex: 1 1 14rem; }

.house-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 22px 0 16px; }
.house-bar h1 { margin: 0; }
.house-name { font-weight: 700; font-size: 1.05rem; margin: 0; }
.search { margin-bottom: 16px; }

/* Listen */
.maint-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.maint-link { display: grid; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; text-decoration: none; color: var(--text); }
.maint-link:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 4%, #fff); }
.maint-title { font-weight: 700; font-size: 1.05rem; }

/* Buchungsformular */
.booking { display: grid; gap: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.card, fieldset.slots-fs { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 16px; }
legend { float: left; width: 100%; padding: 0; margin: 0 0 14px; font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
legend + * { clear: both; }
.step { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .9rem; flex: 0 0 auto; }
.day { margin: 0 0 16px; }
.day:last-child { margin-bottom: 0; }
.day-h { font-size: 1rem; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.slot-radio { position: absolute; opacity: 0; width: 1px; height: 1px; }
.slot { display: grid; gap: 0; text-align: center; padding: 9px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-weight: 400; margin: 0; }
.slot .t { font-weight: 700; font-variant-numeric: tabular-nums; }
.slot .s { font-size: .8rem; color: var(--muted); }
.slot:hover { border-color: var(--brand); }
.slot-radio:checked + .slot { border: 2px solid var(--brand); background: color-mix(in srgb, var(--brand) 7%, #fff); padding: 8px 7px; }
.slot-radio:checked + .slot .s { font-size: 0; }
.slot-radio:checked + .slot .s::before { content: "✓ ausgewählt"; font-size: .8rem; color: var(--brand); font-weight: 700; }
.slot-radio:focus-visible + .slot { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 2px; }
.slot-taken { background: var(--zart); border-color: var(--zart); color: #8a949b; cursor: not-allowed; }
.slot-taken .t { text-decoration: line-through; }
.slot-taken .s { color: #8a949b; }

/* Bestätigung */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.storno-box { background: var(--zart); border-radius: 8px; padding: 12px 14px; margin: 0 0 16px; }
.big-code { font-family: ui-monospace, Consolas, monospace; font-size: 1.9rem; font-weight: 700; letter-spacing: .12em; margin: 2px 0 8px; }
.big-code.small { font-size: 1.25rem; margin: 0; }
.mine { border-color: color-mix(in srgb, var(--brand) 35%, #fff); background: color-mix(in srgb, var(--brand) 5%, #fff); }
.mine h2 { margin-top: 0; }
details summary { cursor: pointer; font-weight: 700; }
details[open] summary { margin-bottom: 12px; }
.danger summary { color: var(--rot); }

/* Tabellen */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 16px; }
.sched { border-collapse: collapse; width: 100%; font-size: .9rem; table-layout: fixed; min-width: 640px; }
.sched th, .sched td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.sched thead th { background: var(--zart); white-space: nowrap; }
.sched th:first-child, .sched td:first-child { width: 8rem; }
.sched tr:last-child td { border-bottom: 0; }
.row-free td { color: var(--muted); }
.row-day th { background: #f8fafb; font-size: .9rem; }
.day-block .day-h { margin-top: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 16px; }
.grid-2 > * { min-width: 0; }

/* Aushang */
.poster { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.poster-logo { height: 54px; width: auto; display: block; margin: 0 0 18px; background: var(--brand); padding: 8px 12px; border-radius: 6px; box-sizing: content-box; }
.poster h1 { font-size: 2rem; margin-top: 4px; }
.poster-list { margin-bottom: 20px; font-size: 1.05rem; }
.poster-grid { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; margin-bottom: 20px; }
.poster-url { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; font-weight: 700; word-break: break-all; }
.poster .big-code { font-size: 2.6rem; }
.qr-box { text-align: center; }
#qr img, #qr canvas { margin: 0 auto; }

@media (max-width: 560px) {
  .logo { height: 34px; }
  .kopf-titel { display: none; }
  h1 { font-size: 1.45rem; }
  .poster-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 8px; }
}

@media print {
  body { background: #fff; }
  .kopf, .fuss, .no-print, .skip { display: none !important; }
  .table-wrap, .card, .karte, .poster { border: 0; padding: 0; }
  .day-block { break-inside: avoid; }
  .poster { font-size: 14pt; padding-top: 30px; }
  .poster h1 { font-size: 2.2rem; }
  .poster-logo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Unauffälliger Zugang zur Verwaltung (Schloss in der Fußzeile) */
.fuss-admin { margin-left: auto; color: var(--muted); opacity: .35; display: inline-flex; align-items: center; padding: 4px; text-decoration: none; }
.fuss-admin:hover, .fuss-admin:focus-visible { opacity: 1; }
