/* ==========================================================================
   Batterypass App – Oberfläche
   ========================================================================== */
:root {
  --bg: #f1f2f3; --surface: #fbfbfc; --surface-2: #e9ebed; --line: rgba(24,28,34,.1); --line-2: rgba(24,28,34,.2);
  --text: #1b1f25; --muted: #565d68; --volt: #2f7a6b; --cyan: #2b6f94; --violet: #4f67b0; --rose: #b12c49; --amber: #8f5d08;
  --r: 14px; --r-lg: 20px;
  --f: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--f); }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -0.015em; }
h1 { font-size: clamp(24px, 3vw, 32px); }
h2 { font-size: 18px; }
p { margin: 0 0 1em; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); font-size: .92em; }
.strong { font-weight: 600; color: var(--text); }
.break { word-break: break-all; }
.ok-text { color: var(--volt); }
.warn-text { color: var(--amber); }
.req { color: var(--volt); margin-left: 2px; }
.req[hidden] { display: none; }

/* Marke */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 17px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--volt); font-weight: 600; }
.logo { width: 32px; height: 32px; overflow: visible; }
.logo__pole { fill: none; stroke: currentColor; stroke-width: 3.6; stroke-linecap: round; }
.logo__ring { fill: none; stroke: url(#bp-mark); stroke-width: 3.6; }
.logo__bolt { fill: var(--volt); }
.brand--lg { font-size: 22px; margin-bottom: 28px; }
.brand--lg .logo { width: 38px; height: 38px; }

/* Knöpfe */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: 600 14px/1.2 var(--f); cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .2s, border-color .2s, transform .2s;
}
.btn:hover { text-decoration: none; border-color: rgba(24,28,34,.3); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--volt); border-color: var(--volt); color: #fff; }
.btn--primary:hover { background: #27685b; border-color: #27685b; }
.btn--ghost { background: transparent; }
.btn--danger { background: transparent; border-color: rgba(177,44,73,.5); color: var(--rose); }
.btn--sm { padding: 7px 13px; font-size: 13px; }
.btn--block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* App-Rahmen */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; padding: 12px clamp(16px, 3vw, 32px);
  background: rgba(241,242,243,.92); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.topnav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.topnav a[aria-current] { color: var(--text); background: var(--surface-2); }
.topbar__user { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.topbar__user form { margin: 0; }
.main { max-width: 1180px; margin: 0 auto; padding: clamp(20px, 3vw, 36px) clamp(16px, 3vw, 32px) 60px; }
.appfoot { max-width: 1180px; margin: 0 auto; padding: 24px clamp(16px, 3vw, 32px); color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .topnav { order: 3; flex: 0 0 100%; overflow-x: auto; }
  .topbar__user .muted { display: none; }
  .topbar__user { margin-left: auto; }
}

.pagehead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.pagehead--inline { align-items: center; margin-bottom: 14px; }
.pagehead--inline h2 { margin: 0; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.section-title { margin-top: 32px; }
.group-title { margin: 24px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(18px, 2.4vw, 26px); margin-bottom: 18px; }
.card--danger { border-color: rgba(177,44,73,.3); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .card, .grid2 { margin-bottom: 18px; }
@media (max-width: 860px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
.span2 { grid-column: 1 / -1; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.stats--sm { margin: 10px 0 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.stat strong { display: block; font-size: 24px; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.big { font-size: 40px; font-weight: 600; letter-spacing: -.03em; margin: 0; }

/* Meldungen */
.flash { padding: 12px 16px; border-radius: var(--r); margin-bottom: 16px; border: 1px solid; font-size: 14px; }
.flash--ok { background: rgba(47,122,107,.08); border-color: rgba(47,122,107,.35); color: #e8ffa3; }
.flash--error { background: rgba(177,44,73,.08); border-color: rgba(177,44,73,.4); color: #8f2039; }
.flash--info { background: rgba(43,111,148,.06); border-color: rgba(43,111,148,.3); color: #1f5f80; }
.empty { text-align: center; padding: 48px 20px; }

/* Formulare */
.form { display: grid; gap: 14px; }
.form--wide { display: block; }
.form--row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form--row label { min-width: 160px; }
.form--row .grow { flex: 1; min-width: 240px; }
label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 500; color: #3a404a; }
.label-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--text);
  font: 15px/1.4 var(--f); transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--volt); box-shadow: 0 0 0 3px rgba(47,122,107,.15); }
input:disabled, textarea:disabled { opacity: .6; }
.input-unit { position: relative; display: block; }
.input-unit i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: 13px; pointer-events: none; }
.input-unit input { padding-right: 90px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: auto; margin-top: 3px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form input { max-width: 260px; }
.sticky-actions { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); z-index: 5; }
.lock { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: rgba(79,103,176,.14); color: #4f67b0; }
.lock--na { background: rgba(143,93,8,.12); color: var(--amber); }
.drop { position: relative; display: block; padding: 28px; border: 1.5px dashed var(--line-2); border-radius: var(--r); text-align: center; cursor: pointer; }
.drop:hover, .drop.is-over { border-color: var(--volt); background: rgba(47,122,107,.04); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop.has-file span strong { color: var(--volt); }
.code { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; font: 13px/1.6 var(--f-mono); overflow-x: auto; color: #2b3038; }
.errors { color: #8f2039; font-size: 13.5px; margin-bottom: 14px; }
.errors summary { cursor: pointer; font-weight: 600; }
.search { display: flex; gap: 8px; }
.search input { width: 300px; max-width: 60vw; padding: 7px 12px; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
.card.table-wrap { padding: 6px 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.pager { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); }
.pager a[aria-current] { background: var(--volt); color: #fff; border-color: var(--volt); }

.meter { width: 140px; height: 6px; border-radius: 999px; background: rgba(24,28,34,.08); overflow: hidden; margin: 6px 0 4px; }
.meter i { display: block; height: 100%; width: var(--w); border-radius: inherit; }
.meter i.ok { background: var(--volt); } .meter i.mid { background: var(--cyan); } .meter i.low { background: var(--amber); }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(24,28,34,.08); }
.pill--original { background: rgba(47,122,107,.12); color: var(--volt); }
.pill--repurposed, .pill--reused, .pill--remanufactured { background: rgba(43,111,148,.12); color: var(--cyan); }
.pill--waste { background: rgba(177,44,73,.12); color: var(--rose); }

.readiness { display: flex; gap: 22px; align-items: flex-start; }
.ring { --p: 0; flex: none; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--volt) calc(var(--p) * 1%), rgba(24,28,34,.08) 0); }
.ring span { width: 76px; height: 76px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.chips { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { display: inline-block; padding: 4px 10px; border-radius: 999px; background: rgba(143,93,8,.1); color: var(--amber); font-size: 12.5px; }

.kv { display: grid; grid-template-columns: minmax(160px, 34%) 1fr; gap: 0; margin: 0; }
.kv dt, .kv dd { padding: 9px 0; border-bottom: 1px solid var(--line); margin: 0; }
.kv dt { color: var(--muted); font-size: 13.5px; padding-right: 16px; }
.kv .span-all { grid-column: 1 / -1; border-bottom: 0; padding-bottom: 0; }
.kv dd.span-all { padding: 4px 0 12px; border-bottom: 1px solid var(--line); }
.kv--tight dt, .kv--tight dd { padding: 7px 0; }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; } .kv dt { border-bottom: 0; padding-bottom: 0; } }

.timeline { list-style: none; margin: 0; padding: 6px 22px; }
.card.timeline { padding: 6px 22px; }
.timeline li { display: grid; grid-template-columns: 140px 1fr auto; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }
.timeline__time { color: var(--muted); font-size: 12.5px; }
@media (max-width: 700px) { .timeline li { grid-template-columns: 1fr; gap: 2px; } }

.qr { background: #fff; border-radius: 10px; padding: 8px; display: inline-block; line-height: 0; }
.qr svg { display: block; width: 100%; height: auto; }
.qr--lg { width: 200px; }
.qr-card { display: flex; gap: 22px; align-items: flex-start; }
@media (max-width: 600px) { .qr-card { flex-direction: column; } }

/* Anmeldung */
.auth { min-height: 100vh; padding: 0 clamp(16px, 3vw, 32px) 32px; }
.auth__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 1040px; margin: 0 auto; padding: 18px 0; }
.auth__shell { max-width: 460px; margin: clamp(8px, 4vh, 40px) auto 0; }
.auth__shell--split { max-width: 1040px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); border-radius: 26px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 30px 80px -40px rgba(24,28,34,.35); }
.auth__box { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(24px, 4vw, 44px); }
.auth__shell--split .auth__box { border: 0; border-radius: 0; }
.auth__box h1 { font-size: 26px; letter-spacing: -.025em; }
.auth__links { margin-top: 18px; font-size: 14px; color: var(--muted); text-align: center; line-height: 1.9; }
.auth__tabs { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 24px; border-radius: 999px; background: var(--surface-2); }
.auth__tabs a { padding: 7px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.auth__tabs a:hover { text-decoration: none; color: var(--text); }
.auth__tabs a[aria-current] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(24,28,34,.15); }
.auth__panel { background: #25282d; color: #f4f5f7; padding: clamp(24px, 4vw, 44px); display: flex; flex-direction: column; gap: 18px; }
.auth__panel .eyebrow { color: #74cbb7; }
.panel-title { font-size: 26px; line-height: 1.2; letter-spacing: -.025em; margin: 0; }
.plan-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.08); }
.plan-tabs a { flex: 1; text-align: center; padding: 8px 6px; border-radius: 999px; color: #bcc1cb; font-size: 14px; font-weight: 600; }
.plan-tabs a:hover { text-decoration: none; color: #fff; }
.plan-tabs a[aria-current] { background: #74cbb7; color: #102622; }
.plan-price strong { font-size: 42px; letter-spacing: -.03em; line-height: 1; }
.plan-price span { color: #bcc1cb; font-size: 14px; }
.plan-list { list-style: none; margin: 0; padding: 18px 0 0; border-top: 1px solid rgba(255,255,255,.14); display: grid; gap: 11px; font-size: 14.5px; }
.plan-list li { display: flex; gap: 10px; align-items: flex-start; }
.plan-list svg { flex: none; width: 17px; height: 17px; margin-top: 2px; color: #74cbb7; }
.plan-note { margin: 0; padding: 12px 14px; border-radius: 12px; background: rgba(116,203,183,.12); font-size: 13.5px; line-height: 1.5; }
.plan-trust { margin: auto 0 0; color: #bcc1cb; font-size: 13px; line-height: 1.6; }
.plan-more { color: #74cbb7; font-size: 14px; font-weight: 600; }
.pw { position: relative; display: block; }
.pw input { padding-right: 92px; }
.pw__show { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 5px 9px; border: 0; border-radius: 7px; background: var(--surface-2); color: var(--text); font: 600 12px var(--f); cursor: pointer; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.verify-note { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.verify-note form { margin: 0; }
@media (max-width: 860px) {
  .auth__shell--split { grid-template-columns: minmax(0, 1fr); }
  .auth__panel { order: 2; }
}

/* Sprachmenü */
.lang-menu { position: relative; }
.lang-menu summary { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 999px; list-style: none; cursor: pointer; font-weight: 600; font-size: 14px; background: var(--surface); border: 1px solid var(--line-2); white-space: nowrap; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary svg { width: 16px; height: 16px; flex: none; }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; min-width: 170px; margin: 0; padding: 8px; list-style: none; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 24px 60px -24px rgba(24,28,34,.4); }
.lang-menu li a { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 9px; color: var(--text); font-size: 14px; font-weight: 500; }
.lang-menu li a:hover { background: var(--surface-2); text-decoration: none; }
.lang-menu li a[aria-current] { color: var(--volt); font-weight: 600; }
.lang-menu li a[aria-current]::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Öffentliche Pass-Seite */
.public { background: radial-gradient(800px 420px at 10% -10%, rgba(79,103,176,.18), transparent 70%), var(--bg); }
.pub-wrap { max-width: 960px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px); }
.pub-head { border-bottom: 1px solid var(--line); }
.pub-head__row { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; padding-bottom: 14px; }
.pub-lang { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line-2); border-radius: 999px; }
.pub-lang a { padding: 5px 10px; border-radius: 999px; font: 500 12px var(--f-mono); color: var(--muted); }
.pub-lang a[aria-current] { background: var(--volt); color: #fff; }
.pub-lang a:hover { text-decoration: none; color: var(--text); }
.pub-lang a[aria-current]:hover { color: #fff; }
.pub-hero { display: grid; grid-template-columns: 1fr auto; gap: 28px; padding: 36px 0 24px; align-items: start; }
.pub-hero h1 { font-size: clamp(28px, 5vw, 42px); margin-top: 8px; }
.eyebrow { font: 600 12px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--volt); }
.pub-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 20px 0 0; }
.pub-facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.pub-facts dt { font-size: 12px; color: var(--muted); }
.pub-facts dd { margin: 2px 0 0; font-weight: 600; word-break: break-word; }
.pub-qr { display: grid; justify-items: center; gap: 8px; color: var(--muted); }
.pub-qr .qr { width: 150px; }
@media (max-width: 640px) { .pub-hero { grid-template-columns: 1fr; } .pub-qr { justify-items: start; } }
.pub-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(18px, 3vw, 26px); margin-bottom: 16px; }
.pub-foot { padding: 20px 0 48px; color: var(--muted); font-size: 13px; }

/* Etiketten */
.print-page { background: #fff; color: #111; }
.print-bar { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 20px; background: #25282d; color: #f4f5f7; z-index: 3; }
.print-bar label { display: flex; align-items: center; gap: 8px; color: #d4d7dd; }
.print-bar select { width: auto; padding: 6px 10px; }
.print-hint { padding: 10px 20px; color: #555; }
.labels { display: grid; gap: 4mm; padding: 8mm; }
.labels--s { grid-template-columns: repeat(3, 1fr); }
.labels--m { grid-template-columns: repeat(3, 1fr); }
.labels--l { grid-template-columns: repeat(2, 1fr); }
.label { display: flex; gap: 3mm; align-items: center; border: 1px dashed #bbb; border-radius: 2mm; padding: 3mm; break-inside: avoid; color: #111; }
.label .qr { padding: 0; border-radius: 0; flex: none; }
.labels--s .label .qr { width: 20mm; } .labels--m .label .qr { width: 28mm; } .labels--l .label .qr { width: 40mm; }
.label__text { display: grid; gap: 1mm; font-size: 9pt; line-height: 1.25; min-width: 0; }
.label__text span { word-break: break-all; }
.labels--l .label__text { font-size: 11pt; }

@media print {
  @page { size: A4; margin: 8mm; }
  .no-print { display: none !important; }
  .labels { padding: 0; }
  .label { border-color: #ddd; }
  body.public { background: #fff; color: #111; }
  .public .pub-card, .public .pub-facts div { background: #fff; border-color: #ccc; }
  .public .muted, .public .kv dt { color: #444; }
}
.legal { margin-top: 6px; }
.legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.auth__legal { margin-top: 20px; text-align: center; font-size: 12.5px; color: var(--muted); }
.topbar__user .lang-menu summary { min-height: 34px; padding: 0 12px; font-size: 13px; }
@media (max-width: 760px) { .topbar__user .lang-menu summary span { display: none; } }
.pub-lang { flex-wrap: wrap; justify-content: flex-end; }
