/* Kundenbereich – Farben und Schrift wie styles.css der Website */
:root {
  --p-accent: #15223B;      /* Tinte */
  --p-accent-2: #2B3A57;
  --p-signal: #FFC21A;
  --p-bg: #F3F5F2;          /* Papier */
  --p-surface: #FFFFFF;
  --p-border: #D3D9D4;
  --p-text: #15223B;
  --p-muted: #56607A;
  --p-danger: #C8246B;      /* Magenta */
  --p-ok: #16794a;
  --p-radius: 10px;
  --p-font: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--p-bg); color: var(--p-text); font: 1rem/1.55 var(--p-font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--p-accent); }
:focus-visible { outline: 3px solid var(--p-danger); outline-offset: 3px; border-radius: 4px; }
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .35em; }
h2 { font-size: 1.2rem; letter-spacing: -0.01em; margin: 0 0 .8em; }
.muted { color: var(--p-muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.lead-text { color: var(--p-muted); margin: 0 0 1.5rem; max-width: 62ch; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-sm { margin-top: .5rem; }
.mb-sm { margin: 0 0 .25rem; }
.nowrap { white-space: nowrap; }

/* Kopfzeile */
.p-header { background: rgba(243, 245, 242, .95); border-bottom: 1px solid var(--p-border); }
.p-header-inner { max-width: 72rem; margin: 0 auto; padding: .6rem clamp(1.25rem, 4vw, 2.5rem); min-height: 4.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.p-brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--p-text); font-weight: 700; }
.p-brand img { display: block; height: 40px; width: auto; }
.p-brand span { padding-left: .75rem; border-left: 1px solid var(--p-border); color: var(--p-muted); font-weight: 600; }
.p-nav { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.p-main { max-width: 72rem; margin: 0 auto; padding: 2rem clamp(1.25rem, 4vw, 2.5rem) 4rem; }

/* Karten & Formulare */
.card { background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); padding: 1.4rem; }
.card + .card { margin-top: 1rem; }
.grid > .card { margin-top: 0; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; font-size: .9rem; font-weight: 600; }
.field small { font-weight: 400; color: var(--p-muted); }
.input {
  width: 100%; border: 1px solid var(--p-border); border-radius: 8px; padding: .65rem .8rem;
  font: inherit; font-weight: 400; color: var(--p-text); background: var(--p-surface);
}
.input:focus { outline: none; border-color: var(--p-accent); box-shadow: 0 0 0 3px rgba(21, 34, 59, .15); }
.input-code { font-size: 1.6rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; }

/* Knöpfe wie .knopf der Website */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; cursor: pointer;
  min-height: 2.5rem; padding: .4rem 1.1rem; border-radius: 999px;
  border: 2px solid var(--p-accent); background: transparent; color: var(--p-accent);
  font: inherit; font-size: .95rem; font-weight: 700; text-decoration: none;
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--p-accent); color: #fff; }
.btn:disabled { opacity: .5; cursor: progress; }
.btn-primary { background: var(--p-accent); color: #fff; min-height: 3rem; padding: .7rem 1.4rem; font-size: 1rem; }
.btn-primary:hover { background: var(--p-accent-2); border-color: var(--p-accent-2); }
.btn-sm { min-height: 2rem; padding: .2rem .75rem; font-size: .82rem; border-width: 1.5px; }
.btn-danger:hover { background: var(--p-danger); border-color: var(--p-danger); color: #fff; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--p-accent); font: inherit; cursor: pointer; text-decoration: underline; }
.btn-row { display: flex; gap: .5rem; margin-bottom: 1rem; }

.alert { border-radius: 8px; padding: .65rem .8rem; font-size: .9rem; margin-bottom: .9rem; }
.alert-error { background: #fdf0f5; border: 1px solid #f3c2d6; color: #8e1a4b; }
.alert-ok { background: #effaf3; border: 1px solid #bfe6cf; color: #145c38; }
.alert-warn { background: #fff7e0; border: 1px solid #ffe08a; color: #6b4e00; }

/* Login */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.25rem; padding: 1.5rem 1rem; }
.auth-logo img { display: block; height: 48px; width: auto; }
.auth-card { width: min(440px, 100%); }
.auth-card .lead-text { margin-bottom: 1.25rem; }
.steps { list-style: none; padding: 0; margin: 0 0 1.1rem; display: flex; gap: .4rem; }
.steps li { flex: 1; height: 4px; border-radius: 2px; background: var(--p-border); }
.steps li.done { background: var(--p-signal); }
.qr { display: flex; justify-content: center; margin: .5rem 0 .9rem; }
.qr svg { width: 200px; height: 200px; background: #fff; padding: 6px; border: 1px solid var(--p-border); border-radius: 8px; }
.secret { font: 600 .95rem/1.4 ui-monospace, Consolas, monospace; background: var(--p-bg); border-radius: 8px; padding: .5rem .65rem; text-align: center; word-break: break-all; margin: 0 0 1rem; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; padding: 0; margin: 0 0 .9rem; list-style: none; }
.codes li { font: 600 .95rem ui-monospace, Consolas, monospace; background: var(--p-bg); border-radius: 6px; padding: .5rem; text-align: center; }
.check { display: flex; gap: .5rem; align-items: flex-start; font-size: .9rem; margin: 0 0 .9rem; }
.check input { margin-top: .2rem; accent-color: var(--p-accent); }
.auth-foot { font-size: .85rem; color: var(--p-muted); text-align: center; }
.auth-foot a { color: inherit; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--p-border); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--p-muted); font-weight: 700; }
td .btn + .btn { margin-left: .25rem; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .1rem .55rem; background: var(--p-bg); color: var(--p-muted); }
.badge-ok { background: #dff3e7; color: #145c38; }
.badge-warn { background: #fff1c2; color: #6b4e00; }
.badge-off { background: #fbe1ec; color: #8e1a4b; }

.secret-box { border: 2px dashed var(--p-signal); background: #fffbeb; border-radius: 10px; padding: .9rem; margin-top: .9rem; }
.secret-box code { font: 700 1.25rem ui-monospace, Consolas, monospace; display: block; margin: .35rem 0; }

.empty { text-align: center; padding: 2.2rem 1rem; color: var(--p-muted); }
.empty p { margin: 0 auto; }

@media (max-width: 560px) {
  .row2 { grid-template-columns: 1fr; }
  .card { padding: 1.1rem; }
  .p-brand span { display: none; }
}
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
}

/* ---------- Navigation ---------- */
.btn.is-current { background: var(--p-accent); color: #fff; }

/* ---------- Werkzeugleisten ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin-bottom: 1rem; }
.toolbar-field { margin: 0; min-width: 260px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 .75rem; }

/* ---------- Designs ---------- */
.design-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.design-card { display: flex; flex-direction: column; background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); overflow: hidden; color: inherit; text-decoration: none; }
.design-card.is-inactive { opacity: .6; }
.design-link:hover { border-color: var(--p-accent); box-shadow: 0 4px 14px rgba(21, 34, 59, .1); }
.design-thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 500 / 560; background: #fff; border-bottom: 1px solid var(--p-border); color: var(--p-muted); font-size: .85rem; }
.design-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.design-body { display: flex; flex-direction: column; gap: .3rem; padding: .8rem .9rem; flex: 1; }
.design-body .btn { margin-top: .4rem; align-self: flex-start; }
.design-actions { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0 .9rem .9rem; }

/* ---------- Designer ---------- */
.p-main-wide { max-width: 90rem; }
.designer-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; }
.designer-name { margin: 0; min-width: min(360px, 100%); }
#kf-root { --kf-font: var(--p-font); font-family: var(--p-font); }

/* ---------- Anfragen ---------- */
.anfragen-layout { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--p-bg); }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.detail-head h2 { margin: 0; }
.preview-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; margin: .8rem 0; }
.preview-row figure { margin: 0; border: 1px solid var(--p-border); border-radius: 8px; overflow: hidden; background: #fff; }
.preview-row img { display: block; width: 100%; height: auto; }
.preview-row figcaption { font-size: .8rem; padding: .3rem .5rem; color: var(--p-muted); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem .9rem; margin: .8rem 0 0; font-size: .92rem; }
.facts dt { color: var(--p-muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; font-size: .88rem; }
.file-list li { display: flex; gap: .6rem; align-items: center; }
.status-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--p-border); }
.status-row .field { margin: 0; }

/* ---------- Konditionen ---------- */
.price-table td { padding: .3rem; }
.input-sm { padding: .4rem .5rem; font-size: .9rem; min-width: 5.5rem; }

@media (max-width: 900px) {
  .anfragen-layout { grid-template-columns: minmax(0, 1fr); }
  .row3 { grid-template-columns: 1fr; }
}

/* ---------- Farben pro Design ---------- */
.farben-wahl { border: 1px solid var(--p-border); border-radius: var(--p-radius); background: var(--p-surface); padding: .8rem 1rem .4rem; margin: 0 0 1rem; }
.farben-wahl legend { font-weight: 700; font-size: .9rem; padding: 0 .3rem; }
.farben-liste { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.farbe-chip { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--p-border); border-radius: 999px; padding: .25rem .7rem .25rem .45rem; font-size: .88rem; cursor: pointer; }
.farbe-chip:has(input:checked) { border-color: var(--p-accent); background: #eef1f6; }
.farbe-chip input { accent-color: var(--p-accent); margin: 0; }
.farbe-punkt { width: 1rem; height: 1rem; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); }

/* ---------- Rechnungen ---------- */
.mb-1 { margin-bottom: 1rem; }
.toolbar-field-sm { min-width: 140px; }
.text-danger { color: #8e1a4b; }
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 1rem; }
.stat { background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); padding: .8rem 1rem; display: flex; flex-direction: column; }
.stat span { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--p-muted); font-weight: 700; }
.stat strong { font-size: 1.4rem; letter-spacing: -0.01em; }
.stat small { color: var(--p-muted); font-size: .82rem; }
.btn-wrap { display: flex; flex-wrap: wrap; gap: .4rem; }
.positionen { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .6rem; }
.position { display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem 5rem 7rem 6.5rem auto; gap: 0 .6rem; align-items: end; padding: .7rem; border: 1px solid var(--p-border); border-radius: 8px; background: var(--p-bg); }
.position .field { margin: 0; }
.position textarea { resize: vertical; }
.pos-summe strong { padding: .65rem 0; font-weight: 700; }
.pos-del { margin-bottom: .3rem; }
.summe { display: flex; justify-content: flex-end; align-items: baseline; gap: .8rem; font-size: 1.05rem; margin: .4rem 0 1rem; }
.summe strong { font-size: 1.3rem; }
.card h3 { margin-top: .4rem; }
@media (max-width: 760px) {
  .position { grid-template-columns: 1fr 1fr; }
  .pos-text { grid-column: 1 / -1; }
}

/* Kundenbereich: Angebot und Antwort */
.angebot-tabelle td.pre { white-space: pre-line; }
.angebot-tabelle tfoot th { text-align: left; border-top: 2px solid var(--p-border); }
.antwort-box { margin-top: 1rem; padding: 1rem; border: 1px solid var(--p-border); border-radius: 8px; background: var(--p-bg); }
.antwort-box .field { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
/* Angebots-Editor in der schmalen Detailspalte: Bezeichnung oben, Zahlen darunter */
.positionen-schmal .position { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.positionen-schmal .pos-text { grid-column: 1 / -1; }
.positionen-schmal .pos-del { justify-self: end; grid-column: 3; }
.positionen-schmal .pos-summe { grid-column: 1 / 3; }
.versand-box { padding: .9rem; border: 1px solid var(--p-border); border-radius: 10px; background: var(--p-bg); }
.versand-box .file-list li { flex-wrap: wrap; }

/* Musterdruck und Größenmusterset */
.vorab-wahl { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); margin: .4rem 0 .6rem; }
.vorab-karte { border: 1px solid var(--p-border); border-radius: 10px; padding: .9rem 1rem; background: var(--p-bg); display: flex; flex-direction: column; align-items: flex-start; }
.vorab-karte h3 { margin: 0 0 .35rem; font-size: 1rem; }
.vorab-karte p { margin: 0 0 .7rem; }
.vorab-karte .btn { margin-top: auto; }
.leih-bedingungen { font-size: .85rem; color: var(--p-muted); border-left: 3px solid var(--p-accent); padding: .3rem .8rem; margin: .4rem 0 .8rem; }
.leihe-box { padding: .9rem; border: 1px solid var(--p-border); border-radius: 10px; background: var(--p-bg); margin-top: .8rem; }
.muster-gutschrift { border: 1px dashed var(--p-accent); border-radius: 10px; padding: .7rem .9rem; margin: .6rem 0; }

/* Eingabefelder einer Zeile unten bündig, auch wenn über einem Feld ein Hinweis („optional“) steht */
.field > :is(input, select, textarea) { margin-top: auto; }

/* Gleiche Höhe für Text-, Datums-, Zahl- und Auswahlfelder (sonst stehen sie in einer Zeile versetzt) */
input.input:not([type=checkbox]):not([type=radio]):not([type=file]), select.input:not([multiple]) { box-sizing: border-box; height: 2.975rem; }
input.input.input-sm:not([type=checkbox]):not([type=radio]):not([type=file]), select.input.input-sm:not([multiple]) { height: 2.32rem; }

/* Bereich „Ohne Login“: Ablauf und nächster Schritt */
.ablauf { list-style: none; counter-reset: schritt; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; padding: 0; margin: 0 0 1.25rem; }
.ablauf li { counter-increment: schritt; background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); padding: .55rem .7rem; display: flex; flex-direction: column; font-size: .85rem; }
.ablauf li::before { content: counter(schritt); font-weight: 700; color: var(--p-accent); font-size: .8rem; }
.ablauf span { color: var(--p-muted); font-size: .78rem; }
.naechster { background: #fff8e1; border: 1px solid #f0d98a; border-radius: var(--p-radius); padding: .6rem .8rem; margin: 0 0 1rem; }
@media (max-width: 760px) { .ablauf { grid-template-columns: 1fr 1fr; } }
.versand-auf > summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; margin-bottom: .5rem; }
