/* ATM Signatur-App. Farben nach dem ATM-Design: Navy, Naval, Brushed Gold, Steel Slate. */
:root {
  --navy: #001A3D; --naval: #003F7F; --gold: #C5A880; --slate: #5d6b7a;
  --bg: #E6E9EE; --surface: #fff; --text: #0c1a2e; --line: #cfd5dd;
  --ok: #1f7a4d; --warn: #9a5b00; --bad: #a12b2b;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; }
[hidden] { display: none !important; }
header.top { background: var(--surface); border-bottom: 3px solid var(--gold); padding: 14px 24px; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
header.top h1 { font-size: 20px; margin: 0; color: var(--navy); font-weight: 600; }
header.top .who { margin-left: auto; font-size: 13px; color: var(--slate); display: flex; gap: 12px; align-items: center; }
nav.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
nav.tabs button { border: 0; background: none; padding: 6px 12px; border-radius: 5px; color: var(--slate); font-weight: 500; }
nav.tabs button[aria-current="page"] { background: var(--navy); color: #fff; }
main { max-width: 1320px; margin: 0 auto; padding: 24px; }
@media (max-width: 700px) { main { padding: 16px; } header.top { padding: 12px 16px; } }
h2 { font-size: 17px; margin: 0 0 10px; color: var(--navy); font-weight: 600; }
h3 { font-size: 14px; margin: 0 0 6px; color: var(--navy); font-weight: 600; }
p { margin: 0 0 10px; }
.hint { font-size: 13px; color: var(--slate); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.narrow { max-width: 720px; }
button, .btn { font: inherit; font-size: 14px; font-weight: 500; border-radius: 5px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 7px 12px; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { border-color: var(--naval); }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--naval); outline-offset: 2px; }
button.primary, .btn.primary { background: var(--naval); border-color: var(--naval); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--navy); }
button.danger { color: var(--bad); }
button:disabled { opacity: .5; cursor: not-allowed; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--slate); }
input[type="text"], input[type="email"], input[type="date"], select, textarea { font: inherit; font-size: 14px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--text); width: 100%; }
textarea { min-height: 70px; resize: vertical; }
input[type="range"] { width: 100%; accent-color: var(--naval); }
.msg { min-height: 20px; font-size: 13px; color: var(--naval); margin: 0; }
.msg.err { color: var(--bad); }
.chip { font-size: 12px; font-weight: 600; border-radius: 10px; padding: 1px 8px; border: 1px solid currentColor; white-space: nowrap; }
.chip.ok { color: var(--ok); } .chip.wait { color: var(--warn); } .chip.off { color: var(--slate); } .chip.bad { color: var(--bad); }
/* Dokumente */
.work { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(260px, 320px); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .work { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); } .work .panel { grid-column: 1 / -1; } }
@media (max-width: 700px) { .work { grid-template-columns: 1fr; } }
.doclist { display: flex; flex-direction: column; gap: 6px; }
.doclist button { text-align: left; display: flex; flex-direction: column; gap: 4px; width: 100%; }
.doclist button[aria-pressed="true"] { border-color: var(--naval); box-shadow: inset 3px 0 0 var(--gold); }
.doclist .name { font-weight: 600; overflow-wrap: anywhere; }
.sheetwrap { overflow-x: auto; }
.sheet { position: relative; width: fit-content; margin: 0 auto; background: #fff; box-shadow: 0 1px 2px rgba(0,26,61,.15), 0 8px 28px rgba(0,26,61,.14); }
.sheet canvas { display: block; }
.sheet .overlay { position: absolute; inset: 0; }
.sheet .overlay.placing { cursor: copy; }
.mark { position: absolute; user-select: none; }
.mark.move { cursor: move; touch-action: none; outline: 1.5px dashed var(--naval); outline-offset: 3px; }
.mark img { display: block; width: 100%; height: 100%; pointer-events: none; }
.mark.fieldbox { border: 1.5px dashed #b07d1a; background: rgba(197,168,128,.22); color: #5a3e05; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2px; overflow: hidden; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.pager .info { font-size: 14px; color: var(--slate); font-variant-numeric: tabular-nums; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
ul.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
ul.plain li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
/* Unterschriftsfeld */
canvas.pad { width: 100%; height: 170px; background: #fff; border: 1px dashed #9aa7b6; border-radius: 5px; touch-action: none; cursor: crosshair; display: block; }
img.sigpreview { max-width: 280px; max-height: 110px; background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 8px; display: block; }
/* Tabellen */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 7px 12px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--slate); font-weight: 500; white-space: nowrap; }
td.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
td.detail { overflow-wrap: anywhere; color: var(--slate); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.login { max-width: 420px; margin: 8vh auto 0; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 4px; }
.work.two { grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); }
@media (max-width: 700px) { .work.two { grid-template-columns: 1fr; } }
header.top h1.brand { display: flex; align-items: center; gap: 10px; }
header.top h1.brand img { display: block; }

/* --- UX-Überarbeitung --- */
.msg:empty { display: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.flash { margin: 0 0 12px; padding: 10px 14px; background: #e7f3ec; border-left: 3px solid var(--ok); color: #164f33; font-size: 14px; border-radius: 4px; }
.pos { margin: 0; font-size: 13px; padding: 8px 10px; border-radius: 4px; background: #fdf6e8; color: #6b4a12; border: 1px dashed #d9b46a; }
.pos.set { background: #eaf1fa; color: var(--naval); border: 1px solid #b9cde6; }
.seg button { white-space: nowrap; font-size: 14px; padding: 9px 8px; }
button.linkish { border: 0; background: none; color: var(--naval); text-decoration: underline; padding: 7px 4px; }
.doclist button { gap: 2px; }
.welcome { max-width: 640px; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; flex-direction: column; gap: 2px; }
.steps li::marker { color: var(--bronze, #A87B45); font-weight: 600; }
.note { margin: 0; font-size: 14px; padding: 10px 12px; background: #fdf6e8; border-radius: 4px; }
.dropzone { border: 2px dashed #9aa7b6; border-radius: 6px; padding: 28px; text-align: center; color: var(--slate); font-size: 14px; }
.dragging .dropzone, .docarea.dragging .sheet { outline: 3px solid var(--gold); outline-offset: 4px; }
.welcome.dragging { border-color: var(--gold); }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 700px) {
  header.top { gap: 8px 12px; }
  header.top .who { margin-left: auto; order: 2; }
  header.top .who span { display: none; }
  nav.tabs { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; }
  nav.tabs button { flex: none; }
  .pager .btn { flex: 1; text-align: center; }
}
/* Externe Seite: auf schmalen Bildschirmen Einleitung, dann Dokument, dann Unterschrift */
.ext { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); grid-template-areas: "intro doc" "sign doc"; gap: 20px; align-items: start; }
.ext .intro { grid-area: intro; } .ext .docbox { grid-area: doc; } .ext .signcard { grid-area: sign; }
@media (max-width: 760px) { .ext { grid-template-columns: 1fr; grid-template-areas: "intro" "doc" "sign"; } }
.steps li { display: list-item; }
.steps li strong, .steps li .hint { display: block; }
@media (max-width: 700px) { nav.tabs button { padding: 6px 9px; font-size: 14px; } }
