:root {
  --bg: #eef3f8;
  --bg-2: #dce8f3;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: #ffffff;
  --text: #142033;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.32);
  --shadow: 0 22px 60px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.08);
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #16a34a;
  --yellow: #facc15;
  --red: #dc2626;
  --radius-xl: 28px;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(20, 184, 166, 0.16), transparent 30rem),
    linear-gradient(135deg, var(--bg), var(--bg-2));
}
a { color: inherit; }

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 42px;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, rgba(255,255,255,0.86), rgba(255,255,255,0.58));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero-text {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.status-pill {
  flex: none;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
  border: 1px solid rgba(22, 163, 74, 0.22);
  font-weight: 800;
  font-size: 0.88rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.module-card {
  min-height: 150px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  text-decoration: none;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.74);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.module-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(37, 99, 235, 0.34);
}

.module-card.primary {
  background: linear-gradient(145deg, rgba(37,99,235,0.96), rgba(14,165,233,0.82));
  color: white;
}

.module-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: rgba(37, 99, 235, 0.1);
  font-size: 1.45rem;
}

.primary .module-icon { background: rgba(255,255,255,0.18); }
.module-card strong { display: block; font-size: 1.12rem; margin-top: 2px; }
.module-card small { display: block; margin-top: 7px; color: var(--muted); line-height: 1.45; }
.primary small { color: rgba(255,255,255,0.82); }

.page-footer {
  text-align: center;
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.9rem;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.app-header h1 { font-size: clamp(1.8rem, 3vw, 3rem); }
.app-header p { margin: 8px 0 0; color: var(--muted); }

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn, button {
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  color: white;
  background: linear-gradient(135deg, var(--blue), #0ea5e9);
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

.btn.secondary, button.secondary {
  background: rgba(255,255,255,0.82);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn:hover, button:hover { transform: translateY(-1px); filter: brightness(1.02); }
.btn:active, button:active { transform: translateY(0); }

.status-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.station-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  background: rgba(255,255,255,0.76);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.station-card h2 {
  margin: 0 0 14px;
  font-size: 1.08rem;
}

.symbols-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 12px;
}

.symbol {
  min-height: 118px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(248,250,252,0.92);
  border: 1px solid rgba(148,163,184,0.25);
}

.icon {
  font-weight: 900;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.buttons button {
  padding: 9px 0;
  min-width: 0;
  border-radius: 12px;
  background: #e2e8f0;
  color: #334155;
  box-shadow: none;
}

.buttons button.selected.value-1, .value.value-1 { background: rgba(37, 99, 235, 0.15); color: #1d4ed8; }
.buttons button.selected.value-2, .value.value-2 { background: rgba(22, 163, 74, 0.16); color: #15803d; }
.buttons button.selected.value-3, .value.value-3 { background: rgba(250, 204, 21, 0.24); color: #854d0e; }
.buttons button.selected.value-4, .value.value-4 { background: rgba(220, 38, 38, 0.15); color: #b91c1c; }

.value {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-top: 8px;
  border-radius: 18px;
  font-size: 2rem;
  font-weight: 950;
}

.presenter-grid .symbol {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-card {
  max-width: 760px;
  margin: 8vh auto 0;
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.form-row {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px 16px;
  font: inherit;
  background: rgba(255,255,255,0.86);
  color: var(--text);
  outline: none;
}

input:focus { border-color: rgba(37, 99, 235, 0.55); box-shadow: 0 0 0 4px rgba(37,99,235,0.1); }
.status-message { margin-top: 16px; color: var(--muted); font-weight: 700; }

.pdf-body { height: 100vh; overflow: hidden; }
.pdf-toolbar {
  height: 76px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  background: rgba(255,255,255,0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
#filename { text-align: center; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pdf-container { height: calc(100vh - 76px); background: #0f172a; }
iframe { width: 100%; height: 100%; border: 0; }

@media (max-width: 720px) {
  .hero-card, .app-header { flex-direction: column; }
  .status-pill { align-self: flex-start; }
  .form-row { flex-direction: column; }
  .pdf-toolbar { grid-template-columns: 1fr 1fr; height: auto; }
  #filename { grid-column: 1 / -1; order: -1; }
  #pdf-container { height: calc(100vh - 126px); }
}


/* Dashboard-Erweiterung: Feuerwehr-Verknüpfung + dezente Animationen */
.portal-body .hero-card {
  position: relative;
  overflow: hidden;
  animation: dashboardFadeUp .65s cubic-bezier(.2,.8,.2,1) both;
}

.portal-body .hero-card::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -120px;
  top: -150px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(220,38,38,.20), transparent 68%);
  pointer-events: none;
  animation: dashboardGlow 7s ease-in-out infinite alternate;
}

.portal-body .module-card {
  animation: dashboardFadeUp .58s cubic-bezier(.2,.8,.2,1) both;
}

.portal-body .module-card:nth-child(1) { animation-delay: .05s; }
.portal-body .module-card:nth-child(2) { animation-delay: .10s; }
.portal-body .module-card:nth-child(3) { animation-delay: .15s; }
.portal-body .module-card:nth-child(4) { animation-delay: .20s; }
.portal-body .module-card:nth-child(5) { animation-delay: .25s; }

.module-card.fire {
  color: #fff;
  background:
    radial-gradient(circle at 18% 12%, rgba(255,212,71,.28), transparent 34%),
    linear-gradient(145deg, rgba(220,38,38,.98), rgba(127,29,29,.96));
  border-color: rgba(255,255,255,.38);
  box-shadow: 0 18px 46px rgba(220,38,38,.22);
}

.module-card.fire .module-icon {
  background: rgba(255,255,255,.18);
  color: #fff;
}

.module-card.fire small {
  color: rgba(255,255,255,.88);
}

.module-card.fire:hover {
  border-color: rgba(255,255,255,.72);
  box-shadow: 0 28px 70px rgba(220,38,38,.30);
}

@keyframes dashboardFadeUp {
  from { transform: translateY(18px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes dashboardGlow {
  from { transform: translate3d(0,0,0) scale(1); opacity: .7; }
  to { transform: translate3d(-30px,26px,0) scale(1.18); opacity: 1; }
}


/* Feuerwehr-Dashboard: nur Homepage, Verwaltung und Status Viewer */
.fire-dashboard {
  background:
    radial-gradient(circle at 12% 8%, rgba(220,38,38,.24), transparent 34rem),
    radial-gradient(circle at 88% 20%, rgba(250,204,21,.20), transparent 28rem),
    linear-gradient(135deg, #fff7f7, #eef3f8 46%, #f8fafc);
}

.fire-hero {
  position: relative;
  overflow: hidden;
  border-color: rgba(220,38,38,.18);
}

.fire-hero::before {
  content: "112";
  position: absolute;
  right: clamp(18px, 5vw, 48px);
  bottom: -24px;
  font-size: clamp(5rem, 13vw, 11rem);
  line-height: 1;
  font-weight: 950;
  letter-spacing: -.08em;
  color: rgba(220,38,38,.08);
  pointer-events: none;
}

.fire-dashboard .eyebrow {
  color: #991b1b;
}

.fire-dashboard h1 {
  color: #111827;
}

.fire-pill {
  color: white;
  background: linear-gradient(135deg, #dc2626, #7f1d1d);
  border-color: rgba(255,255,255,.4);
  box-shadow: 0 14px 32px rgba(220,38,38,.22);
}

.fire-module-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.fire-dashboard .module-card {
  min-height: 178px;
  border-color: rgba(127,29,29,.12);
}

.fire-dashboard .module-card strong {
  font-size: 1.22rem;
}

.fire-dashboard .module-card small {
  color: #475569;
  font-weight: 650;
}

.fire-dashboard .module-card.primary {
  background:
    radial-gradient(circle at 20% 10%, rgba(255,212,71,.20), transparent 38%),
    linear-gradient(145deg, #dc2626, #991b1b);
}

.fire-dashboard .module-card.primary small,
.fire-dashboard .module-card.fire small {
  color: rgba(255,255,255,.9);
}

@media (max-width: 860px) {
  .fire-module-grid {
    grid-template-columns: 1fr;
  }
}


/* Mobile-Optimierung Dashboard */
@media (max-width: 760px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding: 18px 0 28px;
  }

  .hero-card {
    padding: 22px;
    border-radius: 24px;
    flex-direction: column;
  }

  .fire-hero::before {
    right: 12px;
    bottom: -12px;
    font-size: clamp(4rem, 22vw, 7rem);
  }

  h1 {
    font-size: clamp(2.2rem, 13vw, 3.4rem);
    line-height: .94;
    letter-spacing: -.06em;
  }

  .hero-text {
    font-size: 1rem;
    line-height: 1.6;
  }

  .status-pill {
    align-self: flex-start;
  }

  .module-grid,
  .fire-module-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .module-card {
    min-height: 128px;
    padding: 20px;
    border-radius: 22px;
  }

  .module-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    font-size: 1.28rem;
  }

  .page-footer {
    line-height: 1.5;
    padding: 0 10px;
  }
}

@media (max-width: 390px) {
  .module-card {
    gap: 12px;
    padding: 18px;
  }

  .module-card strong {
    font-size: 1.05rem;
  }

  .module-card small {
    font-size: .9rem;
  }
}


/* Update: weniger oberer Leerraum im Dashboard */
.shell {
  padding-top: 22px;
}

@media (max-width: 760px) {
  .shell {
    padding-top: 14px;
  }
}



/* Tailwind-Dashboard Reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px) scale(.98);
  filter: blur(6px);
  transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1), filter .7s cubic-bezier(.2,.8,.2,1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.is-visible { transition: none !important; transform: none !important; filter: none !important; opacity: 1 !important; }
}
