/* ABOUTME: Styles for PeerAuth-Werk: dark werk.tirol header with amber accent, light working area, setup and two QR cards. */
/* ABOUTME: Shares its base with QR-Werk; self-hosted font, WCAG 2.2 AA contrast, visible focus, single column on phones. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-next.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --ink: #1c1c1e;
  --ink-soft: #4a4a50;
  --paper: #f7f6f3;
  --card: #ffffff;
  --line: #d9d7d0;
  --accent: #f5a623;
  --accent-ink: #8a5200;
  --warn-bg: #fff3dc;
  --radius: 14px;
  --sans: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1.0625rem/1.6 var(--sans); }
a { color: var(--accent-ink); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px var(--accent); border-radius: 4px; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 2.5rem, 72rem); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -10rem; z-index: 10; padding: 0.7rem 1.1rem; background: var(--accent); color: var(--ink); font-weight: 700; border-radius: 0 0 10px 10px; }
.skip-link:focus { top: 0; }

.top { background: var(--ink); color: #f2f2f7; }
.top-row { display: flex; align-items: center; justify-content: space-between; min-height: 3.5rem; }
.brand { margin: 0; font-weight: 800; font-size: 1.2rem; display: flex; align-items: center; gap: 0.5rem; }
.brand-mark { width: 1.1rem; height: 1.1rem; background: var(--accent); border-radius: 3px; box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 5px var(--accent); }
.brand-sub { font-weight: 400; color: #c7c7cc; font-size: 0.95rem; }
.lang { color: #f2f2f7; font-weight: 700; padding: 0.4rem 0.8rem; border: 2px solid #6e6e73; border-radius: 999px; text-decoration: none; }
.lang:hover { border-color: var(--accent); }
.top :focus-visible { outline-color: var(--accent); box-shadow: none; }

h1 { font-size: clamp(1.9rem, 1.4rem + 2.4vw, 3rem); line-height: 1.1; margin: 2.2rem 0 0.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; margin: 0 0 0.8rem; }
.lead { max-width: 60ch; color: var(--ink-soft); font-size: 1.12rem; margin: 0 0 1.8rem; }
.notice { background: var(--warn-bg); padding: 1rem 1.2rem; border-radius: var(--radius); }

.generator { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 56rem) { .generator { grid-template-columns: 1.25fr 1fr; } .preview { position: sticky; top: 1rem; } }
.generator:focus { outline: none; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem 1.5rem; }

fieldset { border: 0; margin: 0 0 1.2rem; padding: 0; min-width: 0; }
legend { font-weight: 700; margin-bottom: 0.6rem; padding: 0; }
.type-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.type-list label { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.75rem; padding: 0.35rem 0.9rem 0.35rem 0.7rem; border: 2px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 600; }
.type-list input { accent-color: var(--ink); width: 1.05rem; height: 1.05rem; margin: 0; }
.type-list label:has(input:checked) { border-color: var(--ink); background: var(--ink); color: #fff; }
.type-list label:has(input:checked) input { accent-color: var(--accent); }
.type-list label:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px var(--accent); }

.fields { margin-bottom: 1rem; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.9rem 1rem; }
.grid2 > * { min-width: 0; }
@media (min-width: 36rem) { .grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .span2 { grid-column: 1 / -1; } }
label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.opt { font-weight: 400; color: var(--ink-soft); }
input:not([type="radio"], [type="checkbox"], [type="color"]), select, textarea {
  width: 100%; min-height: 2.75rem; padding: 0.55rem 0.75rem; font: inherit; color: var(--ink);
  background: #fff; border: 2px solid #8e8c86; border-radius: 10px;
}
textarea { resize: vertical; }
input[type="color"] { width: 100%; height: 2.75rem; padding: 0.2rem; border: 2px solid #8e8c86; border-radius: 10px; background: #fff; }
select:disabled { background: #efeee9; color: var(--ink-soft); }
.when { margin: 0; }
.when legend { font-weight: 700; margin-bottom: 0.3rem; }
.when-row { display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem; gap: 0.6rem; }
.when-row label { font-weight: 500; font-size: 0.95rem; }
.date-input { position: relative; display: flex; }
.date-input input:not(.picker) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.pick {
  flex: none; width: 2.9rem; min-height: 2.75rem; border: 2px solid #8e8c86; border-left: 0; border-radius: 0 10px 10px 0;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c1c1e' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E") center / 1.3rem no-repeat;
  cursor: pointer;
}
.pick:hover { background-color: #f2f0ea; }
.date-input input.picker { position: absolute; right: 0; bottom: 0; width: 1px; min-height: 0; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.privacy { margin: 0 auto 3.5rem; max-width: 72rem; }
.privacy h3 { font-size: 1.05rem; margin: 1.2rem 0 0.3rem; }
.privacy p { max-width: 75ch; color: var(--ink-soft); margin: 0 0 0.6rem; }
.check { display: flex; align-items: center; gap: 0.6rem; }
.check input { width: 1.25rem; height: 1.25rem; accent-color: var(--ink); margin: 0; flex: none; }
.check label { margin: 0; font-weight: 500; }
.hint { color: var(--ink-soft); font-size: 0.95rem; margin: 0.3rem 0 0; }

details { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 0.6rem; }
summary { cursor: pointer; font-weight: 700; min-height: 2.75rem; display: flex; align-items: center; }
details[open] summary { margin-bottom: 0.6rem; }

.qr { aspect-ratio: 1; width: 100%; max-width: 22rem; margin: 0 auto 0.8rem; background: #fff; border-radius: 10px; }
.qr svg { display: block; width: 100%; height: 100%; border-radius: 10px; }
.qr.empty { border: 2px dashed var(--line); background: repeating-linear-gradient(45deg, #faf9f6, #faf9f6 10px, #f2f0ea 10px, #f2f0ea 20px); }
.status { min-height: 1.6em; margin: 0 0 1rem; color: var(--ink-soft); }
.status.warn { background: var(--warn-bg); color: var(--ink); padding: 0.6rem 0.8rem; border-radius: 10px; }
.downloads { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.btn { min-height: 2.9rem; padding: 0.6rem 1.2rem; font: inherit; font-weight: 700; border-radius: 999px; border: 2px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer; }
.btn-primary { background: var(--ink); color: #fff; }
.btn:hover:not(:disabled) { border-color: var(--accent-ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
pre { white-space: pre-wrap; word-break: break-all; background: #f2f0ea; padding: 0.8rem; border-radius: 10px; font-size: 0.9rem; margin: 0; }

.facts { margin: 3rem auto 3.5rem; }
.fact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
@media (min-width: 56rem) { .fact-list { grid-template-columns: repeat(3, 1fr); } }
.fact-list li { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: var(--radius); padding: 1rem 1.2rem; }
.fact-list strong { display: block; }

.foot { background: var(--ink); color: #d1d1d6; font-size: 0.95rem; }
.foot a { color: #fff; }
.foot :focus-visible { outline-color: var(--accent); box-shadow: none; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding-block: 1.5rem; }
.foot p { margin: 0; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 2rem; display: grid; gap: 0.8rem; }
@media (min-width: 56rem) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { counter-increment: step; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent); color: var(--ink); font-weight: 800; margin-bottom: 0.5rem; }
.steps strong { display: block; }

.setup { margin-bottom: 1.5rem; }
.names { display: grid; gap: 1rem; }
@media (min-width: 40rem) { .names { grid-template-columns: 1fr 1fr auto; align-items: end; } }
.names .btn { white-space: nowrap; }

.result { display: grid; gap: 1.5rem; }
.pair { display: grid; gap: 1.2rem; }
@media (min-width: 48rem) { .pair { grid-template-columns: 1fr 1fr; } }
.person h3 { font-size: 1.2rem; margin: 0 0 0.3rem; }
.person .qr { max-width: 16rem; margin: 0.8rem auto; padding: 0.4rem; border: 1px solid var(--line); }
.app-preview { display: flex; gap: 0.7rem; align-items: center; background: #f2f0ea; border-radius: 12px; padding: 0.6rem 0.8rem; font-size: 0.95rem; }
.app-preview .dot { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--ink); color: var(--accent); display: grid; place-items: center; font-weight: 800; }
.app-preview strong { display: block; overflow-wrap: anywhere; }
.app-preview span { color: var(--ink-soft); overflow-wrap: anywhere; }

.check-code { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.code { font: 700 clamp(2.2rem, 1.6rem + 3vw, 3.2rem)/1 var(--sans); letter-spacing: 0.12em; font-variant-numeric: tabular-nums; margin: 0; }
.ring { --p: 1; width: 3.2rem; height: 3.2rem; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 360deg), #e6e3db 0); display: grid; place-items: center; }
.ring span { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1rem; letter-spacing: 0.08em; overflow-wrap: anywhere; background: #f2f0ea; padding: 0.7rem 0.9rem; border-radius: 10px; margin: 0.4rem 0 0; }
.limits { border-left: 5px solid var(--accent); }
.limits ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.limits li { margin-bottom: 0.4rem; }
.credit { margin: 0 auto 2.5rem; }
.credit .panel { border-left: 5px solid var(--ink); }
.privacy { margin: 0 auto 3.5rem; }
.privacy h3 { font-size: 1.05rem; margin: 1.2rem 0 0.3rem; }
.privacy p, .credit p { max-width: 75ch; color: var(--ink-soft); margin: 0 0 0.6rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.result { margin-bottom: 1.5rem; }
.result .downloads { margin-top: 1rem; }
.credit { margin-top: 1.5rem; }
.check-code + details { margin-top: 1rem; }
.wrong { margin-top: 1.5rem; }

@media (forced-colors: active) {
  .type-list label:has(input:checked) { border-color: Highlight; }
  .btn { border-color: ButtonText; }
}
