/* app.css – Aussehen der Handy-App. Große Schrift, starke Kontraste, hell und dunkel. */

:root {
  --grund: #f4f2ec;
  --flaeche: #ffffff;
  --bildgrund: #dedad0;
  --text: #15191d;
  --leise: #47505a;
  --linie: #b9b4a8;
  --haupt: #0b4f8a;
  --haupt-text: #ffffff;
  --verweis: #0b4f8a;
  --fokus: #b8440b;
  --gut: #17693a;
  --warn: #9a5a00;
  --warn-grund: #fff0cf;
  --warn-text: #5c3600;
  --fehler: #a3261d;
  --schatten: 0 6px 24px rgba(0, 0, 0, 0.18);
  --rand: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0f1317;
    --flaeche: #1b2128;
    --bildgrund: #05070a;
    --text: #f2f4f6;
    --leise: #b7c0c9;
    --linie: #46515c;
    --haupt: #8cc4ff;
    --haupt-text: #06223d;
    --verweis: #9ccbff;
    --fokus: #ffb347;
    --gut: #7fd69a;
    --warn: #ffc978;
    --warn-grund: #4a3300;
    --warn-text: #ffe2ae;
    --fehler: #ff9d94;
    --schatten: 0 6px 24px rgba(0, 0, 0, 0.6);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--grund);
}

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 1.1875rem; /* 19 px */
  line-height: 1.4;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
}

h1,
h2,
p {
  margin: 0;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

:focus-visible {
  outline: 3px solid var(--fokus);
  outline-offset: 3px;
}

[data-titel]:focus {
  outline: none;
}

.symbole {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.symbol {
  width: 1.5em;
  height: 1.5em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nur-vorlesen {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.versteckt {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ohne-skript {
  padding: 2rem var(--rand);
  font-weight: 700;
}

/* ---------------------------------------------------------------- Ansichten */

.sicht {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.sicht-rand {
  gap: 1rem;
  padding-top: calc(env(safe-area-inset-top) + 0.75rem);
  padding-right: calc(env(safe-area-inset-right) + var(--rand));
  padding-bottom: calc(env(safe-area-inset-bottom) + 1.25rem);
  padding-left: calc(env(safe-area-inset-left) + var(--rand));
}

.sicht-mitte {
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 2rem;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 600;
}

/* Bildschirmfüllend ohne Rollen der Seite (Vorschau, Ecken, Beleg) */
.sicht-voll {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 0;
  overflow: hidden;
  padding-right: env(safe-area-inset-right);
  padding-left: env(safe-area-inset-left);
}

.gross {
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 800;
}

.unter {
  color: var(--leise);
  font-size: 1.2rem;
}

.unter-eng {
  padding: 0.25rem var(--rand) 0.6rem;
  font-size: 1.1rem;
}

.klein {
  color: var(--leise);
  font-size: 1rem;
  text-align: center;
}

.kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
}

.leiste {
  display: grid;
  grid-template-columns: minmax(5.5rem, auto) 1fr minmax(5.5rem, auto);
  align-items: center;
  gap: 0.25rem;
  min-height: 3.5rem;
  padding: 0 0.5rem;
}

.sicht-rand > .leiste {
  margin: 0 -0.5rem;
}

.leiste-titel {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------ Schaltflächen */

.knopf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 4rem; /* 64 px */
  padding: 0.6rem 1rem;
  border: 2px solid var(--linie);
  border-radius: 1rem;
  background: var(--flaeche);
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.knopf:active {
  transform: scale(0.985);
}

.knopf-haupt {
  min-height: 4.5rem; /* 72 px */
  border-color: var(--haupt);
  background: var(--haupt);
  color: var(--haupt-text);
  font-size: 1.35rem;
}

.knopf-riesig {
  flex-direction: column;
  gap: 0.75rem;
  min-height: 9.5rem;
  border-radius: 1.5rem;
  font-size: 1.7rem;
}

.knopf-riesig .symbol {
  width: 3.25rem;
  height: 3.25rem;
  stroke-width: 1.7;
}

.knopf-klein {
  min-height: 3.25rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.knopf:disabled,
.knopf-rund:disabled {
  opacity: 0.45;
}

.knopf-text {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  min-height: 3rem;
  padding: 0 0.5rem;
  border: 0;
  border-radius: 0.6rem;
  background: none;
  color: var(--verweis);
  font-size: 1.15rem;
  font-weight: 600;
}

.knopf-rund {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  flex: none;
  padding: 0;
  border: 2px solid var(--linie);
  border-radius: 50%;
  background: var(--flaeche);
  color: var(--text);
}

/* ------------------------------------------------------------- Startseite */

.start-knoepfe {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.25rem;
  flex: 1 1 auto;
}

.statuszeile {
  min-height: 3.2rem;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
}

/* -------------------------------------------------------------- Anmeldung */

#sicht-anmeldung {
  justify-content: center;
}

.formular {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.formular label {
  margin-top: 0.6rem;
  font-weight: 700;
}

.formular .knopf {
  margin-top: 1rem;
}

input[type="text"],
input[type="password"],
input[type="search"] {
  width: 100%;
  min-height: 3.75rem;
  padding: 0.5rem 0.9rem;
  border: 2px solid var(--linie);
  border-radius: 0.9rem;
  background: var(--flaeche);
  color: var(--text);
  font-size: 1.25rem;
  -webkit-appearance: none;
  appearance: none;
}

input:focus-visible {
  outline-offset: 0;
  border-color: var(--fokus);
}

.meldung {
  font-size: 1.1rem;
  font-weight: 600;
}

.meldung:empty {
  display: none;
}

.meldung-fehler {
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--fehler);
  border-radius: 0.9rem;
  color: var(--fehler);
  background: var(--flaeche);
}

/* -------------------------------------------------------------- Wartebild */

.kreisel {
  width: 3.5rem;
  height: 3.5rem;
  border: 0.4rem solid var(--linie);
  border-top-color: var(--haupt);
  border-radius: 50%;
  animation: drehen 0.9s linear infinite;
}

@keyframes drehen {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------------------------------------------------- Bild mit Zoom */

.zoom-rahmen {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: var(--bildgrund);
  touch-action: none;
}

.zoom-rahmen img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  transform-origin: 0 0;
  will-change: transform;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.rahmen-meldung {
  position: absolute;
  top: 50%;
  right: 1.5rem;
  left: 1.5rem;
  transform: translateY(-50%);
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
}

/* ---------------------------------------------------------------- Vorschau */

.hinweise {
  padding: 0.6rem var(--rand) 0;
}

.hinweis-zeile {
  margin-bottom: 0.4rem;
  font-size: 1.1rem;
}

.hinweis-warnung {
  padding: 0.6rem 0.8rem;
  border-radius: 0.8rem;
  background: var(--warn-grund);
  color: var(--warn-text);
  font-weight: 700;
}

.seiten-leiste {
  display: flex;
  gap: 0.5rem;
  flex: none;
  padding: 0.5rem var(--rand) 0;
  overflow-x: auto;
}

.seiten-knopf {
  position: relative;
  flex: none;
  width: 3rem;
  height: 4rem;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--linie);
  border-radius: 0.5rem;
  background: var(--flaeche);
}

.seiten-knopf.aktiv {
  border: 4px solid var(--haupt);
}

.seiten-knopf img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.seiten-nr {
  position: absolute;
  right: 2px;
  bottom: 2px;
  padding: 0 0.3rem;
  border-radius: 0.25rem;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

.aktionen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  flex: none;
  padding: 0.75rem var(--rand) calc(env(safe-area-inset-bottom) + 0.75rem);
}

.aktionen > .knopf-haupt,
.aktionen > .aktionen-klein,
.aktionen > .knopf:only-child {
  grid-column: 1 / -1;
}

/* Zwei Schaltflächen nebeneinander: etwas kleinere Schrift, damit nichts umbricht */
.aktionen > .knopf:not(.knopf-haupt) {
  gap: 0.35rem;
  padding: 0.5rem 0.4rem;
  font-size: 1.1rem;
}

.aktionen.mit-problem > #v-neu {
  order: -1;
}

.aktionen-klein {
  display: flex;
  justify-content: space-between;
  order: 5;
}

/* ---------------------------------------------------------- Ecken anpassen */

.ecken-flaeche {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 1.5rem;
  touch-action: none;
}

.ecken-flaeche img {
  position: absolute;
  max-width: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.ecken-linien {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.ecken-linien polygon {
  fill: rgba(11, 79, 138, 0.18);
  stroke: #ffb347;
  stroke-width: 3;
  stroke-linejoin: round;
}

.ecke {
  position: absolute;
  width: 3rem;
  height: 3rem;
  margin: -1.5rem 0 0 -1.5rem;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: rgba(11, 79, 138, 0.45);
  box-shadow: 0 0 0 3px #0b4f8a, 0 2px 8px rgba(0, 0, 0, 0.5);
  touch-action: none;
}

/* ------------------------------------------------------------ Meine Belege */

.leiste-fest {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--grund);
}

.belege-liste {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.karte {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 6.5rem;
  padding: 0.7rem;
  border: 2px solid var(--linie);
  border-radius: 1rem;
  background: var(--flaeche);
  color: var(--text);
  text-align: left;
}

.karte-bild {
  display: block;
  width: 4rem;
  height: 5.25rem;
  overflow: hidden;
  border-radius: 0.5rem;
  background: var(--bildgrund);
}

.karte-bild img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.karte-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 0;
}

.karte-titel {
  max-width: 100%;
  overflow: hidden;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.karte-datum {
  color: var(--leise);
  font-size: 1rem;
}

.karte-betrag {
  align-self: start;
  font-weight: 700;
  white-space: nowrap;
}

.leer {
  padding: 2rem 0.5rem;
  color: var(--leise);
  font-size: 1.2rem;
  text-align: center;
}

.zustand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
}

.punkt {
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--leise);
}

.zustand-wartet .punkt {
  background: var(--warn);
}

.zustand-laeuft .punkt {
  background: var(--haupt);
  animation: pochen 1.6s ease-in-out infinite;
}

.zustand-lexware .punkt {
  background: var(--gut);
}

.zustand-hilfe .punkt {
  border-radius: 2px;
  background: var(--fehler);
}

@keyframes pochen {
  50% {
    opacity: 0.35;
  }
}

.marke {
  align-self: flex-start;
  padding: 0.1rem 0.5rem;
  border-radius: 0.4rem;
  background: var(--warn-grund);
  color: var(--warn-text);
  font-size: 0.95rem;
  font-weight: 700;
}

.marke-leise {
  padding: 0;
  background: none;
  color: var(--leise);
  font-weight: 400;
}

/* ------------------------------------------------------------ Belegansicht */

.beleg-fuss {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  flex: none;
  padding: 0.6rem var(--rand) calc(env(safe-area-inset-bottom) + 0.6rem);
}

.blaettern {
  display: flex;
  justify-content: space-between;
  align-self: stretch;
  margin-bottom: 0.2rem;
}

.beleg-zeile {
  font-size: 1.15rem;
  font-weight: 700;
}

.beleg-aufnahme {
  color: var(--leise);
  font-size: 1rem;
}

.beleg-hilfe {
  font-size: 1.05rem;
}

.nebenaktionen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  align-self: stretch;
  margin-top: 0.4rem;
}

/* ----------------------------------------------------------- Einstellungen */

.einst-zeile {
  margin-top: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
}

#einst-abmelden {
  margin-top: 1rem;
}

/* ------------------------------------------------- Blatt, Rückfrage, Meldung */

.blatt {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.6);
}

.blatt-kasten {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
  max-height: 88vh;
  max-height: 88dvh;
  padding: 1.25rem calc(env(safe-area-inset-right) + var(--rand)) calc(env(safe-area-inset-bottom) + 1.25rem) calc(env(safe-area-inset-left) + var(--rand));
  border-radius: 1.4rem 1.4rem 0 0;
  background: var(--flaeche);
  box-shadow: var(--schatten);
}

.blatt-kasten h2 {
  font-size: 1.4rem;
  line-height: 1.2;
}

.blatt-text {
  flex: 1 1 auto;
  min-height: 6rem;
  margin: 0;
  padding: 0.75rem;
  overflow: auto;
  border: 2px solid var(--linie);
  border-radius: 0.8rem;
  background: var(--grund);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.95rem;
  white-space: pre-wrap;
  -webkit-user-select: text;
  user-select: text;
}

.hinweis {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 0.75rem);
  right: var(--rand);
  left: var(--rand);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: var(--text);
  color: var(--grund);
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: var(--schatten);
}

.hinweis-erfolg {
  background: #17693a;
  color: #fff;
  font-size: 1.5rem;
}

.hinweis-erfolg .symbol {
  width: 2rem;
  height: 2rem;
  stroke-width: 3;
}

.hinweis-fehler {
  background: #a3261d;
  color: #fff;
}

/* ------------------------------------------------------ Weniger Bewegung */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .knopf:active {
    transform: none;
  }
}
