/* Atemschutz Südtirol – Grundgerüst
   Farben NUR über die Variablen unten. Darkmode: System-Einstellung, oder fest über
   <html data-theme="hell|dunkel"> (Umschalter in der App). */

:root {
  --bg:        #f4f5f7;
  --surface:   #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef1f5;
  --border:    #e3e6ec;
  --text:      #1f2937;
  --text-dim:  #4b5563;
  --text-mute: #6b7686;
  --accent:      #d32a27;   /* Logo-Rot */
  --accent-dark: #a81f1d;
  --accent-text: #ffffff;
  --accent-soft: rgba(211, 42, 39, .10);
  --ok:   #15803d;
  --warn: #b45309;
  --err:  #b91c1c;
  --bar-bg: rgba(255, 255, 255, .94);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06);

  --radius: 18px;
  --radius-sm: 12px;
  --topbar-h: 64px;
  color-scheme: light dark;
}
:root[data-theme="hell"] { color-scheme: only light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="hell"]) {
    --bg:        #0f1115;
    --surface:   #181b21;
    --surface-2: #1e2229;
    --surface-3: #262b33;
    --border:    #2e343d;
    --text:      #eef0f3;
    --text-dim:  #c3c8d0;
    --text-mute: #949ba6;
    --accent:      #e5484d;
    --accent-dark: #c43a3e;
    --accent-soft: rgba(229, 72, 77, .16);
    --ok:   #4ade80;
    --warn: #fbbf24;
    --err:  #f87171;
    --bar-bg: rgba(24, 27, 33, .94);
    --shadow: 0 1px 3px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dunkel"] {
  --bg:        #0f1115;
  --surface:   #181b21;
  --surface-2: #1e2229;
  --surface-3: #262b33;
  --border:    #2e343d;
  --text:      #eef0f3;
  --text-dim:  #c3c8d0;
  --text-mute: #949ba6;
  --accent:      #e5484d;
  --accent-dark: #c43a3e;
  --accent-soft: rgba(229, 72, 77, .16);
  --ok:   #4ade80;
  --warn: #fbbf24;
  --err:  #f87171;
  --bar-bg: rgba(24, 27, 33, .94);
  --shadow: 0 1px 3px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: pan-y; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Startbildschirm: Regeln stehen direkt in index.html (<style>), damit sie vor dieser Datei greifen. */
html { background: var(--bg); }

/* ── Rahmen ── */
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  min-height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 0;
  display: flex; align-items: center; gap: 12px;
  background: var(--bar-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar-logo { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 18px; font-weight: 800; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title p { font-size: 13px; color: var(--text-mute); }
.icon-btn {
  width: 48px; height: 48px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { transform: scale(.95); }

.app-main {
  flex: 1;
  width: 100%; max-width: 720px; margin: 0 auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 16px;
}

/* ── Bausteine ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.card p { color: var(--text-dim); }
.hinweis { font-size: 13px; color: var(--text-mute); }
.hinweis-warn { color: var(--warn); }
.card-warn { border: 2px solid var(--warn); }
.card-warn h2 { color: var(--warn); }
.schritte { margin: 10px 0 0; padding-left: 22px; color: var(--text-dim); display: flex; flex-direction: column; gap: 6px; }

.btn {
  min-height: 48px; padding: 12px 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 16px; font-weight: 700; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:active { background: var(--accent-dark); }
.btn-secondary { background: var(--surface-3); color: var(--text); border-color: var(--border); }
.btn-block { width: 100%; }

.segmented { display: flex; gap: 6px; padding: 4px; background: var(--surface-3); border-radius: var(--radius-sm); }
.segmented button {
  flex: 1; min-height: 48px; border: 0; border-radius: 9px;
  background: transparent; color: var(--text-dim); font-size: 15px; font-weight: 600; cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.noscript { padding: 24px; text-align: center; }
