/* ============================================================================
   V4 pages "Vollmachten" (W13, webapp-v4/seiten/14, mockup prefix vollmacht-).
   List, detail and signing form. Page additions on top of v4.css, all scoped
   under .bl-v4 (V4 shell only).
   ========================================================================= */

/* Breadcrumb */
.bl-v4 .bl-poa-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 16px; font-size: 12.5px; color: var(--muted); }
.bl-v4 .bl-poa-crumbs a { color: var(--muted); }
.bl-v4 .bl-poa-crumbs a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.bl-v4 .bl-poa-crumbs .bl-ic { color: var(--muted-2); }
.bl-v4 .bl-poa-crumbs [aria-current] { font-weight: 600; color: var(--ink-2); }
.bl-v4 .bl-poa-alert { margin-bottom: 16px; }

/* Status per location */
.bl-v4 .bl-poa-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bl-v4 .bl-poa-grid > * { min-width: 0; }
.bl-v4 .bl-poa-loc { display: flex; flex-direction: column; padding: 20px 24px; }
.bl-v4 .bl-poa-loc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bl-v4 .bl-poa-loc-id { min-width: 0; }
.bl-v4 .bl-poa-loc-name { font-size: 15px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.bl-v4 .bl-poa-loc-addr { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.bl-v4 .bl-poa-loc-addr .bl-ic { flex: none; }
.bl-v4 .bl-poa-loc-text { margin-top: 14px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.bl-v4 .bl-poa-loc-text strong { color: var(--ink-2); font-weight: 600; }
.bl-v4 .bl-poa-loc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: auto; padding-top: 16px; }
.bl-v4 .bl-poa-loc-foot:not(:empty) { margin-top: 16px; border-top: 1px solid var(--line); }
.bl-v4 .bl-poa-loc--missing { box-shadow: inset 3px 0 0 var(--accent), var(--shadow); }
.bl-v4 .bl-poa-loc--external { box-shadow: inset 3px 0 0 var(--warn), var(--shadow); }
.bl-v4 .bl-poa-revoke { font-size: 13.5px; font-weight: 600; color: var(--bad); cursor: pointer; }
.bl-v4 .bl-poa-revoke:hover { text-decoration: underline; text-underline-offset: 3px; }
.bl-v4 .bl-poa-empty .bl-empty { padding: 56px 24px; }
.bl-v4 .bl-poa-empty .bl-empty-sub { max-width: 46ch; line-height: 1.55; }

/* Signed documents (<details>) */
.bl-v4 .bl-poa-docs > summary { list-style: none; cursor: pointer; }
.bl-v4 .bl-poa-docs > summary::-webkit-details-marker { display: none; }
.bl-v4 .bl-poa-docs > summary .bl-poa-chev { color: var(--muted); transition: transform .15s ease; }
.bl-v4 .bl-poa-docs[open] > summary .bl-poa-chev { transform: rotate(180deg); }
.bl-v4 .bl-poa-docs:not([open]) > summary { border-bottom: 0; }
.bl-v4 .bl-poa-docs-title { display: flex; align-items: center; gap: 10px; }
.bl-v4 .bl-poa-doc .bl-lrow-side { gap: 16px; }
.bl-v4 .bl-poa-doc.bl-is-revoked .bl-lrow-title { color: var(--muted); }

/* Detail */
.bl-v4 .bl-poa-head .bl-head-pills { align-items: center; }
.bl-v4 .bl-poa-head-text { min-width: 0; }
.bl-v4 .bl-poa-show-grid { align-items: start; }
.bl-v4 .bl-poa-mono { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.bl-v4 .bl-poa-maps { overflow-wrap: anywhere; font-size: 13px; font-weight: 500; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-line); }
.bl-v4 .bl-poa-sig-note { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.bl-v4 .bl-poa-sig-note .bl-ic { flex: none; color: var(--muted-2); }
.bl-v4 .bl-poa-danger { border: 1px solid var(--bad-line); }
.bl-v4 .bl-poa-danger .bl-card-head { flex-direction: column; align-items: flex-start; gap: 4px; border-bottom-color: var(--bad-line); }
.bl-v4 .bl-poa-danger .bl-card-head h2 { color: var(--bad); }

/* Signing form */
.bl-v4 .bl-poa-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 13px; font-weight: 500; color: var(--muted); }
.bl-v4 .bl-poa-back:hover { color: var(--accent-ink); }
.bl-v4 .bl-poa-sign-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "left preview"; gap: 16px 24px; align-items: start; }
.bl-v4 .bl-poa-sign-grid > * { min-width: 0; }
.bl-v4 .bl-poa-area-left { grid-area: left; position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.bl-v4 .bl-poa-area-preview { grid-area: preview; }
.bl-v4 .bl-poa-area-submit .bl-btn { width: 100%; height: 48px; }
.bl-v4 .bl-poa-short { margin-top: 10px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.bl-v4 .bl-poa-rule { height: 1px; margin: 20px 0; border: 0; background: var(--line); }
.bl-v4 .bl-poa-sign-grid .bl-input { width: 100%; height: 44px; padding: 0 14px; }
.bl-v4 .bl-poa-sign-grid .bl-select:invalid:focus,
.bl-v4 .bl-poa-sign-grid .bl-input:invalid:focus { border-color: var(--accent); }
.bl-v4 .bl-poa-sign-hint { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.bl-v4 .bl-poa-sign-hint .bl-ic { flex: none; color: var(--good); }
.bl-v4 .bl-poa-hint-mobile { display: none; }
.bl-v4 .bl-poa-note { margin-top: 8px; font-size: 12px; text-align: center; color: var(--muted); }

/* Document preview: a document, so the paper stays light in dark mode */
.bl-v4 .bl-poa-doc-card { overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.bl-v4 .bl-poa-doc-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.bl-v4 .bl-poa-doc-bar span { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.bl-v4 .bl-poa-doc-bar i { font-style: normal; font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--muted); }
.bl-v4 .bl-poa-paper { padding: 28px 32px 32px; background: #ffffff; color: #1f2d2f; font-size: 13px; line-height: 1.6; }
.bl-v4 .bl-poa-paper h2 { margin-bottom: 24px; font-family: Georgia, "Times New Roman", serif; font-size: 26px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-align: center; color: #0c1b1e; }
.bl-v4 .bl-poa-paper p { margin-bottom: 10px; }
.bl-v4 .bl-poa-paper table { width: 100%; margin-bottom: 16px; border-collapse: collapse; }
.bl-v4 .bl-poa-paper td { padding: 5px 10px; border: 1px solid #d5dedd; vertical-align: top; overflow-wrap: anywhere; }
.bl-v4 .bl-poa-paper td:first-child { width: 36%; background: #f5f8f8; font-weight: 600; color: #3a4d4f; overflow-wrap: normal; hyphens: auto; }
.bl-v4 .bl-poa-paper ul { margin: 0 0 16px; padding: 0; list-style: none; }
.bl-v4 .bl-poa-paper li { position: relative; padding-left: 16px; }
.bl-v4 .bl-poa-paper li::before { content: "•"; position: absolute; left: 0; }
.bl-v4 .bl-poa-paper ul.bl-poa-plain li { padding-left: 0; }
.bl-v4 .bl-poa-paper ul.bl-poa-plain li::before { content: none; }
.bl-v4 .bl-poa-paper .bl-poa-url { font-size: 11px; line-height: 1.4; }
.bl-v4 .bl-poa-paper .bl-poa-date { margin: 16px 0 28px; }
.bl-v4 .bl-poa-pad { position: relative; width: 100%; max-width: 320px; height: 96px; border-radius: 6px; border: 2px dashed var(--brand); background: color-mix(in srgb, var(--brand) 6%, #fff); }
.bl-v4 .bl-poa-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.bl-v4 .bl-poa-pad-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; pointer-events: none; font-size: 12px; font-style: italic; color: var(--brand); opacity: .75; }
/* signature-pad hides the hint (.hidden) once there is a stroke: signed look */
.bl-v4 .bl-poa-pad-hint.hidden { display: none; }
.bl-v4 .bl-poa-pad:has(.bl-poa-pad-hint.hidden) { border-style: solid; border-color: color-mix(in srgb, var(--brand) 40%, #fff); background: #ffffff; }
/* …and shows .signature-error when the field is empty on submit */
.bl-v4 .bl-poa-paper:has(.signature-error:not(.hidden)) .bl-poa-pad { border-color: #be123c; background: #fdeef1; }
.bl-v4 .bl-poa-pad-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; max-width: 320px; margin-top: 4px; }
.bl-v4 .bl-poa-pad-label { font-size: 11px; color: #5d7275; }
.bl-v4 .bl-poa-reset { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: 6px; border: 1px solid #d5dedd; background: #ffffff; font-size: 11px; font-weight: 600; color: #5d7275; }
.bl-v4 .bl-poa-reset:hover { color: #0c1b1e; border-color: #95a5a7; }
.bl-v4 .bl-poa-paper .bl-poa-pad-error { margin: 4px 0 0; font-size: 11.5px; font-weight: 600; color: #be123c; }
.bl-v4 .bl-poa-pad-error.hidden { display: none; }
.bl-v4 .bl-poa-signee { margin-top: 10px; font-weight: 600; line-height: 1.45; color: #0c1b1e; }

@media (max-width: 1023.98px) {
  .bl-v4 .bl-poa-crumbs { margin-bottom: 8px; }
  .bl-v4 .bl-poa-crumbs a { display: inline-flex; align-items: center; min-height: 40px; }
  .bl-v4 .bl-poa-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .bl-v4 .bl-poa-loc { padding: 18px 20px; }
  .bl-v4 .bl-poa-loc-foot .bl-btn { width: 100%; height: 44px; }
  .bl-v4 .bl-poa-loc-foot .bl-link,
  .bl-v4 .bl-poa-revoke { min-height: 40px; }
  .bl-v4 .bl-poa-docs > summary { min-height: 56px; padding: 14px 16px; }
  .bl-v4 .bl-poa-doc { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 16px; }
  .bl-v4 .bl-poa-doc .bl-lrow-ic { display: none; }
  .bl-v4 .bl-poa-doc .bl-lrow-side { grid-column: auto; flex-wrap: wrap; gap: 4px 20px; }
  .bl-v4 .bl-poa-doc .bl-lrow-side .bl-status { margin-right: auto; }
  .bl-v4 .bl-poa-doc .bl-link { min-height: 40px; }
  .bl-v4 .bl-poa-sign-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "form" "preview" "submit"; }
  .bl-v4 .bl-poa-area-left { display: contents; }
  .bl-v4 .bl-poa-area-form { grid-area: form; }
  .bl-v4 .bl-poa-area-submit { grid-area: submit; }
  .bl-v4 .bl-poa-hint-desktop { display: none; }
  .bl-v4 .bl-poa-hint-mobile { display: inline; }
  .bl-v4 .bl-poa-back { min-height: 40px; margin-bottom: 4px; }
  .bl-v4 .bl-poa-sign-grid .bl-input { height: 48px; }
  .bl-v4 .bl-poa-paper { padding: 20px 18px 24px; }
  .bl-v4 .bl-poa-paper h2 { font-size: 22px; margin-bottom: 18px; }
  .bl-v4 .bl-poa-reset { height: 40px; padding: 0 12px; font-size: 12px; }
  .bl-v4 .bl-poa-head .bl-head-pills .bl-btn { flex: 1 1 auto; height: 44px; }
  .bl-v4 .bl-poa-head .bl-head-pills { width: 100%; align-items: center; }
  .bl-v4 .bl-poa-danger .bl-btn { width: 100%; height: 44px; }
  .bl-v4 .bl-poa-maps { display: inline-block; padding: 8px 0; }
  .bl-v4 .bl-poa-empty .bl-btn { width: 100%; height: 44px; }
}
