/* SMWForge NEO-Office – Firmenkunden-Portal. Gleiche Formensprache wie die Download-Seite. */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url("/download/assets/fonts/space-grotesk-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("/download/assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  --bg: #050912;
  --panel: rgba(12, 18, 32, .72);
  --line: rgba(140, 200, 255, .12);
  --line-strong: rgba(140, 200, 255, .26);
  --text: #e8eef6;
  --muted: #8794a8;
  --cyan: #00e5ff;
  --violet: #7c4dff;
  --magenta: #ff2bd6;
  --ok: #2bffa3;
  --warn: #ffc24d;
  --bad: #ff4d6d;
  --grad: linear-gradient(100deg, var(--cyan), #8a7dff 52%, var(--magenta));
  --radius: 14px;
  --sans: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: radial-gradient(ellipse at 50% -10%, #0d1b33 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .88em; }
code.wrap { word-break: break-all; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; letter-spacing: -.01em; margin: 4px 0 8px; }
h2 { font-size: 19px; margin-bottom: 12px; }
h2:not(:first-child) { margin-top: 22px; }
p + p { margin-top: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.nowrap { white-space: nowrap; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
.kicker a { color: inherit; }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 18px;
  padding: 12px var(--gutter);
  background: rgba(5, 9, 18, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav .logo img { display: block; height: 32px; width: auto; }
.nav-title { font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav-links a, .link-btn { color: var(--text); font: inherit; font-size: 15px; }
.nav-cta { border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 14px; }
.link-btn { background: none; border: 0; cursor: pointer; color: var(--cyan); padding: 0; font-size: 14px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--bad); }
form.inline { display: inline; }

/* Seite */
.page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 32px var(--gutter) 48px; flex: 1; }
.page-narrow { max-width: 720px; }
.page-wide { max-width: 1480px; }
.head { margin-bottom: 22px; }
.head-row { display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  backdrop-filter: blur(6px);
}
.panel-danger { border-color: rgba(255, 77, 109, .35); }
.auth { margin-top: 4vh; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.cols > .panel { margin-bottom: 0; }
.cols + .panel, .panel + .cols { margin-top: 20px; }
.footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 18px var(--gutter); color: var(--muted); font-size: 13.5px; border-top: 1px solid var(--line);
}

/* Meldungen */
.flash { border: 1px solid rgba(43, 255, 163, .35); background: rgba(43, 255, 163, .08); border-radius: 10px; padding: 10px 14px; margin-bottom: 18px; }
.flash-error { border-color: rgba(255, 77, 109, .45); background: rgba(255, 77, 109, .1); }
.note-warn { color: var(--warn); margin-bottom: 12px; }
.secret { font-size: 22px; letter-spacing: .06em; margin: 14px 0; padding: 12px 16px; border: 1px dashed var(--line-strong); border-radius: 10px; user-select: all; }
.badge { display: inline-block; font-size: 12px; font-family: var(--mono); padding: 1px 8px; border-radius: 999px; border: 1px solid; vertical-align: 1px; }
.badge-ok { color: var(--ok); border-color: rgba(43, 255, 163, .4); }
.badge-warn { color: var(--warn); border-color: rgba(255, 194, 77, .45); }
.badge-bad { color: var(--bad); border-color: rgba(255, 77, 109, .45); }
.warnings { list-style: none; margin-top: 12px; }
.warnings li { color: var(--warn); font-size: 13.5px; padding-left: 18px; position: relative; }
.warnings li::before { content: "!"; position: absolute; left: 4px; font-weight: 700; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: #0b1120; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 16px;
  transition: .2s; pointer-events: none; z-index: 50; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-bad { border-color: var(--bad); color: #ffd0d8; }

/* Formulare */
.form { display: grid; gap: 14px; margin-top: 14px; }
.form-inline { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.form label.check { display: flex; gap: 10px; align-items: flex-start; color: var(--text); }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.opt { font-size: 12px; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
input, select, textarea {
  font: inherit; color: var(--text); background: rgba(5, 9, 18, .7);
  border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 12px; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(0, 229, 255, .45); outline-offset: 1px; border-color: transparent; }
input[type=checkbox] { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--cyan); }
input[type=range] { padding: 0; accent-color: var(--cyan); background: none; border: 0; }
input:disabled, select:disabled, button:disabled { opacity: .5; cursor: not-allowed; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none !important;
  border-radius: 10px; padding: 10px 18px; border: 1px solid var(--line-strong); color: var(--text); background: transparent;
}
.btn-primary { border: 0; color: #050912; background: linear-gradient(90deg, var(--cyan), var(--violet)); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost:hover { border-color: var(--cyan); }
.btn-danger { border-color: rgba(255, 77, 109, .6); color: var(--bad); }
.btn-sm { padding: 6px 12px; font-size: 13.5px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Tabellen, Listen */
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line-strong); padding: 8px 10px; }
.table td { border-bottom: 1px solid var(--line); padding: 10px; vertical-align: top; }
.table-compact td { padding: 6px 10px; font-size: 13.5px; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form + form, .table .actions a + form, .table .actions form + a { margin-left: 12px; }
.table select { padding: 4px 8px; font-size: 13.5px; }
.panel:has(.table) { overflow-x: auto; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 10px 0 14px; }
.facts dt { color: var(--muted); }
.plain { list-style: none; display: grid; gap: 8px; margin-bottom: 12px; }
.plain form { margin-left: 10px; }
.filter { display: flex; gap: 6px; flex-wrap: wrap; }
.filter a { color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 14px; }
.filter a.on { color: var(--text); border-color: var(--cyan); }
.filter .count { font-family: var(--mono); font-size: 12px; margin-left: 4px; }
.icon-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0 18px; }
.dl-list { list-style: none; display: grid; gap: 10px; margin-bottom: 12px; }
.dl-list li { display: flex; align-items: center; gap: 12px; }
.dl-list .dl-name { flex: 1; }

/* ───────── Configurator ───────── */
.publish-box { display: grid; gap: 8px; justify-items: end; }
.designer { display: grid; grid-template-columns: minmax(340px, 440px) 1fr; gap: 22px; align-items: start; }
.controls .panel { padding: 18px; }
.previews { position: sticky; top: 76px; }
.colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.color { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; font-size: 13.5px; }
.color input[type=color] { grid-row: 1 / 3; width: 36px; height: 36px; padding: 2px; border-radius: 8px; cursor: pointer; }
.color .hex { font-family: var(--mono); font-size: 12.5px; padding: 3px 8px; width: 100%; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin: 12px 0; }
.icon-card { display: grid; justify-items: center; gap: 4px; text-align: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px; }
.icon-card img { width: 72px; height: 72px; }
.icon-card strong { font-size: 14px; }
.bg-form { margin-top: 12px; }
.bg-form output { font-family: var(--mono); font-size: 12px; color: var(--text); float: right; }

.preview-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tab { font: inherit; font-size: 13.5px; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.tab.active { color: var(--text); border-color: var(--cyan); }
.preview-stage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.preview-stage.single { grid-template-columns: 1fr; }
.preview-stage:not(.single) .mock-wrap[data-mock="NeoLaunch"] { grid-column: 1 / -1; }
.mock-wrap { margin: 0; overflow: hidden; }
.mock-wrap figcaption { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 6px; }
.mock-scale { transform-origin: 0 0; }

/* Nachbau der Programmfenster (1200 × 760, wird per JS skaliert). Farben aus den Firmen-Variablen. */
.preview-stage {
  --bg0: #050912; --bg1: #0a111f; --bg2: #0f1a2d; --bg3: #16253f; --line: #1c2b45; --line-bright: #2e4568;
  --text: #e6edf7; --text-dim: #9aabc7; --text-mute: #5e7092; --accent: #00e5ff; --accent2: #7c4dff; --accent3: #ff2bd6;
  --accent-rgb: 0, 229, 255; --bg0-rgb: 5, 9, 18;
}
.mock {
  position: relative; width: 1200px; height: 760px; overflow: hidden;
  display: flex; flex-direction: column;
  font-family: Bahnschrift, "Segoe UI", var(--sans); font-size: 15px; color: var(--text);
  background: radial-gradient(ellipse at 50% 0, var(--bg2), var(--bg0) 80%);
  border: 1px solid var(--accent); border-image: linear-gradient(135deg, var(--accent), var(--accent2) 55%, var(--accent3)) 1;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .55);
}
.mock-title { position: relative; z-index: 2; height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: var(--bg1); border-bottom: 1px solid var(--line); }
.mock-title::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent) 20%, var(--accent2) 60%, var(--accent3) 85%, transparent); opacity: .7; }
.mock-title img { width: 24px; height: 24px; }
.mock-title span:nth-of-type(1) { font-weight: 600; letter-spacing: .04em; }
.mock-ttl { color: var(--text-dim); margin-left: 6px; }
.mock-win { margin-left: auto; color: var(--text-mute); letter-spacing: .5em; }
.hud { background-color: var(--bg1); background-image: linear-gradient(rgba(var(--accent-rgb), .07) 1px, transparent 1px), linear-gradient(90deg, rgba(var(--accent-rgb), .07) 1px, transparent 1px); background-size: 24px 24px; }
.mock-toolbar, .mock-ribbon { position: relative; z-index: 2; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.mock-search { width: 300px; color: var(--text-mute); border: 1px solid var(--line-bright); border-radius: 8px; padding: 7px 12px; background: var(--bg0); }
.mock-btn { border: 1px solid var(--line-bright); border-radius: 8px; padding: 7px 14px; color: var(--text-dim); background: var(--bg2); }
.mock-btn.primary { border: 0; color: var(--bg0); font-weight: 600; background: linear-gradient(90deg, var(--accent), var(--accent2)); box-shadow: 0 0 16px rgba(var(--accent-rgb), .45); }
.mock-tab { padding: 6px 12px; color: var(--text-dim); border-bottom: 2px solid transparent; }
.mock-tab.on { color: var(--accent); border-color: var(--accent); }
.mock-ribbon .mock-btn:first-of-type { margin-left: auto; }
.mock-status { position: relative; z-index: 2; height: 34px; margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; font-size: 13px; color: var(--text-mute); background: var(--bg1); border-top: 1px solid var(--line); }
.mock-bar { width: 160px; height: 5px; border-radius: 3px; background: var(--bg3); overflow: hidden; }
.mock-bar b { display: block; width: 38%; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.mock-accent { color: var(--accent); }

.mock-launch-body { position: relative; z-index: 2; flex: 1; padding: 22px 26px; cursor: crosshair; overflow: hidden; }
.mock-bg { position: absolute; left: 0; right: 0; top: 102px; bottom: 34px; z-index: 0; background-color: transparent; }
.mock-dim { position: absolute; left: 0; right: 0; top: 102px; bottom: 34px; z-index: 1; background: var(--bg0); opacity: 0; pointer-events: none; }
.mock-group { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 4px 0 12px; display: flex; align-items: center; gap: 12px; }
.mock-group::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-bright), transparent); }
.mock-tiles { display: grid; grid-template-columns: repeat(auto-fill, 150px); gap: 14px; margin-bottom: 22px; }
.mock-tile { position: relative; height: 140px; border-radius: 12px; border: 1px solid var(--line); display: grid; justify-items: center; align-content: center; gap: 10px; overflow: hidden; background: linear-gradient(rgba(var(--bg0-rgb), .2), rgba(var(--bg0-rgb), .35)), linear-gradient(var(--bg2), var(--bg1)); opacity: .97; }
.mock-tile:first-child { border-color: var(--accent); box-shadow: 0 0 22px rgba(var(--accent-rgb), .45); }
.mock-tile img, .mock-ph { width: 56px; height: 56px; }
.mock-ph { border-radius: 12px; background: linear-gradient(135deg, var(--bg3), var(--line-bright)); }
.mock-tile span:last-of-type { font-size: 14px; }
.mock-tile i { position: absolute; right: 10px; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: #2bffa3; }
.mock-topline { position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent) 20%, var(--accent2) 60%, var(--accent3) 85%, transparent); opacity: .8; }

.mock-content { flex: 1; display: flex; gap: 18px; padding: 24px; background: var(--bg0); }
.mock-page { position: relative; flex: 0 0 520px; margin: 0 auto; background: #f4f6fa; border-radius: 4px; padding: 54px 60px; display: grid; align-content: start; gap: 14px; box-shadow: 0 0 0 1px var(--line-bright), 0 0 28px rgba(var(--accent-rgb), .18); }
.mock-page b { display: block; height: 10px; border-radius: 5px; background: #c9d1de; }
.mock-page b:first-child { width: 60%; height: 18px; background: #8a94a6; }
.mock-page b:nth-child(3) { width: 85%; }
.mock-page i { position: absolute; left: 60px; top: 160px; width: 3px; height: 22px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.mock-side { flex: 0 0 170px; border-right: 1px solid var(--line); background: repeating-linear-gradient(var(--bg1) 0 140px, transparent 140px 158px); }
.mock-grid { flex: 1; border: 1px solid var(--line); background-color: var(--bg1); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 110px 30px; position: relative; }
.mock-grid::after { content: ""; position: absolute; left: 220px; top: 90px; width: 110px; height: 30px; border: 2px solid var(--accent); box-shadow: 0 0 12px rgba(var(--accent-rgb), .6); }
.mock-panes { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mock-panes div { border: 1px solid var(--line); border-radius: 8px; background: repeating-linear-gradient(var(--bg1) 0 30px, var(--bg2) 30px 60px); }
.mock-panes div:first-child { border-color: var(--accent); }

@media (max-width: 1100px) {
  .designer { grid-template-columns: 1fr; }
  .previews { position: static; }
}
@media (max-width: 700px) {
  .preview-stage { grid-template-columns: 1fr; }
  .nav { flex-wrap: wrap; }
  .nav-title { display: none; }
  .publish-box { justify-items: start; }
}
.preview-stage:not(.single) .mock-wrap[data-mock="NeoLaunch"] { order: -1; }
.icon-card .file-btn { white-space: nowrap; font-size: 12.5px; padding: 5px 10px; }

/* ── Build-Fortschritt ─────────────────────────────────────────────────── */
.build { margin: 4px 0 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(5, 9, 18, .55); }
.build-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.build-title { font-weight: 600; }
.build-percent { font-family: var(--mono); color: var(--cyan); }
.build-eta { margin-left: auto; font-family: var(--mono); }
.build-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; display: inline-block; }
.build-bar { display: block; width: 100%; height: 8px; margin: 12px 0 8px; border: 0; border-radius: 99px; overflow: hidden;
  background: rgba(140, 200, 255, .1); appearance: none; -webkit-appearance: none; }
.build-bar::-webkit-progress-bar { background: rgba(140, 200, 255, .1); border-radius: 99px; }
.build-bar::-webkit-progress-value { background: linear-gradient(90deg, var(--cyan), var(--violet)); border-radius: 99px; transition: width .6s ease; }
.build-bar::-moz-progress-bar { background: linear-gradient(90deg, var(--cyan), var(--violet)); border-radius: 99px; }
.build-label { margin: 0 0 10px; }
.build-programs { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.bp { font-size: 12.5px; font-family: var(--mono); padding: 2px 10px 2px 22px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); position: relative; }
.bp::before { content: ""; position: absolute; left: 8px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: currentColor; opacity: .7; }
.bp-baut { color: var(--cyan); border-color: rgba(0, 229, 255, .45); }
.bp-baut::before { animation: build-pulse 1.1s ease-in-out infinite; }
.bp-gebaut, .bp-aktuell { color: var(--ok); border-color: rgba(43, 255, 163, .35); }
.bp-fehler { color: var(--bad); border-color: rgba(255, 77, 109, .45); }
.build-laeuft .build-dot, .build-wartet .build-dot, .build-geplant .build-dot { background: var(--cyan); animation: build-pulse 1.1s ease-in-out infinite; }
.build-wartet .build-dot, .build-geplant .build-dot { background: var(--warn); }
.build-aktuell .build-dot { background: var(--ok); }
.build-fehler { border-color: rgba(255, 77, 109, .4); }
.build-fehler .build-dot { background: var(--bad); }
.build-aktuell .build-bar, .build-aktuell .build-programs { display: none; }
.build-aktuell { padding: 10px 14px; }
.build-aktuell .build-label { margin: 4px 0 0; }
@keyframes build-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .bp-baut::before, .build-dot { animation: none !important; } }

.pipeline-line { display: flex; align-items: center; gap: 10px; margin: -6px 0 14px; }
.pipeline-line.is-running .build-dot { background: var(--cyan); animation: build-pulse 1.1s ease-in-out infinite; }
.build-chip { font-family: var(--mono); white-space: nowrap; }
.build-chip.chip-laeuft { color: var(--cyan); }
.build-chip.chip-wartet, .build-chip.chip-geplant { color: var(--warn); }
.build-chip.chip-fehler { color: var(--bad); }
