/*
 * Design tokens and components (spec chapter 7, Teil 1 V26).
 * Colors from route 7, fonts from route 6. Light only. Nothing is sticky (iOS).
 * Class names follow docs/specs/buecherbestellung-entwurf.html.
 */
@font-face { font-family: "Fira Sans"; font-weight: 400; font-display: swap; src: url("../fonts/fira-sans-400-bhdEFRJ.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-weight: 500; font-display: swap; src: url("../fonts/fira-sans-500-9JxhT19.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-weight: 600; font-display: swap; src: url("../fonts/fira-sans-600-W_A7sgv.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans Condensed"; font-weight: 500; font-display: swap; src: url("../fonts/fira-sans-condensed-500-A1Y0KZ5.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/fira-sans-condensed-600-6pl5EMX.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans Condensed"; font-weight: 700; font-display: swap; src: url("../fonts/fira-sans-condensed-700-hVxwzV2.woff2") format("woff2"); }
@font-face { font-family: "Fira Mono"; font-weight: 400; font-display: swap; src: url("../fonts/fira-mono-400--f4TbZo.woff2") format("woff2"); }
@font-face { font-family: "Fira Mono"; font-weight: 500; font-display: swap; src: url("../fonts/fira-mono-500-0qwrlOU.woff2") format("woff2"); }

:root {
    --a-bg: #f7f7f2;
    --a-card: #ffffff;
    --a-ink: #111317;
    --a-ink2: #2d3036;
    --a-muted: #6a6e75;
    --a-line: #e3e3da;
    --a-soft: #ecebe2;
    --a-bad: #b3261e;
    --lime: #c5f500;
    --yellow: #ffe600;
    --pink: #e5007d;
    --kita-blue: #1776ce;
    --grp-yellow: #ffe600;
    --grp-blue: #1776ce;
    --grp-red: #e2231a;
    --paypal: #0070ba;
    --font-disp: "Fira Sans Condensed", "Arial Narrow", system-ui, sans-serif;
    --font-ui: "Fira Sans", system-ui, -apple-system, sans-serif;
    --font-mono: "Fira Mono", ui-monospace, monospace;
    color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--a-bg);
    color: var(--a-ink);
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
}
a { color: var(--a-ink); text-decoration-color: var(--pink); text-underline-offset: 3px; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, label:focus-within {
    outline: 2px solid var(--pink);
    outline-offset: 2px;
}
[hidden] { display: none !important; }

/* ---------- Page frame ---------- */
/* Triangles stay fixed behind the content, the content scrolls over them. */
.deco { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.tri { position: absolute; pointer-events: none; overflow: visible; }
.page {
    position: relative;
    z-index: 1;
    max-width: 520px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}
.head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px;
}
.head .t { flex: 1; min-width: 0; line-height: 1.15; }
.head .t a { text-decoration: none; }
.head b { display: block; font-family: var(--font-disp); font-weight: 600; font-size: 1.04rem; }
.head small { color: var(--a-muted); font-size: .74rem; }
.cartbtn {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 6px;
    border: 0;
    background: var(--a-ink);
    color: var(--a-bg);
    display: grid;
    place-items: center;
    cursor: pointer;
    flex: none;
    text-decoration: none;
}
.cartbtn .cnt {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    border-radius: 10px;
    background: var(--pink);
    color: #fff;
    font: 600 11px var(--font-disp);
    display: grid;
    place-items: center;
    padding: 0 5px;
    font-variant-numeric: tabular-nums;
}
.main {
    flex: 1 0 auto;
    padding: 10px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.foot {
    flex: none;
    text-align: center;
    font-size: .7rem;
    color: var(--a-muted);
    padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--a-line);
    background: var(--a-bg);
}
.foot a { color: var(--a-ink); font-weight: 600; text-decoration: none; }

/* ---------- Text ---------- */
.h1wrap { padding-right: 40px; }
.h1 { font-family: var(--font-disp); font-weight: 700; font-size: 1.85rem; line-height: 1.08; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
.h1.sm { font-size: 1.5rem; }
.tx { margin: 0; font-size: .9rem; color: var(--a-ink2); }
.tx.center { text-align: center; }
.h { font-family: var(--font-disp); font-weight: 600; font-size: 1.12rem; margin: 0; text-wrap: balance; }
.h.bad { color: var(--a-bad); }
.hint { color: var(--a-muted); font-size: .82rem; margin: 0; }
.ref { font-family: var(--font-mono); font-weight: 500; letter-spacing: .02em; }
.prose { display: flex; flex-direction: column; gap: 10px; font-size: .9rem; color: var(--a-ink2); }
.prose h2 { font-family: var(--font-disp); font-weight: 600; font-size: 1.12rem; margin: 8px 0 0; color: var(--a-ink); }
.prose p, .prose ul { margin: 0; }
.prose ul { padding-left: 1.2em; }

/* ---------- Cards and forms ---------- */
/* Glass cards: the triangles shimmer through. Inputs stay opaque white. */
.card {
    background: rgb(255 255 255 / .55);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
    border: 1px solid rgb(255 255 255 / .75);
    box-shadow: 0 4px 18px rgb(17 19 23 / .08);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 11px;
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field label, .lbl { font-size: .76rem; font-weight: 600; color: var(--a-ink); }
.field small { font-size: .74rem; color: var(--a-muted); }
.field small.bad, .err { font-size: .78rem; color: var(--a-bad); font-weight: 500; }
.field input, .field select {
    font: inherit;
    font-size: 1rem; /* 16px: iOS does not zoom */
    color: var(--a-ink);
    background: #fff;
    border: 1.5px solid var(--a-ink);
    border-radius: 4px;
    padding: 10px 12px;
    min-height: 46px;
    width: 100%;
}
.field input[aria-invalid="true"] { border-color: var(--a-bad); }
.grp { border: 0; margin: 0; padding: 0; min-width: 0; }
.grp legend { padding: 0; margin-bottom: 4px; }
.grps { display: flex; flex-direction: column; gap: 6px; }
.gr {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 12px;
    border: 1.5px solid var(--a-line);
    border-radius: 4px;
    background: #fff;
    font-size: .95rem;
    cursor: pointer;
}
.gr:has(input:checked) { border-color: var(--a-ink); box-shadow: inset 0 0 0 1px var(--a-ink); }
.gr input { width: 20px; height: 20px; margin: 0; accent-color: #111317; flex: none; }
.gr i { width: 18px; height: 18px; border-radius: 3px; flex: none; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); }
.gr i.yellow { background: var(--grp-yellow); }
.gr i.blue { background: var(--grp-blue); }
.gr i.red { background: var(--grp-red); }
.btn {
    font-family: var(--font-ui);
    font-size: .95rem;
    font-weight: 600;
    min-height: 50px;
    border-radius: 6px;
    border: 0;
    background: var(--a-ink);
    color: var(--a-bg);
    cursor: pointer;
    padding: 0 16px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--a-ink); border: 1.5px solid var(--a-ink); }
.btn.sm { min-height: 36px; width: auto; font-size: .84rem; border-radius: 4px; padding: 0 12px; }
.btn.paypal { background: var(--paypal); color: #fff; }
.btn[disabled] { opacity: .35; cursor: not-allowed; }
.row { display: flex; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.note { font-size: .8rem; padding: 10px 12px; border-radius: 4px; background: #fff; color: var(--a-ink); border: 1.5px solid var(--a-ink); }
.note.bad { border-color: var(--a-bad); color: var(--a-bad); }
.inline-form { display: contents; }

/* ---------- Book finder ---------- */
.inwrap { position: relative; }
.inwrap input { padding-right: 50px; }
.inbtn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 36px;
    border: 0;
    border-radius: 3px;
    background: var(--a-soft);
    color: var(--a-ink);
    display: grid;
    place-items: center;
    cursor: pointer;
}
.detect { font-size: .8rem; font-family: var(--font-mono); color: var(--a-ink2); margin: 0; min-height: 1.2em; }
.detect.bad { color: var(--a-bad); }
.spin { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--a-ink2); }
.spin i { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--a-soft); border-top-color: var(--a-ink); animation: sp .8s linear infinite; flex: none; }
@keyframes sp { to { transform: rotate(360deg); } }
.scan { position: relative; height: 260px; border-radius: 6px; background: #1b1d22; overflow: hidden; display: grid; place-items: center; }
.scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan .frame { position: relative; width: 72%; height: 40%; border: 2px solid var(--lime); border-radius: 4px; }
.scan .laser { position: absolute; left: 14%; right: 14%; height: 2px; background: var(--pink); top: 50%; animation: las 1.6s ease-in-out infinite alternate; }
@keyframes las { from { top: 32%; } to { top: 66%; } }
.scan small { position: absolute; bottom: 8px; color: #ddd; font-size: .72rem; }
.found { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: start; }
.cover {
    width: 84px;
    aspect-ratio: 2 / 3;
    border-radius: 3px;
    box-shadow: 1px 2px 6px rgb(0 0 0 / .22);
    object-fit: cover;
    background: var(--a-soft);
    display: block;
}
.cover.sm { width: 44px; }
.cover.none {
    background: var(--a-soft);
    color: var(--a-muted);
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font: 700 .58rem/1.1 var(--font-disp);
    padding: 4px;
    overflow: hidden;
}
.cover.sm.none { font-size: .38rem; }
.meta b { display: block; font-family: var(--font-disp); font-weight: 600; font-size: 1.08rem; line-height: 1.2; }
.meta span { display: block; font-size: .8rem; color: var(--a-muted); }
.meta .price { margin-top: 6px; color: var(--a-ink); font-size: 1rem; }
.price { font-family: var(--font-disp); font-weight: 600; font-variant-numeric: tabular-nums; }
.list { display: flex; flex-direction: column; }
.bk { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--a-line); }
.bk:last-child { border-bottom: 0; }
.bk .tt { font-size: .9rem; font-weight: 500; line-height: 1.25; }
.bk .ln { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.bk .ln > span { font-size: .76rem; color: var(--a-muted); min-width: 0; }
.bk .ln .price { color: var(--a-ink); }
.bk .acts { display: flex; align-items: center; gap: 6px; flex: none; }
.res { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: start; text-align: left; font: inherit; color: inherit; background: transparent; border: 0; border-bottom: 1px solid var(--a-line); padding: 10px 0; cursor: pointer; width: 100%; }
.res:last-child { border-bottom: 0; }
.res .tt { display: block; font-size: .9rem; font-weight: 500; line-height: 1.25; }
.res .sub { display: block; font-size: .74rem; color: var(--a-muted); margin-top: 2px; }
.res .price { display: block; font-size: .86rem; margin-top: 3px; }
.del { width: 30px; height: 30px; border-radius: 4px; border: 0; background: var(--a-soft); color: var(--a-ink); display: grid; place-items: center; cursor: pointer; }
.qty { display: flex; align-items: center; gap: 4px; font-family: var(--font-disp); font-weight: 600; font-size: .92rem; font-variant-numeric: tabular-nums; }
.qty button { width: 28px; height: 28px; border-radius: 4px; border: 1.5px solid var(--a-ink); background: #fff; color: var(--a-ink); cursor: pointer; font: 600 .9rem var(--font-ui); line-height: 1; }
.qty button[disabled] { opacity: .3; cursor: not-allowed; }
.sum { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.sum b { font-family: var(--font-disp); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.sum.sub { font-weight: 400; font-size: .86rem; color: var(--a-muted); }
.sum.sub b { font-size: 1rem; color: var(--a-ink); }

/* ---------- Status and payment ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 500; border-radius: 3px; padding: 2px 8px; white-space: nowrap; color: var(--a-ink); }
.p-draft { background: var(--a-soft); color: var(--a-ink2); }
.p-unconfirmed, .p-open { background: var(--yellow); }
.p-awaiting_payment, .p-conf { background: #fff; box-shadow: inset 0 0 0 1.5px var(--a-ink); }
.p-paid { background: var(--lime); }
.p-ordered, .p-ord { background: var(--a-ink); color: var(--a-bg); }
.copy { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--a-bg); border: 1px solid var(--a-line); border-radius: 4px; padding: 7px 8px 7px 10px; }
.copy span { font-family: var(--font-mono); font-size: .84rem; overflow-wrap: anywhere; min-width: 0; }
.steps { margin: 0; padding-left: 1.2em; font-size: .84rem; display: flex; flex-direction: column; gap: 4px; }
.offpage { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 40px 4px; }

.detect.ok::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--lime); border: 1px solid var(--a-ink); margin-right: 6px; transform: rotate(45deg); }
/* Logo mark with three triangles (admin). Admin styles live in admin.css. */
.mark { position: relative; display: block; width: 36px; height: 36px; flex: none; }

@media (prefers-reduced-motion: reduce) {
    .scan .laser, .spin i { animation: none; }
}
