/* Feuerwehr-App FF Velber – Plattform (Grundgestaltung, Kopfzeile, Login,
   Startseite, gemeinsame Bausteine). Module haben eigene CSS-Dateien. */
:root {
  --feuerrot: #C1121F;
  --feuerrot-d: #8E0D17;
  --ink: #1B1815;
  --muted: #756B5E;
  --paper: #FAF8F3;
  --surface: #FFFFFF;
  --line: #E7E1D6;
  --ok: #2E7D4F;
  --radius: 12px;
  --tap: 58px;
  --maxw: 540px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* hidden muss auch gegen display-Regeln wie .btn oder .topbar gewinnen */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
  overscroll-behavior-y: none;
}

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font: inherit; }

.app { max-width: var(--maxw); margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }

.label {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 800;
  font-size: 0.72rem;
  color: var(--muted);
}

/* ---- Kopfzeile ---- */
.topbar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  background: var(--ink); color: var(--paper);
  position: sticky; top: 0; z-index: 5;
}
.topbar .brand { font-weight: 800; letter-spacing: 0.05em; }
.topbar .brand small {
  display: block; font-weight: 600; font-size: 0.62rem;
  letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.65;
}
.topbar .spacer { flex: 1; }
.topbar button {
  color: var(--paper); border: 1px solid rgba(255,255,255,0.28);
  padding: 0.45rem 0.7rem; border-radius: 8px; font-size: 0.82rem; font-weight: 600;
}
.topbar button:active { background: rgba(255,255,255,0.12); }
.topbar .menu-btn { font-size: 1.1rem; line-height: 1; padding: 0.4rem 0.65rem; }

/* Menü (☰): klappt unter der Kopfzeile rechts auf */
.menu {
  position: absolute; top: calc(100% - 0.35rem); right: 0.9rem; z-index: 10;
  min-width: 13rem; padding: 0.3rem 0;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.topbar .menu button {
  color: var(--ink); border: 0; border-radius: 0; text-align: left;
  padding: 0.8rem 1rem; font-size: 0.95rem; font-weight: 600;
}
.topbar .menu button:active { background: var(--line); }

/* ---- Inhalt ---- */
.view { flex: 1; padding: 1.1rem; display: none; }
.view.active { display: block; }

.screen-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 0.2rem; }
.screen-sub { color: var(--muted); margin-bottom: 1.2rem; font-size: 0.95rem; }

/* ---- Anmeldung ---- */
#screen-login { display: none; flex-direction: column; justify-content: center; flex: 1; padding: 2rem 1.4rem; text-align: center; }
#screen-login.active { display: flex; }
.hero-logo { width: 96px; height: 96px; margin: 0 auto 1rem; }
.wordmark { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.brigade { margin-top: 0.35rem; }
.login-form { margin-top: 2rem; display: flex; flex-direction: column; gap: 0.7rem; text-align: left; }

.field { display: block; }
.field span { display: block; margin-bottom: 0.3rem; }
.input {
  width: 100%; padding: 0.85rem 0.9rem; border: 1.5px solid var(--line);
  border-radius: 10px; background: var(--surface);
}
.input:focus { outline: none; border-color: var(--feuerrot); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: var(--tap); padding: 0 1.1rem; border-radius: 10px;
  background: var(--feuerrot); color: #fff; font-weight: 800;
  letter-spacing: 0.02em; width: 100%; text-decoration: none;
}
.btn:active { background: var(--feuerrot-d); }
.btn.ghost { background: transparent; color: var(--feuerrot); min-height: 44px; font-weight: 700; }
.btn.ghost:active { background: rgba(193,18,31,0.07); }
.btn.dark { background: var(--ink); }
.btn.dark:active { background: #000; }

.msg { min-height: 1.3rem; font-size: 0.88rem; color: var(--feuerrot); font-weight: 600; }
.msg.ok { color: var(--ok); }

/* ---- Startseite: Kacheln der Module ---- */
.module-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.module-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 132px; padding: 1rem 0.6rem;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  font-weight: 800; text-align: center;
}
.module-tile img { width: 64px; height: 64px; border-radius: 14px; }
.module-tile:active { border-color: var(--feuerrot); }

/* ---- Gemeinsame Bausteine (Verwaltung, Hinweise) ---- */
.tabs { display: flex; gap: 0.4rem; margin-bottom: 1.1rem; border-bottom: 1.5px solid var(--line); }
.tabs button {
  padding: 0.6rem 0.2rem; font-weight: 700; color: var(--muted);
  border-bottom: 2.5px solid transparent; flex: 1;
}
.tabs button.active { color: var(--ink); border-bottom-color: var(--feuerrot); }

.row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 0.5rem; align-items: center;
  padding: 0.7rem 0; border-bottom: 1px solid var(--line);
}
.row input[type=text] { width: 100%; padding: 0.55rem 0.6rem; border: 1.5px solid var(--line); border-radius: 8px; }
.row .save { background: var(--ink); color: #fff; border-radius: 8px; padding: 0.5rem 0.7rem; font-weight: 700; font-size: 0.85rem; min-height: 40px; }
.row .save:active { background: #000; }
.row .toggle { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; color: var(--muted); }
.row.inactive { opacity: 0.5; }

.add-row { margin-top: 1rem; }

.hint { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--feuerrot); border-radius: 8px; padding: 0.7rem 0.85rem; font-size: 0.85rem; color: var(--muted); margin-top: 1rem; }

.danger-zone { margin-top: 2rem; padding-top: 1rem; border-top: 1.5px solid var(--line); }
.warn { background: rgba(193,18,31,0.06); border-left: 3px solid var(--feuerrot); border-radius: 8px; padding: 0.7rem 0.85rem; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.8rem; }
.confirm-buttons { display: grid; gap: 0.4rem; margin-top: 0.7rem; }

/* ---- App installieren ---- */
.install-status {
  display: inline-block; margin: 0.4rem 0 0.6rem; padding: 0.3rem 0.75rem; border-radius: 999px;
  font-weight: 800; font-size: 0.9rem; background: var(--line); color: var(--ink);
}
.install-status.ok { background: var(--ok); color: #fff; }
.install-status.no { background: var(--feuerrot); color: #fff; }
.install-head { font-size: 1.05rem; font-weight: 800; margin: 1.2rem 0 0.6rem; }
.install-manual { margin-top: 0.7rem; }
.install-steps { padding-left: 1.3rem; display: grid; gap: 0.35rem; }
