:root {
  /* Farben aus dem FMFK-Logo: Schwarz + Champagner-Gold */
  --ink: #181c1f;          /* Logo-Schwarz */
  --ink-2: #2b3135;
  --gold: #e9d6b6;         /* Logo-Gold (Flächen, auf Schwarz) */
  --gold-mid: #c9ad7f;
  --gold-dark: #8a6a3a;    /* Gold als Schrift auf Hell (ausreichend Kontrast) */
  --bg: #f6f2eb;
  --card: #ffffff;
  --text: #1d2124;
  --muted: #6e6a63;
  --line: #e8dfcf;
  --accent: var(--ink);
  --accent-dark: var(--ink-2);
  --warn: #b06a00;
  --warn-bg: #fff4e0;
  --error: #b3261e;
  --error-bg: #fdeceb;
  --ok: #1e7a3c;
  --ok-bg: #e7f6ec;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--gold-dark); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1rem; margin: 0 0 .9rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
     padding-bottom: 6px; border-bottom: 1px solid var(--gold-mid); }
.knoepfe h2 { border-bottom: 0; padding-bottom: 0; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 16px; }
.wrap.schmal { max-width: 620px; }

header.top {
  background: var(--ink); color: #fff; border-bottom: 3px solid var(--gold-mid);
}
header.top .wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding-block: 10px; }
header.top a { color: #fff; text-decoration: none; opacity: .8; padding-bottom: 2px; border-bottom: 2px solid transparent; }
header.top a:hover { opacity: 1; }
header.top a.aktiv { opacity: 1; color: var(--gold); border-bottom-color: var(--gold); }
header.top .marke { font-weight: 600; opacity: 1; margin-right: auto; display: inline-flex; align-items: center; gap: 12px;
                    color: var(--gold); letter-spacing: .08em; text-transform: uppercase; font-size: .95rem; border: 0; }
header.top .marke:hover { text-decoration: none; }
header.top .logo { display: block; border-radius: 50%; flex: none; }

.karte { background: var(--card); border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
         box-shadow: 0 1px 3px rgba(0,0,0,.06); }

label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=number], input[type=password],
input[type=file], textarea, select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; color: var(--text);
}
textarea { min-height: 90px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gold-mid); outline-offset: 0; border-color: var(--gold-mid); }
.reihe { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
.reihe.d3 { grid-template-columns: 1fr 1fr 1fr; }
.reihe.plz { grid-template-columns: 110px 1fr; }
@media (max-width: 560px) { .reihe, .reihe.d3 { grid-template-columns: 1fr; } }

.btn, button {
  display: inline-block; border: 0; border-radius: 8px; padding: 11px 18px; font: inherit;
  font-weight: 600; cursor: pointer; background: var(--accent); color: #fff; text-decoration: none;
}
.btn:hover, button:hover { background: var(--accent-dark); }
.btn:focus-visible, button:focus-visible { outline: 3px solid var(--gold-mid); outline-offset: 2px; }
.btn.zweit, button.zweit { background: #efe7d9; color: var(--text); }
.btn.zweit:hover, button.zweit:hover { background: #e4d8c3; }
.btn.gefahr, button.gefahr { background: var(--error-bg); color: var(--error); }
.btn.wa { background: #25d366; color: #073b1c; }
.btn.gross, button.gross { width: 100%; padding: 15px; font-size: 1.05rem; margin-top: 16px; }
.knoepfe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

.meldung { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; }
.meldung.ok { background: var(--ok-bg); color: var(--ok); }
.meldung.fehler { background: var(--error-bg); color: var(--error); }
.meldung.hinweis { background: var(--warn-bg); color: var(--warn); }

.muted { color: var(--muted); font-size: .9rem; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .8rem; font-weight: 600;
         background: #eceff1; color: var(--muted); white-space: nowrap; }
.badge.offen { background: var(--warn-bg); color: var(--warn); }
.badge.geoeffnet { background: #f3e9d7; color: var(--gold-dark); }
.badge.unterschrieben { background: var(--ok-bg); color: var(--ok); }
.badge.storniert { background: #eee; color: #888; text-decoration: line-through; }
.badge.sperre { background: #ececec; color: #555; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr.klick { cursor: pointer; }
tr.klick:hover td { background: #fbf7f0; }
.tabelle-scroll { overflow-x: auto; }

.linkfeld { display: flex; gap: 8px; }
.linkfeld input { font-family: ui-monospace, monospace; font-size: .85rem; }

dl.daten { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
dl.daten dt { color: var(--muted); }
dl.daten dd { margin: 0; }

/* Kalender */
.kal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.kal .kopf { font-size: .75rem; font-weight: 700; color: var(--muted); text-align: center; padding: 4px; }
.kal .tag { background: #fff; border: 1px solid var(--line); border-radius: 8px; min-height: 84px; padding: 4px;
            font-size: .8rem; overflow: hidden; }
.kal .tag.leer { background: transparent; border: 0; }
.kal .tag.heute { border-color: var(--gold-mid); box-shadow: inset 0 0 0 1px var(--gold-mid); }
.kal .tag.frei:hover { background: #fbf6ec; cursor: pointer; }
.kal .nr { font-weight: 700; }
.kal .eintrag { display: block; margin-top: 3px; padding: 2px 5px; border-radius: 5px; font-size: .72rem;
                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none;
                background: var(--ink); color: var(--gold); }
.kal .eintrag.offen, .kal .eintrag.geoeffnet { background: var(--gold); color: var(--ink); }
.kal .eintrag.sperre { background: #8a8f93; }
@media (max-width: 640px) {
  .kal .tag { min-height: 54px; }
  .kal .eintrag { font-size: 0; height: 6px; padding: 0; }
}

/* Unterschrift */
.sigbox { position: relative; border: 2px dashed var(--gold-mid); border-radius: 10px; background: #fff;
          touch-action: none; }
.sigbox canvas { display: block; width: 100%; height: 200px; touch-action: none; }
.sigbox .linie { position: absolute; left: 6%; right: 6%; bottom: 44px; border-bottom: 1px solid #d9cbb2;
                 pointer-events: none; }
.sigbox .hinweis { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: #9aa6aa;
                   font-size: .8rem; pointer-events: none; }

.seite { width: 100%; display: block; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 12px;
         background: #fff; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin-top: 16px; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 1px; }

.schritte { display: flex; gap: 6px; margin-bottom: 16px; font-size: .8rem; color: var(--muted); }
.schritte span, .schritte a { flex: 1; padding: 6px 0; border-top: 4px solid var(--line); }
.schritte span.an, .schritte a.an { border-color: var(--gold-mid); color: var(--text); font-weight: 600; }

code { background: #f3ece0; padding: 1px 5px; border-radius: 4px; font-size: .85em; }
.felder code { display: inline-block; margin: 2px; }
.felder code.fehlt { opacity: .45; }
button:disabled, button:disabled:hover { background: #c9c4bb; color: #f6f2eb; cursor: not-allowed; }
.kal .eintrag.sperre.importiert { background: #6b5b95; }
.kal .eintrag.frei-termin { background: #fff; color: #444; border: 1px dashed #8a8f93; }
.karte h3{font-size:1rem;margin:18px 0 6px}
.karte ol,.karte ul{padding-left:20px;margin:6px 0}
.karte li{margin:3px 0}

.check input { accent-color: var(--ink); }
input[type=radio] { accent-color: var(--ink); }

/* Monatswechsel direkt über dem Kalender */
.monatsnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.monatsnav .monat { font-size: clamp(1rem, 4.6vw, 1.25rem); white-space: nowrap; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; text-align: center; }
.monatsnav .btn { min-width: 48px; text-align: center; font-size: 1.15rem; }
.kal { touch-action: pan-y; transition: transform .15s ease, opacity .15s ease; }
.kal.weg-links { transform: translateX(-30px); opacity: .4; }
.kal.weg-rechts { transform: translateX(30px); opacity: .4; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Gesamtkosten deutlich über dem Mieter-Formular */
.gesamtkosten { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap;
                background: var(--ink); color: #fff; border-radius: 12px; border-bottom: 3px solid var(--gold-mid);
                padding: 14px 20px; margin-bottom: 16px; }
.gesamtkosten span { text-transform: uppercase; letter-spacing: .08em; font-size: .9rem; color: var(--gold); }
.gesamtkosten strong { font-size: 1.6rem; color: var(--gold); }

/* Dokumente (AGB, Widerruf, Datenschutz) vor der Unterschrift */
ul.dokumente { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
ul.dokumente a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
                 background: #fbf8f2; text-decoration: none; color: var(--text); font-weight: 600; }
ul.dokumente a:hover { border-color: var(--gold-mid); }

/* Zurück zu den Mieterdaten auf der Unterschrifts-Seite */
.angaben { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
           background: #fbf8f2; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.btn.zurueck { display: block; text-align: center; margin-top: 10px; }
.schritte a { color: inherit; text-decoration: underline; text-decoration-color: var(--gold-mid); }

/* Zahlung */
.badge.zahlung { background: #fbeed3; color: #8a5a00; }
.kal .eintrag.zahlung { background: repeating-linear-gradient(135deg, var(--ink) 0 6px, var(--ink-2) 6px 12px);
                        color: var(--gold); outline: 1px dashed var(--gold-mid); outline-offset: -1px; }
.kal .legende .zahlung { background: var(--ink-2); color: var(--gold); outline: 1px dashed var(--gold-mid); }
.frist-ueberschritten { color: var(--error); font-weight: 700; }
button.klein, .btn.klein { padding: 3px 9px; font-size: .8rem; margin-left: 6px; }
dl.daten.bank dd { word-break: break-word; }
.girocode { margin: 12px 0; }
.girocode summary { cursor: pointer; font-weight: 600; }
.girocode .qr svg { width: 200px; height: 200px; display: block; margin: 8px 0; background: #fff; }
#paypal-knoepfe { max-width: 420px; margin-top: 8px; }

/* Online-Buchungen */
.badge.online { background: #efe7d9; color: var(--gold-dark); font-size: .72rem; }
.badge.anfrage { background: #fff; color: var(--gold-dark); outline: 1px dashed var(--gold-mid); }
.kal .eintrag.anfrage { background: #fff; color: var(--gold-dark); outline: 1px dashed var(--gold-mid); outline-offset: -1px; }
.anfrage-karte { border-left: 4px solid var(--gold-mid); }
details > summary.btn { list-style: none; }
details > summary.btn::-webkit-details-marker { display: none; }
.foto-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.foto img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: block; margin-bottom: 6px; }

/* Benachrichtigungen */
.benachr-tabelle { width: 100%; border-collapse: collapse; margin-top: 8px; }
.benachr-tabelle th, .benachr-tabelle td { padding: 8px 6px; border-bottom: 1px solid var(--linie, rgba(128,128,128,.25)); text-align: left; }
.benachr-tabelle th:not(:first-child), .benachr-tabelle td:not(:first-child) { text-align: center; width: 64px; }
.benachr-tabelle input[type=checkbox] { width: 20px; height: 20px; }
.stat-kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 4px; }
.stat-kacheln .karte { margin-bottom: 12px; padding: 16px; }
.stat-zahl { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.ausweis-bilder { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.ausweis-bilder figure { margin: 0; max-width: 260px; }
.ausweis-bilder img { width: 100%; border-radius: 8px; border: 1px solid #e4d8c3; display: block; }
.ausweis-bilder figcaption { margin-top: 4px; font-size: .85rem; }
.ausweis-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ausweis-form .check { flex-basis: 100%; margin: 4px 0 0; }
.ausweis-form p { flex-basis: 100%; margin: 0; }
.ausweis-knopf { cursor: pointer; }
