/* Dokumentvorlagen: Blatt, Felder und Unterschrift. Wird auf der Website und in der Verwaltung geladen. */

.doc-sheet {
  max-width: 820px;
  margin: 0 auto 1.25rem;
  padding: clamp(1.1rem, 4vw, 2.75rem);
  overflow-wrap: anywhere;
  text-shadow: none;
  background: #fff;
  color: #1d2320;
  border-radius: 10px;
  font-family: var(--font-ui, system-ui, sans-serif);
  font-size: 1rem;
  line-height: 1.5;
}
.doc-sheet h1, .doc-sheet h2, .doc-sheet h3, .doc-sheet h4 { color: inherit; font-weight: 700; }
.doc-sheet a { color: #1d4f7c; text-decoration: underline; }
.doc-sheet table { max-width: 100%; }

.doc-input {
  max-width: 100%;
  min-height: 2.1rem;
  padding: 0.2rem 0.5rem;
  border: 0;
  border-bottom: 1.5px solid #8b968d;
  border-radius: 4px 4px 0 0;
  background: #f1f5ee;
  color: #1d2320;
  font: inherit;
}
.doc-sheet .form-grid .doc-input, .doc-textarea { width: 100%; }
.doc-input::placeholder { color: #737d75; }
.doc-input:focus, .doc-sign-input:focus { outline: 2px solid #355f2c; outline-offset: 1px; }
.doc-input.is-invalid, .doc-sign-input.is-invalid { border-color: #b3261e; background: #fdeeed; }

.doc-check { display: inline-flex; gap: 0.5rem; align-items: flex-start; cursor: pointer; }
.doc-check input { width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; flex: none; accent-color: #355f2c; }
.doc-check.is-invalid { color: #b3261e; }
.doc-sign-hint { color: #667067; font-style: italic; }

.doc-value { font-weight: 600; }
.doc-value-empty { color: #667067; font-weight: 400; }

.doc-signature { max-width: 340px; margin-top: 0.75rem; break-inside: avoid; }
.doc-signature-img { display: block; max-width: 100%; height: 90px; object-fit: contain; object-position: left bottom; }
.doc-signature-line { padding-top: 0.25rem; border-top: 1px solid #1d2320; color: #667067; font-size: 0.8rem; }

.doc-sign { max-width: 820px; margin: 0 auto; padding: clamp(1.1rem, 4vw, 2rem); text-shadow: none; background: #fff; color: #1d2320; border-radius: 10px; }
.doc-sign h2 { margin: 0 0 0.2rem; color: inherit; font-size: 1.25rem; font-weight: 700; }
.doc-sign-lead { margin: 0 0 1.1rem; color: #667067; }
.doc-sign-label { display: block; margin-bottom: 0.3rem; font-weight: 600; }
.doc-sign-input { display: block; width: 100%; max-width: 420px; min-height: 2.6rem; padding: 0.4rem 0.7rem; border: 1px solid #c4cbc5; border-radius: 8px; background: #fff; color: #1d2320; font: inherit; }

.doc-sign-pad-label { margin-top: 1rem; }

.doc-sign-pad { position: relative; max-width: 560px; height: 180px; border: 1px solid #c4cbc5; border-radius: 10px; background: #f7f8f6; overflow: hidden; }
.doc-sign-pad.is-invalid { border-color: #b3261e; }
.doc-sign-pad canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.doc-sign-clear { position: absolute; top: 0.5rem; right: 0.5rem; padding: 0.15rem 0.6rem; border: 1px solid #c4cbc5; border-radius: 6px; background: #fff; color: #1d2320; font-size: 0.85rem; }
.doc-sign-hint-line { position: absolute; left: 1rem; right: 1rem; bottom: 0.5rem; padding-top: 0.25rem; border-top: 1px solid #c4cbc5; color: #667067; font-size: 0.8rem; pointer-events: none; }
.doc-sign-error { margin: 0.4rem 0 0; color: #b3261e; font-weight: 600; }

.doc-sign-consent { display: flex; gap: 0.6rem; align-items: flex-start; margin: 1.1rem 0; padding-top: 1rem; border-top: 1px solid #e3e7e2; cursor: pointer; }
.doc-sign-consent input { width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; flex: none; accent-color: #355f2c; }
.doc-sign-consent.is-invalid { color: #b3261e; }
.doc-sign-submit { padding: 0.6rem 1.2rem; border: 0; border-radius: 8px; background: #355f2c; color: #fff; font-weight: 700; }
.doc-sign-submit:hover:not(:disabled) { background: #274820; }
.doc-sign-submit:disabled { opacity: 0.55; cursor: not-allowed; }

.doc-errors { max-width: 820px; margin: 0 auto 1rem; padding: 0.8rem 1rem; border-radius: 10px; background: #fdeeed; color: #8c1d18; }
.doc-errors ul { margin: 0.25rem 0 0; padding-left: 1.2rem; }
.doc-preview-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; max-width: 820px; margin: 0 auto 1rem; padding: 0.6rem 0.9rem; border-radius: 10px; background: #fdf1d8; color: #5e3c00; }
.doc-intro { max-width: 820px; margin: 0 auto 1.25rem; }
.doc-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media print {
  /* Alles neben dem Dokument aus dem Layout nehmen: nur Unsichtbares belegt weiter Platz und ergibt leere Seiten */
  *:has(.doc-print) > :not(.doc-print):not(:has(.doc-print)) { display: none !important; }
  :has(.doc-print) { display: block !important; position: static !important; width: auto !important; max-width: none !important; height: auto !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; backdrop-filter: none !important; overflow: visible !important; }
  .doc-sheet { max-width: none; margin: 0; padding: 0; border-radius: 0; }
  .doc-no-print { display: none !important; }
}
