/* BT VertriebOS – Frosted Glass auf BT-Blau */
:root {
  --navy: #0A2138;
  --orange: #E88B00;
  --orange-hover: #F59B12;
  --text: #F3F6FA;
  --text-2: rgba(232, 239, 247, .74);
  --muted: rgba(232, 239, 247, .52);
  --stroke: rgba(255, 255, 255, .14);
  --stroke-2: rgba(255, 255, 255, .26);
  --ok: #3CC48A;
  --radius: 24px;
  --radius-sm: 12px;
  --blur: blur(30px) saturate(165%);
  --font: "Epilogue", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #07182A; }
body {
  margin: 0; min-height: 100vh;
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
svg { display: block; }
::selection { background: var(--orange); color: var(--navy); }

/* ---------- Hintergrund: klare Formen, damit das Glas sichtbar "frostet" ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(120% 90% at 0% 0%, #0F2C4D 0%, rgba(15,44,77,0) 55%),
    linear-gradient(170deg, #081C31 0%, #07182A 45%, #051222 100%);
}
.bg i { position: absolute; display: block; border-radius: 50%; filter: blur(110px); will-change: transform; }
.bg .a1 { width: 70vw; height: 60vh; left: -20vw; top: -25vh; background: #2B66AD; opacity: .38; animation: drift1 38s ease-in-out infinite alternate; }
.bg .a2 { width: 55vw; height: 55vh; right: -15vw; top: 10vh; background: #17457A; opacity: .5; animation: drift2 44s ease-in-out infinite alternate; }
.bg .a3 { width: 45vw; height: 45vh; right: -10vw; bottom: -20vh; background: #E88B00; opacity: .18; animation: drift3 50s ease-in-out infinite alternate; }
.bg .a4 { width: 40vw; height: 40vh; left: 10vw; bottom: -15vh; background: #3A78BF; opacity: .22; animation: drift2 56s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(8vw, 6vh) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-6vw, 8vh) scale(1.1); } }
@keyframes drift3 { to { transform: translate(-10vw, -6vh) scale(1.12); } }
.bg::after { content: ""; position: absolute; inset: 0; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- Glas ---------- */
.glass {
  background: linear-gradient(160deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,.04) 100%), rgba(10,33,56,.32);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 30px 60px -30px rgba(0,0,0,.6);
  border-radius: var(--radius);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--stroke); background: rgba(255,255,255,.07);
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; color: var(--text);
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,.14); border-color: var(--stroke-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: default; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--orange); border-color: var(--orange); color: var(--navy); font-weight: 700; }
.btn-primary:hover { background: var(--orange-hover); border-color: var(--orange-hover); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13.5px; }
.btn-block { width: 100%; height: 50px; font-size: 15px; }
.btn-icon { width: 34px; padding: 0; height: 34px; }
.btn-bare { background: transparent; border-color: transparent; }
.btn-bare:hover { background: rgba(255,255,255,.10); border-color: transparent; }
.btn.is-done { background: var(--ok); border-color: var(--ok); color: var(--navy); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* ---------- Formularfelder ---------- */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field > span em { font-style: normal; font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--stroke); border-radius: var(--radius-sm);
  background: rgba(6, 22, 38, .35); color: var(--text); outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
  color-scheme: dark;
}
.field textarea { height: auto; min-height: 70px; padding: 11px 14px; resize: vertical; line-height: 1.45; }
.field input::placeholder, .field textarea::placeholder { color: rgba(232,239,247,.32); }
.field input:focus, .field textarea:focus { border-color: var(--orange); background: rgba(6,22,38,.5); box-shadow: 0 0 0 3px rgba(232,139,0,.18); }
.field .num { text-align: right; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--orange); }

/* ---------- Login ---------- */
.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: 100%; max-width: 390px; padding: 34px 30px 30px; display: flex; flex-direction: column; gap: 18px; }
.gate-logo { width: 132px; height: auto; display: block; }
.gate-title { margin: 8px 0 0; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.gate-sub { margin: -12px 0 4px; color: var(--text-2); }
.gate-error { margin: 0; color: #FFB4A8; font-weight: 600; font-size: 14px; }
.gate-card.shake { animation: shake .35s; }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

/* ---------- Kopfzeile ---------- */
.topbar { max-width: 1320px; margin: 0 auto; padding: 26px 28px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { height: 34px; width: auto; display: block; }
.brand-sep { width: 1px; height: 26px; background: var(--stroke-2); }
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }

/* ---------- Seiten ---------- */
.view { max-width: 1320px; margin: 0 auto; padding: 44px 28px 150px; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.page-head h1 { margin: 0; font-size: clamp(34px, 4.6vw, 56px); line-height: 1; font-weight: 700; letter-spacing: -.035em; }
.page-head p { margin: 12px 0 0; color: var(--text-2); max-width: 560px; }

/* ---------- Mediadaten ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 18px; }
.tile { padding: 26px 24px 20px; display: flex; flex-direction: column; min-height: 250px; container-type: inline-size; min-width: 0; }
.tile h2 { margin: 0 0 8px; font-size: 26px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.tile p { margin: 0 0 22px; color: var(--text-2); font-size: 14.5px; line-height: 1.5; }
.tile-langs { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.lang-row { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 16px; background: rgba(6,22,38,.28); border: 1px solid rgba(255,255,255,.06); }
.flag { width: 24px; height: 16px; border-radius: 4px; overflow: hidden; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.18); }
.flag svg { width: 100%; height: 100%; }
.lang-name { font-size: 14px; font-weight: 500; margin-right: auto; padding-left: 4px; white-space: nowrap; }
.lang-row .btn-sm { flex: none; }
@container (max-width: 360px) {
  .lang-row:not(.is-missing) .lang-name { display: none; }
  .lang-row:not(.is-missing) .btn-sm { flex: 1; min-width: 0; padding: 0 8px; }
}
.lang-row.is-missing { opacity: .55; }
.lang-row.is-missing .lang-name { font-size: 13px; line-height: 34px; }

/* ---------- Firmendaten ---------- */
.facts { columns: 2 440px; column-gap: 18px; }
.fact { break-inside: avoid; margin: 0 0 18px; padding: 22px 24px; display: block; }
.fact-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 14px; }
.fact-head h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.015em; margin-right: auto; }
.fact-tag { font-size: 12px; font-weight: 600; color: var(--orange); }
.fact-block {
  width: 100%; text-align: left; background: rgba(6,22,38,.3); border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px; padding: 15px 16px; cursor: pointer; line-height: 1.6; font-size: 15.5px; color: var(--text);
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; white-space: pre-line;
  transition: border-color .15s, background .15s;
}
.fact-block:hover { border-color: var(--stroke-2); background: rgba(6,22,38,.42); }
.fact-rows { display: flex; flex-direction: column; }
.fact-row {
  display: grid; grid-template-columns: 150px 1fr auto; gap: 12px; align-items: center;
  padding: 11px 4px; border: 0; border-top: 1px solid rgba(255,255,255,.08); background: none;
  text-align: left; cursor: pointer; width: 100%; color: var(--text);
}
.fact-row:first-child { border-top: 0; }
.fact-row:hover .fact-val { color: var(--orange); }
.fact-label { font-size: 13px; color: var(--muted); }
.fact-val { font-weight: 600; font-variant-numeric: tabular-nums; word-break: break-word; transition: color .15s; }
.copy-ico { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.is-done .copy-ico { stroke: var(--ok); }
.note { margin-top: 14px; padding: 12px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; display: flex; gap: 10px; color: var(--text-2); }
.note b { flex: none; font-weight: 700; }
.note.info { background: rgba(58,120,191,.18); }
.note.info b { color: #9CC6F2; }
.note.warn { background: rgba(232,139,0,.14); }
.note.warn b { color: var(--orange); }

/* ---------- Angebot ---------- */
.offer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 500px); gap: 26px; align-items: start; }
.offer-form { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.card { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.015em; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1fr 1fr; }
.span2 { grid-column: span 2; }

.items { display: flex; flex-direction: column; gap: 12px; }
.item { border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 14px 16px 16px; display: grid; gap: 12px; background: rgba(6,22,38,.22); }
.item-head { display: flex; align-items: center; justify-content: space-between; }
.item-head b { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.item-tools { display: flex; gap: 2px; margin: -6px -8px -6px 0; }
.item-tools .btn-icon { color: var(--muted); }
.item-tools .btn-icon:hover { color: var(--text); }
.item-tools .btn-icon.danger:hover { color: #FFB4A8; }
.item-main { display: grid; grid-template-columns: minmax(0, 1fr) 148px 140px; gap: 10px; align-items: end; }
.item-foot { display: flex; justify-content: flex-end; align-items: baseline; gap: 10px; font-variant-numeric: tabular-nums; margin-top: -2px; }
.item-foot small { color: var(--muted); font-size: 12.5px; }
.item-foot span { font-weight: 700; font-size: 16px; }
.stepper { display: flex; height: 44px; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: rgba(6,22,38,.35); overflow: hidden; }
.stepper:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,139,0,.18); }
.stepper button { width: 44px; flex: none; border: 0; background: rgba(255,255,255,.06); color: var(--text); font-size: 20px; font-weight: 500; cursor: pointer; line-height: 1; transition: background .15s; }
.stepper button:hover { background: rgba(255,255,255,.14); }
.stepper button:active { background: var(--orange); color: var(--navy); }
.field .stepper input { border: 0; border-radius: 0; background: none; height: 100%; padding: 0 4px; text-align: center; font-variant-numeric: tabular-nums; min-width: 0; box-shadow: none; }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.discounts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.discounts:empty { display: none; }
.disc { display: grid; grid-template-columns: minmax(0, 1fr) 96px 110px 120px 34px; gap: 10px; align-items: end; }
.disc .amount { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; padding-bottom: 11px; color: var(--orange); }
.disc .btn-icon { margin-bottom: 5px; color: var(--muted); }
.disc .btn-icon:hover { color: #FFB4A8; }
.disc-empty { margin: -6px 0 14px; color: var(--muted); font-size: 14px; }
.seg { display: flex; border: 1px solid var(--stroke); border-radius: var(--radius-sm); overflow: hidden; height: 44px; background: rgba(6,22,38,.35); }
.seg button { border: 0; background: none; padding: 0 12px; cursor: pointer; font-weight: 600; font-size: 14px; flex: 1; color: var(--text-2); }
.seg button.on { background: var(--orange); color: var(--navy); }

.totals { display: grid; gap: 7px; font-variant-numeric: tabular-nums; margin-top: 4px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals .muted { color: var(--text-2); }
.totals .grand { border-top: 1px solid var(--stroke); margin-top: 6px; padding-top: 12px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }

.preview { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 12px; }
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px; }
.preview-bar .label { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.preview-bar .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); transition: background .2s; }
.preview-bar .dot.busy { background: var(--orange); }
.pages { display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 80px); overflow: auto; border-radius: 10px; scrollbar-width: thin; }
.pages canvas, .page-ph { display: block; width: 100%; height: auto; background: #fff; border-radius: 8px; flex: none; }
.page-ph { aspect-ratio: 210 / 297; }

/* ---------- PDF-Viewer (Mediadaten) ---------- */
.viewer { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center;
  background: rgba(4, 14, 26, .55); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; } }
.viewer-bar { width: min(980px, calc(100% - 32px)); margin-top: 16px; padding: 10px 10px 10px 20px; display: flex; align-items: center; gap: 8px; border-radius: 999px; flex: none; }
.viewer-title { margin-right: auto; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; min-width: 0; }
.viewer-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-body { flex: 1; width: 100%; overflow: auto; padding: 18px 16px 40px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.viewer-body canvas { width: min(940px, 100%); height: auto; display: block; border-radius: 6px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.8); background: #fff; flex: none; }
.viewer-msg { margin-top: 18vh; color: var(--text-2); text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.18); border-top-color: var(--orange); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Pillen-Navigation ---------- */
.pillnav {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 50; display: flex; align-items: center; gap: 4px; padding: 6px;
  background: linear-gradient(160deg, rgba(255,255,255,.16), rgba(255,255,255,.05)), rgba(10,33,56,.45);
  -webkit-backdrop-filter: blur(26px) saturate(190%); backdrop-filter: blur(26px) saturate(190%);
  border: 1px solid rgba(255,255,255,.22); border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 20px 50px -18px rgba(0,0,0,.7);
}
.pillnav a, .pill-icon {
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 999px;
  color: rgba(255,255,255,.82); text-decoration: none; font-weight: 600; font-size: 14.5px;
  transition: background .2s, color .2s; border: 0; background: none; cursor: pointer;
}
.pillnav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pillnav a:hover, .pill-icon:hover { color: #fff; background: rgba(255,255,255,.12); }
.pillnav a.active { background: var(--orange); color: var(--navy); }
.pill-icon { width: 48px; padding: 0; justify-content: center; margin-left: 2px; position: relative; }
.pill-icon::before { content: ""; position: absolute; left: -3px; top: 13px; bottom: 13px; width: 1px; background: rgba(255,255,255,.22); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 90;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: #fff; color: var(--navy); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  transition: opacity .2s, transform .2s; box-shadow: 0 16px 40px -12px rgba(0,0,0,.6); max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .offer { grid-template-columns: 1fr; }
  .preview { position: static; }
  .pages { max-width: 560px; width: 100%; margin: 0 auto; max-height: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 18px 16px 0; }
  .brand img { height: 28px; }
  .view { padding: 28px 16px 130px; }
  .tiles { grid-template-columns: 1fr; }
  .card, .fact { padding: 18px; }
  .g2 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .item-main { grid-template-columns: 1fr 1fr; }
  .stepper button { width: 40px; }
  .item-main .field:first-child { grid-column: span 2; }
  .disc { grid-template-columns: 1fr 1fr; }
  .disc .field:first-child { grid-column: span 2; }
  .disc .amount { text-align: left; }
  .fact-row { grid-template-columns: 1fr auto; }
  .fact-label { grid-column: span 2; margin-bottom: -6px; }
  .pillnav a { padding: 0 14px; gap: 0; }
  .pillnav a span { display: none; }
  .pillnav a.active span { display: inline; margin-left: 7px; }
  .facts { columns: 1; }
  .viewer-bar .btn-label { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .pillnav { background: rgba(16, 44, 74, .92); }
}
