/* Arbeitszeugnis-Generator Schweiz – one stylesheet, no external assets. */
:root {
  --bg: #f6f3ec;
  --surface: #fffdf8;
  --paper: #ffffff;
  --ink: #1d2422;
  --muted: #5b6662;
  --line: #ddd6c8;
  --accent: #234e46;
  --accent-ink: #ffffff;
  --accent-soft: #e3ece8;
  --warn: #8a4b12;
  --warn-soft: #fbf0e1;
  --error: #a3261b;
  --ok: #1f6b3a;
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141917;
    --surface: #1b211f;
    --paper: #20272a;
    --ink: #e6e9e4;
    --muted: #a3aca7;
    --line: #34403c;
    --accent: #8cc7b6;
    --accent-ink: #10201b;
    --accent-soft: #23332e;
    --warn: #f0bb7d;
    --warn-soft: #2e2519;
    --error: #ff9a8f;
    --ok: #8fd6a6;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 1rem/1.6 var(--sans);
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; letter-spacing: -0.005em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin: 1.5rem 0 0.75rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 0.6rem; }
h3 { font-size: 1.1rem; margin: 0.4rem 0; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 10; }
.muted, .hint { color: var(--muted); }
.hint { display: block; font-size: 0.88rem; margin-top: 0.25rem; }
.lead { font-size: 1.08rem; max-width: 46rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; color: var(--muted); margin: 0; }

header.site { border-bottom: 1px solid var(--line); background: var(--surface); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; display: flex; align-items: center; gap: 10px; }
.brand .ch { color: var(--muted); font-weight: 400; }
.mark { width: 22px; height: 26px; border: 2px solid var(--accent); border-radius: 3px; position: relative; flex: none; }
.mark::after { content: ""; position: absolute; left: 4px; right: 4px; top: 7px; height: 9px; border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); }
header nav { display: flex; gap: 14px; align-items: center; }
header nav a:not(.btn) { color: var(--ink); text-decoration: none; }

.btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink); border: 2px solid var(--accent);
  border-radius: 8px; padding: 0.65rem 1.1rem; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn.small { padding: 0.35rem 0.8rem; font-size: 0.92rem; }
.btn.ghost { background: transparent; color: var(--accent); }

.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 24px 0 8px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.paper {
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 1px 0 var(--line), 0 12px 28px -18px rgba(0, 0, 0, 0.35);
  padding: 28px 30px; font-family: var(--serif); font-size: 1rem; line-height: 1.65;
}
.sample { margin: 0; }
.sample figcaption { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); margin-bottom: 0.8rem; }
.sample p { margin: 0 0 0.8rem; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid3 .span { grid-column: 1 / -1; margin-bottom: 0; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.note { background: var(--warn-soft); border-left: 4px solid var(--warn); border-radius: var(--radius); padding: 2px 20px 10px; margin-top: 1.4rem; }
.checks { padding-left: 1.2rem; }
.checks li { margin: 0.25rem 0; }

details { border-bottom: 1px solid var(--line); padding: 0.6rem 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 0.5rem 0 0.2rem; max-width: 46rem; }

/* Form */
.zform { max-width: 820px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 18px; }
.card > legend { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; padding: 0; float: left; width: 100%; margin-bottom: 0.6rem; }
.card > legend + * { clear: left; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.field { display: block; margin: 0.4rem 0 0.8rem; }
.lbl { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=date], input[type=number], textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 6px; padding: 0.55rem 0.65rem;
}
textarea { resize: vertical; line-height: 1.5; }
.choice { display: grid; gap: 6px; }
.choice.inline { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 0.4rem; }
.choice label, .check { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
.check { margin: 0.6rem 0; }
input[type=radio], input[type=checkbox] { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; flex: none; }
.rating { border-top: 1px solid var(--line); padding: 0.7rem 0 0.5rem; }
.rating legend { font-weight: 600; padding: 0; float: left; width: 100%; margin-bottom: 0.35rem; }
.rating .opts { clear: left; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.rating .opts label { display: flex; gap: 6px; align-items: baseline; cursor: pointer; }
.invalid input, .invalid textarea { border-color: var(--error); }
.err { display: block; color: var(--error); font-size: 0.9rem; margin-top: 0.2rem; font-weight: 600; }
.alert { background: var(--warn-soft); border-left: 4px solid var(--error); padding: 10px 14px; border-radius: 6px; margin: 1rem 0; }
.ok { background: var(--accent-soft); border-left: 4px solid var(--ok); padding: 10px 14px; border-radius: 6px; margin: 1rem 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 1rem 0; }

/* Show only relevant parts (progressive enhancement; server validates anyway) */
.zform:has(input[name=typ][value=bestaetigung]:checked) .nur-zeugnis,
.zform:has(input[name=typ][value=zwischen]:checked) .nur-austritt,
.zform:not(:has(input[name=typ][value=voll]:checked)) .nur-voll,
.zform:not(:has(input[name=typ][value=zwischen]:checked)) .nur-zwischen,
.zform:not(:has(#fuehrung:checked)) .nur-fuehrung { display: none; }

/* Preview */
.preview-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.doc .doc-title { margin-top: 0; font-size: 1.5rem; }
.doc ul { padding-left: 1.3rem; }
.hidden-block { margin: 1.1rem 0; filter: blur(0.6px); }
.hidden-block .tag { display: inline-block; font-family: var(--sans); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.35rem; filter: none; }
.ln { display: block; height: 0.7rem; background: var(--line); border-radius: 4px; margin: 0.45rem 0; opacity: 0.8; }
.w90 { width: 90%; } .w85 { width: 85%; } .w75 { width: 75%; } .w60 { width: 60%; }
.lock { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); text-align: center; border-top: 1px dashed var(--line); padding-top: 0.8rem; }
.side .card h2 { margin-top: 0; font-size: 1.15rem; }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 0.93rem; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; }
.price { font-family: var(--serif); font-size: 2rem; margin: 0.2rem 0; }
.notice { background: var(--warn-soft); border-left: 4px solid var(--warn); padding: 10px 12px; border-radius: 6px; }
.danger p { margin-top: 0; }

.editor textarea { font-family: var(--serif); font-size: 1rem; background: var(--paper); min-height: 24rem; }

.prose { max-width: 46rem; }
.prose address { font-style: normal; margin: 1rem 0; }

footer.site { border-top: 1px solid var(--line); margin-top: 3rem; background: var(--surface); font-size: 0.92rem; }
.foot { padding-top: 18px; padding-bottom: 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }

@media (max-width: 820px) {
  .hero, .two, .preview-layout { grid-template-columns: 1fr; gap: 20px; }
  .grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .cols { grid-template-columns: 1fr; }
  .paper { padding: 18px 16px; }
  .card { padding: 14px; }
  .brand { font-size: 0.98rem; }
  .actions .btn { width: 100%; text-align: center; }
}

/* CEO dashboard */
.dash { width: 100%; border-collapse: collapse; margin: 0.4rem 0 1rem; font-size: 0.93rem; }
.dash th, .dash td { text-align: left; padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--line); font-weight: 400; }
.dash thead th { font-weight: 600; color: var(--muted); }
.dash tbody th { font-weight: 600; }
progress { width: 100%; max-width: 14rem; height: 0.7rem; accent-color: var(--accent); vertical-align: middle; }
.card h3 { font-size: 1rem; margin: 1rem 0 0.3rem; }
