/* ------------------------------------------------------------------
   EtikettenWerk — Bildschirm-Stylesheet
   Keine externen Schriften, keine @import-Ketten: alles kommt vom
   eigenen Server (einwilligungsfreier Betrieb, CSP script/style-src 'self').
   ------------------------------------------------------------------ */

:root {
    --green: #176b5b;
    --green-dark: #0f4d42;
    --green-light: #e8f5f1;
    --ink: #14211e;
    --muted: #5d6d68;
    --line: #d9e2df;
    --surface: #fff;
    --soft: #f5f8f7;
    --amazon: #ff9900;
    --danger: #a43a3a;
    --shadow: 0 18px 55px rgba(23, 55, 48, .12);
    --radius: 18px;
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: #fff;
    line-height: 1.55;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--green-dark); }
a:hover { text-decoration: none; }

img, svg { max-width: 100%; }

h1, h2, h3 { line-height: 1.12; letter-spacing: -.02em; }

:focus-visible {
    outline: 3px solid rgba(23, 107, 91, .55);
    outline-offset: 2px;
    border-radius: 4px;
}

.container { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.content-narrow { width: min(820px, 100%); margin-inline: auto; }

.skip-link {
    position: fixed; left: 1rem; top: -5rem; z-index: 1000;
    background: #fff; padding: .7rem 1rem; border-radius: 8px;
    box-shadow: var(--shadow);
}
.skip-link:focus { top: 1rem; }

/* --- Kopfbereich --------------------------------------------------- */

.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(217, 226, 223, .8);
}
.header-inner {
    min-height: 74px; display: flex; align-items: center;
    justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand span { display: grid; line-height: 1.05; }
.brand strong { font-size: 1.08rem; }
.brand small { font-size: .72rem; color: var(--muted); margin-top: 5px; }

.main-nav { display: flex; gap: 26px; align-items: center; }
.main-nav a { font-weight: 650; color: var(--ink); text-decoration: none; }
.main-nav a:hover { color: var(--green); }

.nav-toggle {
    display: none; border: 1px solid var(--line); background: #fff;
    padding: .55rem .8rem; border-radius: 9px; font: inherit; cursor: pointer;
}

/* --- Bausteine ----------------------------------------------------- */

.eyebrow {
    display: inline-block; text-transform: uppercase; letter-spacing: .12em;
    font-size: .72rem; font-weight: 800; color: var(--green); margin-bottom: 12px;
}

.button {
    display: inline-flex; justify-content: center; align-items: center; gap: 8px;
    border: 0; border-radius: 11px; padding: .82rem 1.18rem;
    font: inherit; font-weight: 750; cursor: pointer; text-decoration: none;
    transition: transform .18s, box-shadow .18s, background .18s;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--green); color: #fff; box-shadow: 0 9px 24px rgba(23, 107, 91, .22); }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.button.secondary:hover { border-color: var(--green); }
.button.amazon { background: var(--amazon); color: #161616; }
.button.amazon:hover { background: #ffad33; }
.button.text-button { background: transparent; color: var(--green-dark); padding: .5rem; }
.button.danger { color: var(--danger); }

.link-button {
    background: none; border: 0; padding: 0; font: inherit;
    color: var(--green-dark); text-decoration: underline; cursor: pointer;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.section { padding: 74px 0; }
.section.muted { background: var(--soft); }
.section-heading { max-width: 720px; margin-bottom: 34px; }
.section-heading h2, .split-card h2, .generator-content h2 {
    font-size: clamp(1.8rem, 3vw, 2.6rem); margin: .1em 0 .35em;
}
.section-heading p { color: var(--muted); }

.callout { background: var(--green-light); border-left: 4px solid var(--green); border-radius: 12px; padding: 14px 16px; margin: 18px 0; }
.warning { background: #fff7df; border: 1px solid #ead28d; color: #664c00; border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.error-box { background: #ffebeb; border: 1px solid #eab3b3; color: #7f2222; border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }

code { background: #edf2f0; border-radius: 5px; padding: .15em .35em; font-size: .92em; }

.prose h2 { margin-top: 2em; }
.prose li { margin: .45em 0; }
.prose p { max-width: 68ch; }

.breadcrumbs { display: flex; gap: 8px; color: var(--muted); font-size: .85rem; margin-bottom: 22px; }
.breadcrumbs a { color: var(--muted); }

/* --- Startseite ---------------------------------------------------- */

.hero {
    padding: 72px 0 78px;
    background: radial-gradient(circle at 80% 10%, #d9f3eb 0, transparent 32%),
                linear-gradient(180deg, #fbfdfc, #f2f8f6);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 60px; align-items: center; }
.hero h1, .page-hero h1, .generator-intro h1 {
    font-size: clamp(2.3rem, 4.6vw, 4.4rem); line-height: 1.02;
    letter-spacing: -.045em; margin: .1em 0 .35em;
}
.hero h1 span { color: var(--green); }
.hero-copy { font-size: 1.15rem; color: var(--muted); max-width: 660px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 22px; }

.trust-list {
    display: flex; gap: 24px; flex-wrap: wrap; padding: 0; margin: 0;
    list-style: none; color: var(--muted); font-size: .92rem;
}
.trust-list li::before { content: "✓"; color: var(--green); font-weight: 900; margin-right: 7px; }

.hero-visual { position: relative; }
.sample-sheet {
    display: grid; gap: 9px; background: #fff; padding: 26px;
    border-radius: 9px; box-shadow: var(--shadow); transform: rotate(2deg);
}
.sample-label { height: 52px; border: 1px dashed #a9bbb5; border-radius: 5px; padding: 10px; }
.sample-label i { display: block; height: 3px; background: #a8b8b3; border-radius: 5px; margin-bottom: 6px; }
.sample-label i:nth-child(2) { width: 75%; }
.sample-label i:nth-child(3) { width: 55%; }
.fake-qr { display: block; width: 30px; height: 30px; background: repeating-conic-gradient(#263b35 0 25%, #fff 0 50%) 0 / 8px 8px; }
.sheet-caption { text-align: center; color: var(--muted); font-size: .84rem; margin-top: 18px; }

.generator-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.generator-card {
    border: 1px solid var(--line); border-radius: var(--radius); padding: 25px;
    color: var(--ink); background: #fff; text-decoration: none;
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.generator-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #b6d4cb; }
.card-icon {
    display: grid; place-items: center; width: 48px; height: 48px;
    border-radius: 13px; background: var(--green-light); color: var(--green);
    font-size: 1.45rem; font-weight: 800;
}
.generator-card h3 { margin: 18px 0 8px; }
.generator-card p { color: var(--muted); font-size: .94rem; }
.card-link { font-weight: 750; color: var(--green); }

.three-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.three-steps > div > span {
    display: grid; place-items: center; width: 38px; height: 38px;
    border-radius: 50%; background: var(--green); color: #fff; font-weight: 800;
}
.three-steps h3 { margin: 15px 0 5px; }
.three-steps p { color: var(--muted); }

.split-card {
    display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px;
    border: 1px solid var(--line); border-radius: 24px; padding: 36px;
    background: linear-gradient(135deg, #fff, #f1f8f6);
}
.split-card small { display: block; margin-top: 12px; color: var(--muted); }
.tip-box { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.tip-box strong { font-size: 1.15rem; }

.page-hero, .generator-intro { padding: 58px 0 36px; background: linear-gradient(180deg, #f1f8f6, #fff); }
.page-hero h1, .generator-intro h1 { font-size: clamp(2.1rem, 3.8vw, 3.4rem); }
.page-hero p, .generator-intro p { font-size: 1.06rem; color: var(--muted); max-width: 800px; }

/* --- Formatübersicht ------------------------------------------------ */

.format-group { margin: 44px 0 18px; font-size: 1.3rem; }
.format-group:first-child { margin-top: 0; }
.format-list { display: grid; gap: 14px; }
.format-card {
    display: grid; grid-template-columns: 92px minmax(0, 1fr) auto;
    gap: 22px; align-items: center;
    border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; background: #fff;
}
.format-card h3 { margin: 0 0 4px; font-size: 1.12rem; }
.format-card p { margin: 0; color: var(--muted); font-size: .94rem; }
.format-meta { font-variant-numeric: tabular-nums; margin-bottom: 4px !important; }
.format-visual { display: grid; place-items: center; }
.format-mini {
    display: grid; width: 66px; height: 92px; padding: 4px; gap: 2px;
    border: 1px solid var(--line); border-radius: 3px; background: var(--soft);
    grid-template-columns: repeat(var(--cols), 1fr);
    grid-auto-rows: 1fr;
}
.format-mini i { background: #c3d5cf; border-radius: 1px; }
.format-card.is-round .format-mini i { border-radius: 50%; }
.format-actions { display: grid; gap: 8px; justify-items: stretch; }
.format-actions .button { padding: .6rem .9rem; font-size: .92rem; }
.disclosure { margin-top: 32px; color: var(--muted); font-size: .88rem; }

/* --- Generator: Arbeitsbereich -------------------------------------- */

.generator-workspace { padding: 0 0 56px; }
.workspace-grid {
    display: grid; grid-template-columns: minmax(330px, 430px) minmax(0, 1fr);
    gap: 24px; align-items: start;
}

.control-panel {
    border: 1px solid var(--line); border-radius: 18px; background: #fff;
    box-shadow: 0 12px 40px rgba(27, 56, 49, .07); overflow: hidden auto;
    max-height: calc(100vh - 92px); position: sticky; top: 88px;
}
.panel-section { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-section h2 { font-size: 1rem; margin: 0 0 13px; display: flex; align-items: center; gap: 9px; }
.panel-section .step {
    display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto;
    border-radius: 50%; background: var(--green-light); color: var(--green-dark);
    font-size: .75rem; font-weight: 800;
}
.panel-section label { display: block; font-size: .82rem; font-weight: 700; margin: 10px 0 5px; color: #34453f; }
.panel-section input,
.panel-section textarea,
.panel-section select {
    width: 100%; border: 1px solid #cbd8d4; border-radius: 9px; background: #fff;
    padding: .68rem .72rem; font: inherit; color: var(--ink);
}
.panel-section textarea { resize: vertical; min-height: 85px; }
.panel-section input:focus, .panel-section textarea:focus, .panel-section select:focus {
    outline: 3px solid rgba(23, 107, 91, .14); border-color: var(--green);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row.three { grid-template-columns: 1.2fr 1fr 1fr; }
.field-help { font-size: .77rem; color: var(--muted); margin: 8px 0 0; }
.check { display: flex !important; gap: 9px; align-items: center; }
.check input { width: auto !important; }

.dimension-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 11px; margin-top: 12px; }
.dimension-grid label { margin: 0; font-size: .72rem; }
.dimension-grid input { margin-top: 3px; padding: .5rem; }

.panel-actions { padding: 20px 22px 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.panel-footnote { padding: 0 22px 20px; margin: 10px 0 0; font-size: .78rem; color: var(--muted); }

/* --- Generator: Vorschau -------------------------------------------- */

.preview-panel { min-width: 0; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.preview-toolbar > div:first-child { display: grid; }
.preview-toolbar span { color: var(--muted); font-size: .82rem; }
.status-pill {
    background: var(--green-light); color: var(--green-dark);
    border-radius: 999px; padding: 7px 12px; font-weight: 700;
    font-size: .8rem; margin: 0;
}

.sheet-output {
    min-height: 620px; background: #e9efed; border: 1px solid #d4dfdc;
    border-radius: 18px; padding: 22px; overflow: auto;
    display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.sheet-wrap { position: relative; flex: 0 0 auto; }
.sheet-page {
    position: absolute; left: 0; top: 0; background: #fff;
    box-shadow: 0 12px 32px rgba(20, 45, 39, .16);
    transform: scale(var(--sheet-scale, .5)); transform-origin: top left;
    overflow: hidden;
}
.preview-note {
    font-size: .85rem; background: #fff7df; border: 1px solid #ead28d;
    border-radius: 11px; padding: 12px 14px; margin-top: 12px;
}

/* --- Etiketten (Vorschau und Druck) --------------------------------- */

.print-label {
    position: absolute; display: flex; flex-direction: column; justify-content: center;
    overflow: hidden; background: #fff; line-height: 1.25; white-space: pre-line;
}
.print-label.with-border { border: .25mm solid #777; }
.print-label.is-round { border-radius: 50%; }
.label-text { width: 100%; white-space: pre-line; }

.code-label { align-items: center; text-align: center !important; gap: 1.2mm; }
.code-label small { font-size: .72em; }
.qr-holder { display: grid; place-items: center; width: 100%; min-height: 0; flex: 1 1 auto; }
.qr-holder svg { display: block; width: 100%; height: 100%; }
.barcode-svg { width: 100%; max-height: 78%; display: block; }
.barcode-label strong { font-size: .85em; }

.inventory-label { align-items: center; text-align: center !important; gap: 1.2mm; }
.inventory-label > strong { font-size: 1.25em; letter-spacing: .04em; }

.folder-label { align-items: center; text-align: center !important; font-weight: 700; }
.folder-label.vertical { writing-mode: vertical-rl; }
.folder-label strong { font-size: 1.2em; }
.folder-label small { font-size: .72em; margin-top: 5px; }

.test-label { align-items: center; justify-content: center; color: #888; font-size: 11pt !important; }
.test-label i::before, .test-label i::after { content: ""; position: absolute; background: #bbb; }
.test-label i::before { height: .2mm; width: 12mm; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.test-label i::after { width: .2mm; height: 12mm; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.code-error { font-size: 7pt; color: var(--danger); text-align: center; padding: 1mm; }

/* --- Partnerkarte ---------------------------------------------------- */

.amz-card {
    margin-top: 20px; border: 1px solid var(--line); border-radius: 18px;
    padding: 22px; background: #fff;
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px 24px; align-items: center;
}
.amz-card h2 { margin: 2px 0 6px; font-size: 1.3rem; }
.amz-card p { margin: 0; color: var(--muted); }
.amz-card small { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; }
.amz-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 14px 0 0; }
.chip {
    display: inline-block; padding: .34rem .72rem; border-radius: 999px;
    border: 1px solid var(--line); background: var(--soft);
    font-size: .82rem; font-weight: 650; color: var(--ink); text-decoration: none;
}
.chip:hover { border-color: var(--amazon); background: #fff6e6; }

/* --- Inhalte unter dem Generator ------------------------------------- */

.generator-content { border-top: 1px solid var(--line); }
.instruction-list li { padding: 10px 0; }
.generator-content details { border-top: 1px solid var(--line); padding: 14px 0; }
.generator-content details p { margin: 10px 0 0; color: var(--muted); }
.generator-content summary { font-weight: 700; cursor: pointer; }
.more-link { margin-top: 28px; }

/* --- Fuß ------------------------------------------------------------- */

.site-footer { background: #10201c; color: #dce8e4; padding: 46px 0 22px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-grid div { display: flex; flex-direction: column; gap: 8px; }
.footer-grid p { color: #aabbb5; max-width: 440px; }
.footer-grid a { color: #dce8e4; text-decoration: none; }
.footer-grid a:hover { text-decoration: underline; }
.footer-bottom {
    margin-top: 32px; padding-top: 18px; border-top: 1px solid #2c3c37;
    display: flex; justify-content: space-between; gap: 12px;
    color: #9fb2ab; font-size: .84rem;
}
.setup-notice {
    margin-top: 18px; background: #40320f; border: 1px solid #7a6522;
    color: #ffe9a8; border-radius: 10px; padding: 12px 14px; font-size: .88rem;
}
.setup-notice code { background: rgba(255, 255, 255, .12); color: inherit; }

.toast {
    position: fixed; right: 24px; bottom: 24px; z-index: 1000;
    background: #10201c; color: #fff; padding: 12px 16px; border-radius: 11px;
    box-shadow: var(--shadow); opacity: 0; transform: translateY(10px);
    transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: none; }

#print-root { display: none; }

/* --- Anpassung an kleinere Bildschirme -------------------------------- */

@media (max-width: 1080px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 980px) {
    .hero-grid, .split-card { grid-template-columns: 1fr; }
    .hero-visual { max-width: 560px; }
    .generator-grid { grid-template-columns: repeat(2, 1fr); }
    .workspace-grid { grid-template-columns: 1fr; }
    .control-panel { position: static; max-height: none; }
    .sheet-output { min-height: 500px; }
    .amz-card { grid-template-columns: 1fr; }
    .format-card { grid-template-columns: 72px minmax(0, 1fr); }
    .format-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
    .header-inner { min-height: 66px; }
    .nav-toggle { display: block; }
    .main-nav {
        display: none; position: absolute; top: 66px; left: 0; right: 0;
        background: #fff; padding: 18px 24px; border-bottom: 1px solid var(--line);
        box-shadow: 0 15px 30px rgba(0, 0, 0, .08);
        flex-direction: column; align-items: flex-start;
    }
    .main-nav.open { display: flex; }
    .hero { padding: 48px 0; }
    .generator-grid, .three-steps, .footer-grid { grid-template-columns: 1fr; }
    .field-row, .field-row.three, .dimension-grid, .panel-actions { grid-template-columns: 1fr 1fr; }
    .footer-bottom { flex-direction: column; gap: 6px; }
    .preview-toolbar { align-items: flex-start; flex-direction: column; }
    .sheet-output { padding: 10px; }
    .section { padding: 54px 0; }
    .trust-list { gap: 12px; }
}

@media (max-width: 480px) {
    .field-row, .field-row.three, .dimension-grid, .panel-actions,
    .format-actions { grid-template-columns: 1fr; }
    .hero-actions .button { width: 100%; }
    .brand small { display: none; }
    .panel-section { padding: 17px; }
    .container { width: min(100% - 22px, 1180px); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
    .button:hover, .generator-card:hover { transform: none; }
}
