/* MES.Plot – Website
   Farben aus der Viridis-Palette (wie in den Grafiken). Keine externen Schriften (Datenschutz). */

:root {
  --ink: #1b1b2f;
  --muted: #5a5a70;
  --line: #e4e6ee;
  --bg: #ffffff;
  --soft: #f5f6fa;
  --v1: #440154;
  --v2: #3b528b;
  --v3: #21918c;
  --v4: #5ec962;
  --v5: #fde725;
  --accent: #3b528b;
  --accent-dark: #2c3e6b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(27, 27, 47, .06), 0 4px 16px rgba(27, 27, 47, .05);
  --wrap: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--v1); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 750; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.95rem); font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 650; margin-top: 1.2em; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: .85rem; margin-top: 14px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------------------------------------------------------------- Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); }
.header-row { display: flex; align-items: center; gap: 24px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 1.3rem; letter-spacing: -.02em; }
.brand img { display: block; height: 36px; width: auto; }   /* Wortmarke wie bei den anderen MES-Produkten */
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.site-nav > a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 9px; font-size: .95rem; }
.site-nav > a:hover { background: var(--soft); color: var(--ink); }
.site-nav > a.active { background: var(--soft); font-weight: 600; }
.lang { display: flex; margin-left: 10px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.lang a { padding: 6px 10px; font-size: .8rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.lang a.current { background: var(--ink); color: #fff; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px; font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; }
.spectrum { height: 3px; background: linear-gradient(90deg, var(--v1), var(--v2), var(--v3), var(--v4), var(--v5)); }

/* ---------------------------------------------------------------- Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 11px; font-weight: 650; font-size: .98rem; text-decoration: none; border: 1px solid transparent; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: #fff; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { color: var(--v1); }
.btn-disabled { background: var(--soft); color: var(--muted); border-color: var(--line); cursor: default; }
.btn-disabled::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--v4); box-shadow: 0 0 0 3px rgba(94, 201, 98, .25); }
.btn-small { padding: 6px 14px; font-size: .85rem; border-radius: 8px; background: var(--soft); border-color: var(--line); color: var(--ink); }
.btn-small:hover { border-color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.arrow-link { font-weight: 600; text-decoration: none; }
.arrow-link::after { content: " →"; }

/* ---------------------------------------------------------------- Cards & Sections */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.section { padding: 76px 0; }
.section.soft { background: var(--soft); }
.section-lead { color: var(--muted); max-width: 720px; margin-bottom: 32px; }

.hero { padding: 72px 0 64px; background: radial-gradient(1200px 400px at 85% 0%, rgba(33, 145, 140, .08), transparent 60%), radial-gradient(900px 400px at 0% 100%, rgba(68, 1, 84, .06), transparent 60%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--v3); margin-bottom: 14px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; }
.hero-figure { margin: 0; padding: 18px; }
figure { margin: 0; }
figcaption { font-size: .8rem; color: var(--muted); margin-top: 8px; text-align: center; }

.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { padding: 26px 26px 18px; position: relative; }
.steps h3 { margin-top: 14px; }
.steps p { color: var(--muted); font-size: .96rem; }
.step-no { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-weight: 700; color: #fff; background: var(--v2); }
.steps li:nth-child(2) .step-no { background: var(--v3); }
.steps li:nth-child(3) .step-no { background: var(--v4); color: var(--ink); }

.plot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.plot-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 18px; text-decoration: none; color: var(--ink); transition: transform .15s ease, box-shadow .15s ease; }
.plot-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(27, 27, 47, .1); color: var(--ink); }
.plot-card .thumb { aspect-ratio: 4 / 3; display: grid; place-items: center; background: #fff; border-radius: 9px; overflow: hidden; margin-bottom: 6px; }
.plot-card .thumb img { max-height: 100%; object-fit: contain; }
.plot-card .muted { font-size: .88rem; line-height: 1.45; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.checklist { list-style: none; padding: 0; margin: 0 0 18px; }
.checklist li { position: relative; padding-left: 32px; margin-bottom: 14px; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .35em; width: 18px; height: 18px; border-radius: 50%;
  background: var(--v3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }

.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 20px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 16px 0; list-style: none; position: relative; padding-right: 28px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 12px; font-size: 1.4rem; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--muted); }

.cta-band { background: linear-gradient(120deg, var(--v1), var(--v2) 55%, var(--v3)); color: #fff; padding: 56px 0; }
.cta-band h2 { margin: 0; color: #fff; font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.cta-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band .btn-primary { background: #fff; color: var(--ink); }
.cta-band .btn-disabled { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .3); }

/* ---------------------------------------------------------------- Unterseiten */
.page-head { padding: 64px 0 36px; background: var(--soft); border-bottom: 1px solid var(--line); }
.page-head .btn { margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chips a { padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .88rem; }
.chips a:hover { border-color: var(--accent); color: var(--accent); }

.plot-detail { padding: 56px 0; border-bottom: 1px solid var(--line); }
.plot-detail:nth-of-type(even) { background: var(--soft); }
.plot-row { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: start; }
.plot-row figure { padding: 16px; }
.plot-row .tagline { font-size: 1.1rem; color: var(--muted); }
.plot-row h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--v3); margin: 1.4em 0 .3em; }
.plot-row p { margin-bottom: .6em; }
.encoding { padding-left: 1.2em; margin: 0; }
.encoding li { margin-bottom: 4px; }
.ref { font-size: .9rem; color: var(--muted); margin-top: 1.4em; }
.ref span { font-weight: 600; }

.table-wrap { overflow-x: auto; }
table.checks { width: 100%; border-collapse: collapse; }
.checks th, .checks td { text-align: left; vertical-align: top; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.checks thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); background: var(--soft); }
.checks tbody th { width: 30%; font-weight: 650; }
.checks tbody tr:last-child th, .checks tbody tr:last-child td { border-bottom: 0; }
.limits { padding-left: 1.2em; }
.limits li { margin-bottom: 12px; }

.copy-box { padding: 20px 22px; margin: 14px 0 34px; display: flex; gap: 18px; align-items: flex-start; }
.copy-box p { margin: 0; flex: 1; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9rem; line-height: 1.65; }
.refs { padding-left: 1.4em; }
.refs li { margin-bottom: 14px; font-size: .95rem; }
.refs .for { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--v3); }

.prose h2 { font-size: 1.25rem; margin-top: 1.6em; }
.notice { display: inline-block; background: #fff8d6; border: 1px solid #f0dc7a; padding: 8px 14px; border-radius: 9px; font-size: .9rem; }
.imprint dt { font-weight: 650; margin-top: 18px; }
.imprint dd { margin: 4px 0 0; color: var(--muted); }

a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.lang a:focus-visible { outline-offset: -2px; }
main:focus { outline: none; }
.btn-disabled:disabled { opacity: 1; }

/* ---------------------------------------------------------------- App-Link, Abmelden, Anmeldung */
.site-nav > a.nav-app { background: var(--accent); color: #fff; margin-left: 6px; }
.site-nav > a.nav-app:hover, .site-nav > a.nav-app.active { background: var(--accent-dark); color: #fff; }
.logout-form { margin: 0; }
.nav-button { background: none; border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px; font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; }
.nav-button:hover { border-color: var(--accent); color: var(--accent); }

.login-section { min-height: calc(100vh - 69px - 160px); display: grid; place-items: center; padding: 56px 16px; background: var(--soft); }
.login-card { width: 100%; max-width: 400px; padding: 36px 32px 28px; text-align: center; }
.login-logo { margin: 0 auto 14px; }
.login-card h1 { font-size: 1.6rem; }
.login-form { display: grid; gap: 6px; text-align: left; margin-top: 18px; }
.login-form label { font-size: .88rem; font-weight: 600; margin-top: 8px; }
.login-form input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.login-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.login-form .btn { margin-top: 16px; justify-content: center; }
.form-error { background: #fde2e1; color: #8a2317; border-radius: 9px; padding: 8px 12px; font-size: .9rem; }
.login-hint { margin: 18px 0 0; font-size: .88rem; color: var(--muted); }
.login-hint code { background: var(--soft); padding: 2px 6px; border-radius: 5px; color: var(--ink); }

/* ---------------------------------------------------------------- Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 28px; font-size: .92rem; }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; gap: 12px; align-items: center; }
.footer-brand img { display: block; }
.footer-nav { display: flex; gap: 20px; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--ink); }
.disclaimer { color: var(--muted); font-size: .8rem; margin: 22px 0 0; }

/* ---------------------------------------------------------------- Responsiv */
@media (max-width: 980px) {
  .hero-grid, .two-col, .plot-row { grid-template-columns: 1fr; gap: 36px; }
  .plot-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 69px; background: #fff; flex-direction: column; align-items: stretch; padding: 12px 24px 18px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .site-nav.open { display: flex; }
  .lang { margin: 10px 0 0; align-self: flex-start; }
  .section { padding: 52px 0; }
  .hero { padding: 44px 0; }
  .copy-box { flex-direction: column; }
}

@media (max-width: 480px) {
  .plot-grid { grid-template-columns: 1fr; }
  .wrap { padding: 0 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .plot-card { transition: none; }
}

/* ---------------------------------------------------------------- Konten, Einrichtung, Verwaltung */
.form-card { max-width: 460px; }
.login-form select, .login-form textarea { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
.login-form textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; resize: vertical; }
.form-note { margin: 4px 0 0; font-size: .84rem; color: var(--muted); text-align: left; }
.form-note code { word-break: break-all; }
.form-ok { background: #e3f4e4; color: #1d5b22; border-radius: 9px; padding: 8px 12px; font-size: .9rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.admin-section { padding: 40px 0 64px; }
.admin-search { display: flex; gap: 8px; margin: 18px 0; max-width: 480px; }
.admin-search input { flex: 1; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; font: inherit; }
table.admin-users { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.admin-users th, table.admin-users td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.admin-users th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.admin-users tr.is-locked td { color: var(--muted); }
.badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; background: var(--soft); border: 1px solid var(--line); font-size: .72rem; font-weight: 700; }
.status { font-weight: 600; font-size: .85rem; }
.status.ok { color: #1d5b22; }
.status.warn { color: #8a5a00; }
.status.bad { color: #8a2317; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0 4px 4px 0; }
.inline-form input[type=date], .inline-form input[type=password] { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .85rem; }
.pw-reset summary { cursor: pointer; font-size: .85rem; color: var(--accent); margin-top: 2px; }

/* ---------------------------------------------------------------- Hilfe (aus docs/hilfe gerendert) */
.help-topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.help-topic { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px; text-decoration: none; color: var(--ink); }
.help-topic:hover { border-color: var(--accent); }
.help-topic strong { font-size: 1.1rem; color: var(--accent); }
.help-crumb { margin: 0 0 10px; font-size: .9rem; }
.help-link { margin-top: 1em; font-size: .95rem; }
.help-link a { font-weight: 600; }

.help-doc { line-height: 1.65; }
.help-doc [id] { scroll-margin-top: 90px; }
.help-doc h2 { font-size: 1.45rem; margin-top: 2.2em; }
.help-doc h3 { font-size: 1.1rem; margin-top: 1.8em; }
.help-doc hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0 0; }
.help-doc ul, .help-doc ol { padding-left: 1.4em; }
.help-doc li { margin-bottom: 4px; }
.help-doc table { display: block; overflow-x: auto; border-collapse: collapse; margin: 1em 0 1.4em; font-size: .92rem; }
.help-doc th, .help-doc td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.help-doc thead th { background: var(--soft); font-weight: 650; }
.help-doc tbody th { font-weight: 650; }
.help-doc code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .88em; background: var(--soft); padding: 1px 5px; border-radius: 5px; }
.help-doc pre { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; }
.help-doc pre code { background: none; padding: 0; }
.help-doc blockquote { margin: 1.2em 0; padding: 12px 18px; background: #fff8d6; border-left: 4px solid #f0dc7a; border-radius: 0 9px 9px 0; }
.help-doc blockquote p { margin: .3em 0; }
