/**
 * Auftraggeberportal.
 *
 * Eigenes Stylesheet, nicht das der Verwaltung. Zwei Gründe: die Anwendung hat
 * einen eigenen DocumentRoot (app.css liegt dort gar nicht), und das Publikum
 * ist ein anderes. Drinnen arbeitet jemand acht Stunden am Tag mit dichten
 * Tabellen; hier kommt jemand dreimal im Jahr vorbei, oft vom Telefon, und
 * muss ohne Einarbeitung zurechtkommen.
 *
 * Daraus folgt alles Weitere: größere Schrift, größere Flächen zum Antippen,
 * eine Spalte statt drei, und auf jeder Seite genau eine Handlung, die
 * hervorsticht.
 *
 * Farb- und Schriftwelt bleiben die der Marke (bewerter-immobilien.de) — der
 * Auftraggeber soll merken, dass er beim selben Haus ist.
 */

:root {
    --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-head: "Arvo", Georgia, "Times New Roman", serif;

    --navy:      #002147;
    --navy-mid:  #0c3a6e;
    --brand-50:  #eaf6ef;
    --brand-100: #d3ecdd;
    --brand-500: #46b972;
    --brand-600: #2f7f5c;
    --teal:      #00a1a3;

    --bg:        #f2f5f7;
    --surface:   #ffffff;
    --surface-2: #f7f9fa;
    --border:    #dde3ec;
    --text:      #17263a;
    --text-2:    #5b7290;
    --text-3:    #8fa3ba;

    --success: #2f7f5c;
    --warning: #b57d00;
    --danger:  #c1443f;

    --radius:    14px;
    --radius-sm:  8px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(0,33,71,.06), 0 1px 3px rgba(0,33,71,.08);
    --shadow-md: 0 6px 20px rgba(0,33,71,.09);

    /* Fingergroß. 44px ist die Zahl, unter der auf einem Telefon danebengetippt
       wird — sie gilt hier für jeden Knopf und jede Zeile, die etwas tut. */
    --tap: 44px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.25; margin: 0 0 10px; }
h1 { font-size: 25px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0 0 12px; }
a { color: var(--navy-mid); }
a:hover { color: var(--brand-600); }

.muted { color: var(--text-2); }
.klein { font-size: 14px; }
.rechts { text-align: right; }
.mt { margin-top: 18px; }
.mb0 { margin-bottom: 0; }

/* ── Gerüst ────────────────────────────────────────────────────────────── */
.kopf {
    background: var(--navy);
    color: #fff;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 30;
}
.kopf__innen, .inhalt, .fuss__innen {
    max-width: 920px;
    margin: 0 auto;
    padding: 0 18px;
}
.kopf__innen { display: flex; align-items: center; gap: 14px; }
.kopf__marke {
    font-family: var(--font-head);
    font-size: 17px;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    min-width: 0;
}
.kopf__marke span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kopf__nav { display: flex; align-items: center; gap: 4px; }
.kopf__link {
    color: #c9d8e8;
    text-decoration: none;
    font-size: 14.5px;
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    min-height: var(--tap);
    display: inline-flex;
    align-items: center;
}
.kopf__link:hover, .kopf__link.is-aktiv { background: rgba(255,255,255,.12); color: #fff; }

.inhalt { padding-top: 22px; padding-bottom: 40px; }

.fuss {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 18px 0;
    font-size: 13.5px;
    color: var(--text-2);
}
.fuss__innen { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* Schmale Seiten (Anmelden, Einladung) stehen mittig und ohne Kopfleiste. */
.schmal {
    max-width: 440px;
    margin: 0 auto;
    padding: 40px 18px;
}
/* Nur noch der Traeger des Logos: der Name steht IM Bild, ein Schriftzug
   darunter waere er ein zweites Mal. */
.schmal__marke {
    margin-bottom: 24px;
}
/* Das Logo ist ein Querformat (600x150). Begrenzt wird deshalb die BREITE:
   auf einer 440px-Karte nimmt es sonst fast die ganze Zeile ein und drueckt
   das Anmeldefeld unter die Kante des Bildschirms. 200px sind erkennbar, ohne
   der Anmeldung die Buehne zu nehmen. */
/* Genau so breit wie die Karte darunter: beide sind direkte Kinder von
   .schmal und teilen sich damit dieselbe Breite. Keine Obergrenze in Pixeln —
   die wuerde auf breiten Bildschirmen wieder danebenliegen. */
.schmal__logo { display: block; width: 100%; height: auto; }

/* Im Kopf der angemeldeten Seiten steht es klein neben dem Namen. Weiß
   umrandet wäre falsch: viele Logos sind freigestellt und stehen hier auf
   Navy — die Fläche muss durchsichtig bleiben. */
/* In der Kopfleiste klein. Die helle Fassung traegt ihren Navy-Hintergrund im
   Bild (#012248) — er trifft die Leiste (#002147) so genau, dass keine Kante
   sichtbar wird. */
.kopf__logo { max-height: 28px; max-width: 140px; width: auto; height: auto; display: block; }

/* ── Karte ─────────────────────────────────────────────────────────────── */
.karte {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
    overflow: hidden;
}
.karte__kopf {
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.karte__kopf h2, .karte__kopf h3 { margin: 0; flex: 1; }
.karte__leib { padding: 18px; }
.karte__fuss {
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
/* Die eine Karte, um die es auf der Seite geht. */
.karte--wichtig { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-50); }

/* ── Knöpfe ────────────────────────────────────────────────────────────── */
.knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--tap);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    font-size: 15.5px;
    text-decoration: none;
    cursor: pointer;
}
.knopf:hover { background: var(--surface-2); color: var(--text); }
.knopf--haupt {
    background: var(--brand-500);
    border-color: var(--brand-500);
    /* Grün trägt nie weißen Text — wie auf der Website. */
    color: var(--navy);
}
.knopf--haupt:hover { background: #3ba966; border-color: #3ba966; color: var(--navy); }
.knopf--gefahr { color: var(--danger); border-color: #eecfcd; }
.knopf--gefahr:hover { background: #fdf3f2; color: var(--danger); }
.knopf--schlicht { border-color: transparent; background: transparent; }
.knopf--breit { width: 100%; }
.knopf[disabled] { opacity: .5; cursor: not-allowed; }

/* ── Formulare ─────────────────────────────────────────────────────────── */
.feld { margin-bottom: 16px; }
.feld > label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.eingabe {
    width: 100%;
    min-height: var(--tap);
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font: inherit;
    font-size: 16px;   /* unter 16px zoomt iOS beim Antippen hinein */
    color: var(--text);
}
.eingabe:focus {
    outline: 2px solid var(--brand-500);
    outline-offset: 1px;
    border-color: var(--brand-500);
}
textarea.eingabe { min-height: 110px; resize: vertical; }
.hinweis { font-size: 13.5px; color: var(--text-2); margin-top: 6px; }

.haken {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    padding: 11px 0;
    cursor: pointer;
    font-size: 15px;
}
.haken input {
    width: 22px; height: 22px;
    margin: 1px 0 0;
    accent-color: var(--brand-600);
    flex: 0 0 auto;
}

/* ── Meldungen ─────────────────────────────────────────────────────────── */
.meldung {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border: 1px solid;
    font-size: 15px;
}
.meldung--gut  { background: var(--brand-50); border-color: var(--brand-100); color: #1c5c40; }
.meldung--fehler { background: #fdf3f2; border-color: #f0d3d1; color: #8f2f2b; }
.meldung--info { background: #eef4fb; border-color: #d5e3f3; color: #1c3f68; }
.meldung--warnung { background: #fdf6e6; border-color: #f2e0b5; color: #7a5500; }

/* ── Marken ────────────────────────────────────────────────────────────── */
.marke {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    background: var(--surface-2);
    color: var(--text-2);
    border: 1px solid var(--border);
    white-space: nowrap;
}
.marke--gruen { background: var(--brand-50); border-color: var(--brand-100); color: #1c5c40; }
.marke--blau  { background: #eef4fb; border-color: #d5e3f3; color: #1c3f68; }
.marke--rot   { background: #fdf3f2; border-color: #f0d3d1; color: #8f2f2b; }
.marke--gelb  { background: #fdf6e6; border-color: #f2e0b5; color: #7a5500; }

/* ── Zeitstrahl ────────────────────────────────────────────────────────── */
/* Die wichtigste Anzeige der ganzen Anwendung: „wo stehen wir?". Senkrecht,
   weil die Schritte Text tragen und nebeneinander auf einem Telefon
   unlesbar wären. */
.strahl { list-style: none; margin: 0; padding: 0; }
.strahl__schritt {
    display: flex;
    gap: 14px;
    padding-bottom: 18px;
    position: relative;
}
.strahl__schritt:last-child { padding-bottom: 0; }
/* Die Linie verbindet die Punkte — sie endet am letzten. */
.strahl__schritt:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 34px;
    bottom: 2px;
    width: 2px;
    background: var(--border);
}
.strahl__punkt {
    flex: 0 0 32px;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700;
    color: var(--text-3);
    z-index: 1;
}
.strahl__schritt--fertig .strahl__punkt {
    background: var(--brand-500); border-color: var(--brand-500); color: var(--navy);
}
.strahl__schritt--laeuft .strahl__punkt {
    border-color: var(--navy); color: var(--navy); background: #fff;
    box-shadow: 0 0 0 4px rgba(0,33,71,.08);
}
.strahl__text { flex: 1; min-width: 0; padding-top: 3px; }
.strahl__titel { font-weight: 700; font-size: 15.5px; }
.strahl__schritt--offen .strahl__titel { color: var(--text-2); font-weight: 600; }
.strahl__hinweis { font-size: 14px; color: var(--text-2); }

/* ── Fortschritt ───────────────────────────────────────────────────────── */
.balken {
    height: 10px;
    border-radius: var(--radius-pill);
    background: var(--border);
    overflow: hidden;
}
.balken__fuellung { height: 100%; background: var(--brand-500); transition: width .3s; }

/* ── Auftragsliste ─────────────────────────────────────────────────────── */
.auftrag {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}
.auftrag:last-child { border-bottom: 0; }
.auftrag:hover { background: var(--surface-2); color: inherit; }
.auftrag__titel { font-weight: 700; font-size: 16.5px; }
.auftrag__objekt { color: var(--text-2); font-size: 14.5px; }

/* ── Unterlagen-Checkliste ─────────────────────────────────────────────── */
.pos {
    border-bottom: 1px solid var(--border);
    padding: 16px 18px;
}
.pos:last-child { border-bottom: 0; }
.pos--erledigt { background: var(--surface-2); }
.pos--faellig { background: #fdf6e6; }
.pos__kopf { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.pos__name { flex: 1; min-width: 200px; font-weight: 600; }
.pos__hinweis { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.pos__dateien { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.pos__datei {
    display: flex; align-items: center; gap: 9px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 11px;
    font-size: 14px;
}
.pos__datei a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Ablegefläche: das Feld, in das man Dateien zieht — oder das man antippt. */
.ablage {
    margin-top: 10px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    color: var(--text-2);
    font-size: 14.5px;
    cursor: pointer;
    background: var(--surface);
}
.ablage:hover, .ablage.is-drueber { border-color: var(--brand-500); background: var(--brand-50); color: #1c5c40; }
.ablage input { display: none; }

/* ── Unterschrift ──────────────────────────────────────────────────────── */
/* Das Dokument wird in einem eigenen Rahmen gezeigt und muss bis zum Ende
   gescrollt werden — der Knopf darunter bleibt bis dahin gesperrt. */
.lesefeld {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    height: 62vh;
    min-height: 380px;
    overflow: auto;
    background: var(--surface-2);
    -webkit-overflow-scrolling: touch;
}
.lesefeld iframe, .lesefeld embed { width: 100%; height: 100%; border: 0; display: block; }

.unterschrift {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    position: relative;
    touch-action: none;
}
.unterschrift canvas { display: block; width: 100%; height: 170px; border-radius: var(--radius-sm); }
.unterschrift__linie {
    position: absolute; left: 24px; right: 24px; bottom: 42px;
    border-top: 1px dashed var(--border);
    pointer-events: none;
}
.unterschrift__marke {
    position: absolute; left: 26px; bottom: 20px;
    font-size: 12.5px; color: var(--text-3);
    pointer-events: none;
}
.getippt {
    font-family: "Segoe Script", "Bradley Hand", "Brush Script MT", cursive;
    font-size: 30px;
    color: var(--navy);
    padding: 34px 20px 24px;
    text-align: center;
    min-height: 170px;
}

/* Die Reiter „zeichnen / tippen". */
.wahl { display: flex; gap: 6px; margin-bottom: 10px; }
.wahl__knopf {
    flex: 1;
    min-height: var(--tap);
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    font: inherit; font-weight: 600; font-size: 14.5px;
    cursor: pointer;
}
.wahl__knopf.is-aktiv { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ── Nachrichten ───────────────────────────────────────────────────────── */
.faden { display: flex; flex-direction: column; gap: 12px; }
.blase { max-width: 78%; }
.blase__text {
    padding: 11px 14px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
    white-space: pre-wrap;
    font-size: 15px;
}
.blase__meta { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
/* Eigene Nachrichten rechts und grün — dieselbe Anordnung wie in jedem
   Nachrichtenprogramm, das der Benutzer schon kennt. */
.blase--eigen { align-self: flex-end; }
.blase--eigen .blase__text { background: var(--brand-50); border-color: var(--brand-100); }
.blase--eigen .blase__meta { text-align: right; }

/* ── Liste aus Bezeichnung und Wert ────────────────────────────────────── */
.werte { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 2px 14px; font-size: 15px; }
.werte dt { color: var(--text-2); }
.werte dd { margin: 0; }

/* ── Tabelle (Angebotspositionen) ──────────────────────────────────────── */
.tab { width: 100%; border-collapse: collapse; font-size: 15px; }
.tab th, .tab td { padding: 9px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.tab th { font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.tab .zahl { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tab tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--border); }

/* ── Leerer Zustand ────────────────────────────────────────────────────── */
.leer { padding: 30px 18px; text-align: center; color: var(--text-2); }

/* ── Telefon ───────────────────────────────────────────────────────────── */
@media (max-width: 620px) {
    body { font-size: 15.5px; }
    h1 { font-size: 21px; }
    .kopf__innen, .inhalt, .fuss__innen { padding: 0 14px; }
    .inhalt { padding-top: 16px; }
    .karte__leib, .karte__kopf, .karte__fuss, .pos, .auftrag { padding-left: 14px; padding-right: 14px; }
    .werte { grid-template-columns: 1fr; gap: 0 0; }
    .werte dt { margin-top: 8px; font-size: 13.5px; }
    .blase { max-width: 92%; }
    /* Der Hauptknopf geht über die volle Breite — er ist das Ziel. */
    .karte__fuss .knopf--haupt { width: 100%; }
}

/* ── Drucken ───────────────────────────────────────────────────────────── */
@media print {
    .kopf, .fuss, .karte__fuss, .knopf { display: none !important; }
    body { background: #fff; }
    .karte { border: 0; box-shadow: none; }
}
