/* MeshWeaver — Design im Funkmesh-Deutschland-Stil.
   Farben, Font (Inter) und Formsprache von funkmesh.de übernommen. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/Inter-Variable.woff2') format('woff2-variations'),
       url('/assets/fonts/Inter-Variable.woff2') format('woff2');
}

:root {
  --c-bg: #f7fbfb;
  --c-surface: #ffffff;
  --c-surface-alt: #f0f6f6;
  --c-text: #0b2424;
  --c-muted: #4a6464;
  --c-border: #d8e4e4;
  --c-accent: #0f766e;
  --c-accent-strong: #0d645d;
  --c-accent-soft: #14b8a6;
  --c-accent-2: #5eead4;
  --c-orange: #f97316;         /* Punkt aus dem Logo */
  --c-danger: #dc2626;
  --c-warn: #d97706;
  --c-ok: #0f766e;
  --shadow-sm: 0 1px 2px rgba(15, 118, 110, 0.06);
  --shadow: 0 8px 24px -8px rgba(15, 118, 110, 0.18), 0 2px 6px rgba(11, 36, 36, 0.05);
  --shadow-lg: 0 30px 60px -20px rgba(15, 118, 110, 0.25);
  --radius: 14px;
  --radius-lg: 22px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --gutter: clamp(1rem, 3vw, 2rem);
  --grad-accent: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
  --grad-hero: radial-gradient(circle at 0% 0%, rgba(94, 234, 212, 0.45) 0%, rgba(94, 234, 212, 0) 60%),
               radial-gradient(circle at 100% 100%, rgba(20, 184, 166, 0.28) 0%, rgba(20, 184, 166, 0) 60%),
               linear-gradient(135deg, #ffffff 0%, #ecfaf8 100%);
  --mono: "SF Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px; line-height: 1.6;
  color: var(--c-text); background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--c-accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--c-accent-strong); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
/* Überschriften nicht fokussierbar hervorheben oder markieren */
h1, h2, h3, h4 { outline: none; }
h1:focus, h2:focus, h3:focus, h4:focus { outline: none; }
.page-head h1 { -webkit-user-select: none; user-select: none; }
h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { color: var(--c-muted); }
code, kbd { font-family: var(--mono); font-size: .88em; background: var(--c-surface-alt); padding: .1em .35em; border-radius: 5px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* Sticky-Footer: App füllt mindestens die Viewport-Höhe, Footer dockt unten an */
.app-root { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
main.page { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }

/* ── Header / Nav ─────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 251, 251, 0.85);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(216, 228, 228, 0.7);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--c-text); }
.brand:hover { color: var(--c-text); }
.brand-mark { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text strong { font-size: 1.02rem; font-weight: 800; letter-spacing: -0.01em; }
.brand-text span { font-size: 0.74rem; color: var(--c-muted); margin-top: 3px; }

.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0.2rem; }
.primary-nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 10px;
  color: var(--c-text); font-weight: 500; font-size: 0.94rem;
}
.primary-nav a:hover { background: var(--c-surface-alt); color: var(--c-text); }
.primary-nav a.active { background: rgba(20, 184, 166, 0.14); color: var(--c-accent-strong); }
.primary-nav a .ico { font-size: .95rem; }

.nav-toggle {
  display: none; background: transparent; border: 0; padding: 8px;
  width: 44px; height: 44px; flex-direction: column; gap: 5px;
  align-items: center; justify-content: center; cursor: pointer;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--c-text); border-radius: 2px; }

/* ── Header connection pill ───────────────────────────── */
.conn-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: var(--c-surface); border: 1px solid var(--c-border);
}

/* ── Page ─────────────────────────────────────────────── */
.page { padding: clamp(1.6rem, 4vw, 2.6rem) 0 4rem; }
.page-head { margin-bottom: 1.6rem; }
.page-head .kicker { margin-bottom: 10px; }
.kicker { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-accent); }
.lead { font-size: 1.05rem; color: var(--c-muted); max-width: 65ch; }

/* ── Cards ────────────────────────────────────────────── */
.card {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 1.2rem;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-hero { background: var(--grad-hero); border-color: rgba(20, 184, 166, 0.3); }
.card-icon {
  width: 46px; height: 46px; border-radius: 12px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 1.3rem;
  background: rgba(20, 184, 166, 0.12); color: var(--c-accent); margin-bottom: 14px;
}
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s;
  font-family: inherit;
}
.btn-primary { background: var(--grad-accent); color: #fff; box-shadow: 0 6px 16px -4px rgba(15, 118, 110, 0.45); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 24px -6px rgba(15, 118, 110, 0.5); }
.btn-ghost { background: transparent; border-color: var(--c-border); color: var(--c-text); }
.btn-ghost:hover:not(:disabled) { background: #fff; border-color: var(--c-accent); }
.btn-danger { background: transparent; border-color: var(--c-danger); color: var(--c-danger); }
.btn-danger:hover:not(:disabled) { background: rgba(220, 38, 38, 0.08); }
.btn-sm { padding: 8px 15px; font-size: 0.86rem; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── Forms ────────────────────────────────────────────── */
label.field { display: block; margin-bottom: 16px; }
.field .lbl { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.field .hlp { font-size: .78rem; color: var(--c-muted); margin-top: .3rem; }
input, select, textarea {
  width: 100%; padding: 10px 12px; background: var(--c-surface); color: var(--c-text);
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  font-size: .94rem; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(20,184,166,.15); }
.input-unit { position: relative; }
.input-unit .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--c-muted); font-size: .82rem; pointer-events: none; }
.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; }
.switch input { width: auto; accent-color: var(--c-accent); }

/* ── Badges / status ──────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .6rem;
  border-radius: 999px; font-size: .74rem; font-weight: 700;
  background: var(--c-surface-alt); border: 1px solid var(--c-border); color: var(--c-muted);
}
.badge.ok { color: var(--c-accent-strong); background: rgba(20,184,166,.12); border-color: rgba(20,184,166,.4); }
.badge.warn { color: var(--c-warn); background: rgba(217,119,6,.1); border-color: rgba(217,119,6,.35); }
.badge.danger { color: var(--c-danger); background: rgba(220,38,38,.08); border-color: rgba(220,38,38,.35); }
.badge.cli { color: var(--c-orange); background: rgba(249,115,22,.1); border-color: rgba(249,115,22,.35); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c-muted); display: inline-block; }
.dot.on { background: var(--c-accent-soft); box-shadow: 0 0 0 4px rgba(20,184,166,.18); }
.dot.off { background: var(--c-danger); }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(20,184,166,.12); color: var(--c-accent-strong); font-weight: 600; font-size: .84rem; }

/* ── Alerts ───────────────────────────────────────────── */
.alert { border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px; border: 1px solid; font-size: .92rem; color: var(--c-text); }
.alert-info { background: rgba(20,184,166,.08); border-color: rgba(20,184,166,.35); }
.alert-warn { background: rgba(217,119,6,.08); border-color: rgba(217,119,6,.35); }
.alert-danger { background: rgba(220,38,38,.06); border-color: rgba(220,38,38,.35); }
.alert strong { color: var(--c-text); }

/* ── Progress ─────────────────────────────────────────── */
.progress { height: 12px; background: var(--c-surface-alt); border-radius: 999px; overflow: hidden; border: 1px solid var(--c-border); }
.progress > span { display: block; height: 100%; background: var(--grad-accent); transition: width .2s; }

/* ── Console ──────────────────────────────────────────── */
.console {
  background: #0b2424; color: #c7efe8;
  font-family: var(--mono); font-size: .82rem; line-height: 1.5;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  padding: 14px; height: 380px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
}
.console .tx { color: var(--c-accent-2); }
.console .err { color: #fca5a5; }

/* ── Lists ────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 14px 16px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-sm);
}
.list-item:hover { border-color: rgba(20,184,166,.4); }
.list-item .meta { font-size: .8rem; color: var(--c-muted); }

.setting-group { margin-bottom: 22px; }
.setting-group > h4 { color: var(--c-accent); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--c-border); padding-bottom: 6px; margin-bottom: 14px; }

.muted { color: var(--c-muted); }
.mono { font-family: var(--mono); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: .6rem; }
.spacer { flex: 1; }

/* ── Footer ───────────────────────────────────────────── */
.site-footer { background: #0b2424; color: #b4d4d0; padding: 40px 0 24px; margin-top: 32px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.site-footer a { color: #b4d4d0; }
.site-footer a:hover { color: #fff; }
.site-footer .foot-note { font-size: .84rem; color: #7fa4a0; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 820px) {
  .nav-row { flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; order: 2; }
  .brand { order: 1; }
  .header-conn { order: 3; }
  .primary-nav { order: 4; width: 100%; display: none; border-top: 1px solid var(--c-border); margin: 0 calc(-1 * var(--gutter)); padding: 8px var(--gutter) 12px; }
  .primary-nav.open { display: block; }
  .primary-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .primary-nav a { width: 100%; justify-content: flex-start; padding: 12px 14px; }
}

/* Blazor error UI */
#blazor-error-ui { background: var(--c-danger); color: #fff; bottom: 0; display: none; left: 0; padding: .8rem 1.2rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 1rem; top: .8rem; }

/* Blazor-Ladeindikator (Boot) */
.loading-progress {
  position: relative; display: block;
  width: 6rem; height: 6rem; margin: 22vh auto 1rem auto;
}
.loading-progress circle {
  fill: none; stroke: #d8e4e4; stroke-width: 0.5rem;
  transform-origin: 50% 50%; transform: rotate(-90deg);
}
.loading-progress circle:last-child {
  stroke: var(--c-accent-soft, #14b8a6);
  stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
  transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text {
  position: absolute; text-align: center; font-weight: 600;
  inset: calc(22vh + 2.5rem) 0 auto 0; color: var(--c-muted, #4a6464);
}
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Lädt …"); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
