/* Schreibassistent – dunkle Oberfläche im SUT-Auftritt.
   Farbwerte bewusst als Variablen: eine Stelle für Anpassungen. */

:root {
  --grund:        #12151c;   /* Seitenhintergrund */
  --flaeche:      #191d26;   /* Karten, Formularblöcke */
  --flaeche-hoch: #212734;   /* Eingabefelder, hervorgehobene Zeilen */
  --rand:         #2b3240;
  --rand-hell:    #3a4354;
  --text:         #e6e9ef;
  --text-leise:   #9aa3b2;
  --text-still:   #6d7686;
  --akzent:       #4d7cc7;   /* Blau – Hauptaktion */
  --akzent-hoch:  #5d8cd8;
  --signatur:     #3f8f68;   /* Grün – unterschreiben */
  --signatur-hoch:#4aa178;
  --warnung:      #d98b4a;
  --fehler:       #d9605e;
  --erfolg:       #5fb37f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main { max-width: 1240px; margin: 0 auto; padding: 26px 22px 70px; }
h1 { font-size: 21px; font-weight: 600; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 14px; color: var(--text-leise);
     text-transform: uppercase; letter-spacing: .06em; }
a { color: var(--akzent-hoch); }

/* ---------- Kopfleiste ---------- */
.kopf {
  display: flex; align-items: center; gap: 18px;
  background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
  padding: 0 24px; height: 62px;
}
.marke { display: flex; align-items: center; gap: 13px; text-decoration: none; color: inherit; }
.marke img { height: 30px; width: auto; opacity: .95; display: block; }
.marke-text {
  font-weight: 600; font-size: 15px; letter-spacing: -.01em;
  padding-left: 13px; border-left: 1px solid var(--rand-hell);
}
.kopf nav { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.kopf nav a { color: var(--text-leise); text-decoration: none; font-size: 14px; }
.kopf nav a:hover { color: var(--text); }
.wer { color: var(--text-still); font-size: 13px; }
.inline { display: inline; }
.schlicht {
  background: none; border: none; color: var(--text-leise);
  cursor: pointer; font: inherit; font-size: 14px; padding: 0;
}
.schlicht:hover { color: var(--text); }

/* ---------- Anmeldung ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 14px;
  padding: 40px 38px 34px;
  width: 100%; max-width: 390px;
  text-align: center;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.4);
}
.login-logo { margin-bottom: 4px; }
.login-logo img { height: 62px; width: auto; opacity: .95; }
.login-box h1 { font-size: 19px; margin: 0; }
.login-box .hinweis { margin: -4px 0 10px; }

/* ---------- Formulare ---------- */
label { display: block; margin-bottom: 15px; font-weight: 600; font-size: 13px;
        color: var(--text-leise); letter-spacing: .01em; }
input, select, textarea {
  width: 100%; font: inherit; font-weight: 400; font-size: 14.5px;
  padding: 10px 12px; margin-top: 6px;
  background: var(--flaeche-hoch); color: var(--text);
  border: 1px solid var(--rand); border-radius: 8px;
  transition: border-color .12s, background .12s;
}
input::placeholder, textarea::placeholder { color: var(--text-still); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--akzent); background: #252c3a;
}
select option { background: var(--flaeche-hoch); color: var(--text); }
textarea { resize: vertical; line-height: 1.6; }
.brieftext {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px; line-height: 1.65;
}

button, .knopf-zweit, .knopf-unterschrift {
  font: inherit; font-size: 14px; font-weight: 500;
  padding: 10px 20px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; text-decoration: none; display: inline-block;
  transition: background .12s, border-color .12s;
}
button { background: var(--akzent); color: #fff; }
button:hover { background: var(--akzent-hoch); }
button:disabled { opacity: .45; cursor: default; background: var(--akzent); }
.knopf-zweit { background: transparent; color: var(--text); border-color: var(--rand-hell); }
.knopf-zweit:hover { background: var(--flaeche-hoch); border-color: var(--akzent); }
.knopf-unterschrift { background: var(--signatur); color: #fff; }
.knopf-unterschrift:hover { background: var(--signatur-hoch); }
.klein { padding: 5px 12px; font-size: 12.5px; }
.loeschen { background: transparent; color: var(--fehler); border-color: var(--rand-hell); }
.loeschen:hover { background: rgba(217,96,94,.12); border-color: var(--fehler); }
.knopfreihe { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.waagrecht { display: flex; align-items: center; gap: 9px; font-weight: 400; color: var(--text); }
.waagrecht input { width: auto; margin: 0; accent-color: var(--akzent); }
.anlegen { max-width: 440px; display: flex; flex-direction: column; gap: 11px; }
.ablage-wahl { margin: 2px 0 16px; font-size: 13.5px; }

.pw-feld { position: relative; display: flex; }
.pw-feld input { padding-right: 44px; }
.pw-auge {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 7px 9px; cursor: pointer;
  font-size: 15px; opacity: .45; color: inherit;
}
.pw-auge:hover { opacity: 1; background: none; }

/* ---------- Seitenaufbau ---------- */
.spalten { display: grid; grid-template-columns: 1fr 330px; gap: 26px; align-items: start; }
.haupt-spalte, .neben-spalte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 12px;
  padding: 24px 26px;
}
.neben-spalte { padding: 22px; }
.zweispaltig { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.zurueck { margin: 0 0 16px; }
.zurueck a { color: var(--text-leise); text-decoration: none; font-size: 14px; }
.zurueck a:hover { color: var(--text); }

.hinweis { color: var(--text-still); font-size: 13px; line-height: 1.55; margin: 7px 0 16px; }
.hinweis strong { color: var(--text-leise); }
.leicht { font-weight: 400; color: var(--text-still); }
.fehler { color: var(--fehler); font-size: 13.5px; margin: 2px 0 0; min-height: 19px; }
.meldung {
  background: rgba(95,179,127,.12); border: 1px solid rgba(95,179,127,.3);
  color: var(--erfolg); padding: 10px 14px; border-radius: 8px; font-size: 13.5px;
}
.fehler-kasten {
  background: rgba(217,96,94,.1); border: 1px solid rgba(217,96,94,.3);
  color: var(--fehler); padding: 10px 14px; border-radius: 8px; font-size: 13.5px;
}
code {
  background: var(--flaeche-hoch); border: 1px solid var(--rand);
  padding: 1px 6px; border-radius: 5px; font-size: .9em; color: var(--text-leise);
}

/* ---------- Unterlage hineinziehen ---------- */
.ablage {
  border: 1px dashed var(--rand-hell); border-radius: 10px;
  padding: 16px 18px; margin: 4px 0 18px;
  background: rgba(255,255,255,.015);
  transition: background .15s, border-color .15s;
}
.ablage.bereit { border-color: var(--akzent); background: rgba(77,124,199,.09); }
.ablage-text { margin: 0; font-size: 13.5px; color: var(--text-leise); }
.ablage .hinweis { margin: 5px 0 0; }
.wie-link {
  background: none; border: none; padding: 0; color: var(--akzent-hoch);
  text-decoration: underline; cursor: pointer; font: inherit;
}
.wie-link:hover { background: none; color: var(--text); }
#unterlage-status { margin-top: 11px; font-size: 13px; }
.unterlage-ok { color: var(--erfolg); }
.unterlage-fehler { color: var(--fehler); }
.unterlage-laeuft { color: var(--text-still); }

/* ---------- Liste der Schreiben ---------- */
.suchzeile { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.suchzeile input[type=search] { margin: 0; }
.brief-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.brief-liste a {
  display: block; padding: 10px 12px; border-radius: 8px;
  text-decoration: none; color: inherit;
  border: 1px solid transparent; transition: background .12s, border-color .12s;
}
.brief-liste a:hover { background: var(--flaeche-hoch); border-color: var(--rand); }
.brief-typ { display: block; font-weight: 500; font-size: 13.5px; color: var(--text); }
.brief-datum { display: block; color: var(--text-still); font-size: 11.5px; margin-top: 2px; }
.brief-auszug { display: block; color: var(--text-leise); font-size: 12.5px; margin-top: 3px; }
/* Zustandszeichen in der Liste – NICHT .marke nennen, das ist das Logo */
.zeichen-verwendet { font-size: 11px; color: var(--erfolg); }
.zeichen-privat { font-size: 11px; margin-right: 3px; }

/* ---------- Aufklappbares ---------- */
.pruefung {
  background: var(--flaeche); border: 1px solid var(--rand);
  border-radius: 10px; padding: 13px 18px; margin-top: 11px;
}
.pruefung summary {
  cursor: pointer; font-weight: 500; font-size: 13.5px; color: var(--text-leise);
  list-style: none;
}
.pruefung summary::-webkit-details-marker { display: none; }
.pruefung summary::before { content: "▸ "; color: var(--text-still); }
.pruefung[open] summary::before { content: "▾ "; }
.pruefung summary:hover { color: var(--text); }
.kritik {
  white-space: pre-wrap; font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px; line-height: 1.6; margin: 13px 0 0; color: var(--text-leise);
}

.unterschrift-zeile {
  display: flex; align-items: center; gap: 13px; flex-wrap: wrap;
  margin: 20px 0 4px; padding-top: 18px; border-top: 1px solid var(--rand);
}
.unterschrift-zeile .hinweis { margin: 0; }

/* ---------- Tabelle ---------- */
.tabelle { border-collapse: collapse; width: 100%; }
.tabelle th, .tabelle td {
  border-bottom: 1px solid var(--rand); padding: 10px 12px;
  text-align: left; font-size: 13.5px;
}
.tabelle th {
  color: var(--text-still); font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom-color: var(--rand-hell);
}
.tabelle input { width: auto; margin: 0; }
.tabelle tr:hover td { background: rgba(255,255,255,.02); }
.gesperrt-zeile td { color: var(--text-still); }
.knopfzelle { display: flex; gap: 7px; }
.schmal {
  max-width: 460px; margin: 0 auto;
  background: var(--flaeche); border: 1px solid var(--rand);
  border-radius: 12px; padding: 30px 32px;
}
.schmal h1 { margin-bottom: 10px; }
.zeichen-start {
  font-size: 11px; color: var(--warnung);
  border: 1px solid var(--warnung); border-radius: 4px;
  padding: 1px 6px; margin-left: 6px; white-space: nowrap;
}

@media (max-width: 950px) {
  .spalten { grid-template-columns: 1fr; }
  .zweispaltig { grid-template-columns: 1fr; }
  .kopf { padding: 0 16px; }
  .marke-text { display: none; }
}

/* --- Unterschriften-Editor (18.09.2026) ------------------------------------
   Aufbau wie in der Dokumenten-App, Farben im dunklen Stil dieser App. Das
   Blatt selbst bleibt weiss - so sieht man den Brief wie gedruckt. */
.editor { margin: 10px 0 28px; }
.editor-leiste {
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: 8px;
  padding: 10px 14px;
}
.variante-wahl { display: flex; gap: 14px; flex-wrap: wrap; }
.variante-wahl .haken { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.groesse-regler { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-leise); }
.groesse-regler input[type="range"] { width: 160px; }
.seiten-wahl { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.blatt {
  position: relative; display: inline-block; margin: 12px 0; max-width: 100%;
  width: 760px; background: #fff; border: 1px solid var(--rand-hell);
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
  /* Ziehen der Unterschrift soll nicht die Seite mitscrollen (Handy). */
  touch-action: none;
}
.seitenbild { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.unterschrift {
  position: absolute; cursor: grab; touch-action: none;
  border: 1px dashed rgba(63, 143, 104, 0.9); background: rgba(63, 143, 104, 0.06);
}
.unterschrift.wird-bewegt { cursor: grabbing; border-style: solid; background: rgba(63, 143, 104, 0.14); }
.unterschrift img { width: 100%; height: 100%; pointer-events: none; user-select: none; }
/* Anfasser bewusst gross: Mit dem Finger trifft man keine 8-Pixel-Ecke. */
.anfasser {
  position: absolute; right: -14px; bottom: -14px; width: 28px; height: 28px;
  border-radius: 50%; background: var(--signatur); border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4); cursor: nwse-resize; touch-action: none;
}
@media (max-width: 640px) {
  .editor-leiste { gap: 10px; }
  .groesse-regler input[type="range"] { width: 100%; }
}
