/* Bewerbungs-Assistent — mobil zuerst, Desktop als Erweiterung.
   Farben entsprechen dem Layout der Bewerbungsunterlagen (Petrol #1F4E5F). */

:root {
  --akzent: #1F4E5F;
  --akzent-hell: #4A7A8C;
  --grau: #595959;
  --dunkel: #262626;
  --rand: #dfe4e6;
  --flaeche: #ffffff;
  --grund: #eef1f3;
  --fehler: #a4302a;
  --fehler-bg: #fbeceb;
  --warn: #8a5a12;
  --warn-bg: #fdf4e3;
  --hinweis: #2b5f74;
  --hinweis-bg: #eaf3f6;
  --gut: #1d6b45;
  --gut-bg: #e8f5ee;
  --radius: 12px;
  --schrift: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--schrift);
  color: var(--dunkel);
  background: var(--grund);
  font-size: 16px;              /* nie kleiner: iOS zoomt sonst beim Tippen */
  -webkit-text-size-adjust: 100%;
}

h1, h2 { margin: 0 0 .4rem; line-height: 1.25; }
h1 { font-size: 1.25rem; }
h2 { font-size: 1.05rem; color: var(--akzent); }

p { margin: .3rem 0 .8rem; line-height: 1.5; }
.hilfe { color: var(--grau); font-size: .9rem; }
.opt { color: var(--grau); font-weight: 400; font-size: .85em; }

/* ---------- Formularelemente ---------- */
label {
  display: block;
  margin: .85rem 0 .3rem;
  font-size: .88rem;
  font-weight: 600;
  color: var(--akzent);
}
input[type=text], input[type=url], input[type=password], input:not([type]), textarea {
  width: 100%;
  padding: .8rem .85rem;
  font: inherit;
  font-size: 1rem;
  color: var(--dunkel);
  background: #fff;
  border: 1px solid var(--rand);
  border-radius: 10px;
  outline: none;
}
input:focus, textarea:focus {
  border-color: var(--akzent-hell);
  box-shadow: 0 0 0 3px rgba(74,122,140,.18);
}
textarea { resize: vertical; line-height: 1.5; }

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 48px;                 /* Fingergroesse */
  padding: .7rem 1.1rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--akzent);
  border: 1px solid var(--akzent);
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.knopf:active { transform: translateY(1px); }
.knopf[disabled] { opacity: .45; cursor: not-allowed; }
.knopf.leise { color: var(--akzent); background: #fff; border-color: var(--rand); }
.knopf.gross { width: 100%; margin-top: 1rem; font-size: 1.02rem; }
.knopf.breit { width: 100%; margin-top: .6rem; }
@media (hover: hover) {
  .knopf:hover:not([disabled]) { background: #17414f; }
  .knopf.leise:hover:not([disabled]) { background: #f3f7f8; }
}

.haken {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: 0;
  padding: .7rem .2rem;
  font-weight: 400;
  color: var(--dunkel);
  border-bottom: 1px solid var(--rand);
  cursor: pointer;
}
.haken:last-child { border-bottom: 0; }
.haken input { width: 22px; height: 22px; accent-color: var(--akzent); }

/* ---------- Anmeldung ---------- */
body.anmeldung {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 1.2rem;
}
.anmeldekarte {
  width: 100%;
  max-width: 380px;
  padding: 1.6rem 1.3rem 1.8rem;
  background: var(--flaeche);
  border-radius: 16px;
  box-shadow: 0 12px 34px rgba(31,78,95,.14);
}
.marke { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.3rem; }
.marke p { margin: .15rem 0 0; font-size: .88rem; color: var(--grau); }
.marke-punkt {
  flex: none;
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--akzent), var(--akzent-hell));
  border-radius: 11px;
}
.marke.klein .marke-punkt { width: 26px; height: 26px; border-radius: 8px; }

.meldung {
  margin: .8rem 0 0;
  padding: .7rem .85rem;
  font-size: .9rem;
  border-radius: 9px;
  background: var(--hinweis-bg);
  color: var(--hinweis);
}
.meldung.fehler { background: var(--fehler-bg); color: var(--fehler); }
.meldung.gut { background: var(--gut-bg); color: var(--gut); }

/* ---------- Kopf und Schritte ---------- */
.kopf {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .7rem .9rem;
  padding-top: max(.7rem, env(safe-area-inset-top));
  background: #fff;
  border-bottom: 1px solid var(--rand);
}
.kopf .marke strong { font-size: .98rem; }
.kopf-rechts { display: flex; gap: .4rem; align-items: center; }
.kopf-rechts form { margin: 0; }
.kopf-rechts .knopf { min-height: 40px; padding: .45rem .7rem; font-size: .85rem; }
#verlauf-knopf { display: none; }

.schritte {
  display: flex; gap: .3rem;
  padding: .6rem .9rem;
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid var(--rand);
  scrollbar-width: none;
}
.schritte::-webkit-scrollbar { display: none; }
.schritt {
  display: inline-flex; align-items: center; gap: .4rem;
  flex: none;
  padding: .35rem .7rem;
  font-size: .82rem;
  color: var(--grau);
  background: var(--grund);
  border-radius: 999px;
  white-space: nowrap;
}
.schritt i {
  display: grid; place-items: center;
  width: 20px; height: 20px;
  font-style: normal; font-size: .72rem; font-weight: 700;
  color: var(--grau);
  background: #fff;
  border-radius: 50%;
}
.schritt.aktiv { color: #fff; background: var(--akzent); }
.schritt.aktiv i { color: var(--akzent); }
.schritt.erledigt { color: var(--gut); background: var(--gut-bg); }
.schritt.erledigt i { color: var(--gut); }

main { padding: .9rem; padding-bottom: 3rem; }

.bereich { display: none; }
.bereich.sichtbar { display: block; }

.karte {
  margin-bottom: .9rem;
  padding: 1.05rem;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
}

/* ---------- Umschalter Bearbeiten/Vorschau ---------- */
.umschalter {
  display: flex;
  gap: .25rem;
  margin-bottom: .8rem;
  padding: .25rem;
  background: #fff;
  border: 1px solid var(--rand);
  border-radius: 11px;
}
.um {
  flex: 1;
  min-height: 42px;
  font: inherit; font-weight: 600; font-size: .92rem;
  color: var(--grau);
  background: transparent;
  border: 0; border-radius: 8px;
  cursor: pointer;
}
.um.aktiv { color: #fff; background: var(--akzent); }

.spalte { display: none; }
.spalte.sichtbar { display: block; }

/* ---------- Absatz-Editor ---------- */
.absatz-kopf { display: flex; align-items: baseline; justify-content: space-between; }
.zaehler { font-size: .82rem; color: var(--grau); }
.zaehler.zuviel { color: var(--warn); font-weight: 600; }

.absatz { position: relative; margin-bottom: .55rem; }
.absatz textarea {
  padding-right: 2.6rem;
  font-size: .95rem;
}
.absatz-weg {
  position: absolute; top: .45rem; right: .45rem;
  width: 30px; height: 30px;
  font-size: 1.1rem; line-height: 1;
  color: var(--grau);
  background: #fff;
  border: 1px solid var(--rand);
  border-radius: 7px;
  cursor: pointer;
}
.absatz-weg:active { background: var(--fehler-bg); color: var(--fehler); }

/* ---------- A4-Vorschau ---------- */
.blatt-rahmen { position: relative; }
.blatt-buehne { overflow: hidden; }
.blatt {
  width: 210mm;
  min-height: 297mm;
  padding: 15mm 20mm 12mm 24mm;      /* wie das DOCX im kompakten Modus */
  background: #fff;
  box-shadow: 0 6px 24px rgba(31,78,95,.16);
  transform-origin: top left;
  transform: scale(var(--zoom, 1));
  font-size: 10.5pt;
  line-height: 1.32;
  color: var(--dunkel);
}
.b-name { font-size: 22pt; font-weight: 700; color: var(--akzent); }
.b-kontakt {
  padding-bottom: 3pt;
  font-size: 9.5pt;
  color: var(--grau);
  border-bottom: 2.2pt solid var(--akzent);
}
.b-empfaenger { margin-top: 11pt; white-space: pre-line; }
.b-datum { margin-top: 11pt; text-align: right; }
.b-betreff { margin-top: 11pt; font-size: 11.5pt; font-weight: 700; color: var(--akzent); }
.b-anrede { margin-top: 11pt; }
.b-text p { margin: 0 0 7pt; text-align: left; }
.b-text p:first-child { margin-top: 7pt; }
.b-gruss { margin-top: 11pt; }
.b-signatur { margin-top: 16pt; }
.b-anlagen { margin-top: 11pt; font-size: 9.5pt; font-style: italic; color: var(--grau); }
.b-text .schreibt::after {
  content: "▍";
  color: var(--akzent-hell);
  animation: blinken 1s steps(2) infinite;
}
@keyframes blinken { 50% { opacity: 0; } }

.blatt-fuss {
  margin-top: .5rem;
  font-size: .8rem;
  color: var(--grau);
  text-align: center;
}
.blatt-fuss .warnung { color: var(--warn); font-weight: 600; }

/* ---------- Prüfung ---------- */
.pruef-status { margin: .6rem 0; font-size: .92rem; }
.befund {
  display: flex; gap: .7rem;
  margin-bottom: .55rem;
  padding: .75rem .85rem;
  border-radius: 10px;
  border-left: 4px solid;
}
.befund .marker { flex: none; font-size: 1rem; line-height: 1.35; }
.befund .inhalt { min-width: 0; }
.befund .titel { font-size: .93rem; line-height: 1.45; }
.befund .zitat, .befund .tipp {
  margin-top: .3rem;
  font-size: .84rem;
  color: var(--grau);
}
.befund .zitat { font-style: italic; }
.befund.fehler  { background: var(--fehler-bg);  border-color: var(--fehler);  color: var(--fehler); }
.befund.warnung { background: var(--warn-bg);    border-color: var(--warn);    color: var(--warn); }
.befund.hinweis { background: var(--hinweis-bg); border-color: var(--hinweis); color: var(--hinweis); }
.befund.gut     { background: var(--gut-bg);     border-color: var(--gut);     color: var(--gut); }
.befund .inhalt .titel { color: var(--dunkel); }

.fussleiste {
  position: sticky; bottom: 0;
  display: flex; gap: .5rem;
  margin: .9rem -.9rem -3rem;
  padding: .7rem .9rem;
  padding-bottom: max(.7rem, env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--rand);
  backdrop-filter: blur(6px);
}
.fussleiste .knopf { flex: 1; margin-top: 0; }
.fussleiste .knopf.gross { flex: 2; }

/* ---------- Verlauf ---------- */
.verlauf-zeile {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--rand);
}
.verlauf-zeile:last-child { border-bottom: 0; }
.verlauf-zeile .titel { flex: 1; min-width: 0; font-size: .93rem; }
.verlauf-zeile .titel small { display: block; color: var(--grau); font-size: .8rem; }
.verlauf-zeile .knopf { min-height: 38px; padding: .35rem .7rem; font-size: .82rem; }
.marke-fertig {
  padding: .12rem .45rem;
  font-size: .72rem; font-weight: 700;
  color: var(--gut); background: var(--gut-bg);
  border-radius: 999px;
}

/* ---------- Fertig ---------- */
.karte.fertig { text-align: center; }
.haken-gross {
  display: grid; place-items: center;
  width: 62px; height: 62px;
  margin: .4rem auto 1rem;
  font-size: 2rem; color: #fff;
  background: var(--gut);
  border-radius: 50%;
}

/* ---------- Ladeschirm ---------- */
.lader {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: 1.5rem;
  background: rgba(238,241,243,.94);
}
.lader-inhalt { max-width: 340px; text-align: center; }
.spinner {
  width: 42px; height: 42px;
  margin: 0 auto 1rem;
  border: 4px solid var(--rand);
  border-top-color: var(--akzent);
  border-radius: 50%;
  animation: dreh .9s linear infinite;
}
@keyframes dreh { to { transform: rotate(360deg); } }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  main { max-width: 1240px; margin: 0 auto; padding: 1.4rem; }
  .umschalter { display: none; }
  .zweispaltig {
    display: grid;
    grid-template-columns: minmax(360px, 460px) 1fr;
    gap: 1.2rem;
    align-items: start;
  }
  .spalte { display: block; }
  .spalte.vorschau { position: sticky; top: 5.4rem; }
  #verlauf-knopf { display: inline-flex; }
  .fussleiste {
    margin: 1.2rem 0 0;
    border-radius: var(--radius);
    border: 1px solid var(--rand);
  }
  .fussleiste .knopf { flex: none; min-width: 200px; }
}

@media (min-width: 1500px) {
  main { max-width: 1400px; }
}
