/* flowmode: Aussehen der OpenSign-Oberflaeche auf sign.flowmode.pro (README ops/opensign/README.md, „Signier-Seite“).
   Wird von flowmode-ui-start.sh als letztes Stylesheet in build/index.html eingehaengt und gewinnt damit gegen
   OpenSigns eigenes CSS. Klassen fm-signer / fm-erfolg setzt flowmode.js je nach Seite auf <html>. */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("/flowmode/fonts/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("/flowmode/fonts/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("/flowmode/fonts/poppins-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Urbanist"; font-style: normal; font-weight: 700; font-display: swap; src: url("/flowmode/fonts/urbanist-latin-700-normal.woff2") format("woff2"); }

/* Farben: daisyUI-Thema „opensigncss“ (Werte als OKLCH). Primaer = Knopf-Gruen der Einladungsmail #4E6B5C,
   Sekundaer = flowmode-Dunkel #1f2a24 (weisse Schrift), Neutral = flowmode-Hellgruen #d4ddd7 (dunkle Schrift). */
[data-theme="opensigncss"] {
  --p: 50.0252% 0.041593 161.894840;
  --pc: 100% 0 0;
  --s: 27.2457% 0.018853 160.989675;
  --sc: 100% 0 0;
  --n: 88.8965% 0.012627 156.973730;
  --nc: 27.2457% 0.018853 160.989675;
}
/* OpenSign hat das alte Blau an einigen Stellen fest im Markup (Tailwind bg-[#002864], z. B. Reiter „Zeichnen“). */
.bg-\[\#002864\] { background-color: #4E6B5C !important; }

body { font-family: "Poppins", Arial, Helvetica, sans-serif; }
h1, h2, h3 { font-family: "Urbanist", "Poppins", Arial, sans-serif; }

/* Konfetti (react-confetti zeichnet auf eine Leinwand ohne Mausereignisse) — passt nicht zu einem Vertrag. */
canvas[style*="pointer-events: none"] { display: none !important; }

/* Leiste mit Logo und Begruessung (nur Unterzeichner-Seiten, flowmode.js) */
#fm-leiste {
  display: flex; align-items: center; gap: 20px; min-height: 56px; padding: 0 20px;
  background: #fff; border-bottom: 3px solid #7FA08C; color: #1f2a24; font-size: 14px; line-height: 1.4;
}
#fm-leiste img { height: 24px; width: auto; display: block; }
#fm-leiste .fm-gruss { margin-left: auto; text-align: right; }
#fm-leiste .fm-gruss b { font-weight: 600; }
@media (max-width: 767px) {
  #fm-leiste { flex-wrap: wrap; gap: 4px 12px; padding: 8px 12px; min-height: 0; font-size: 13px; }
  #fm-leiste img { height: 20px; }
  #fm-leiste .fm-gruss { order: 3; flex-basis: 100%; margin-left: 0; text-align: left; }
}

/* Unterzeichner-Seite: Seiten-Vorschau links weg (RenderAllPdfPage: Spalte w-[20%] mit .autoSignScroll), das Dokument
   bekommt den Platz (Mitte md:w-[57%] in PdfRequestFiles). Reines CSS, damit die Breite schon beim ersten Zeichnen stimmt. */
html.fm-signer div:has(> .autoSignScroll) { display: none !important; }
@media (min-width: 768px) {
  html.fm-signer .md\:w-\[57\%\] { width: 77% !important; }
}

/* Schlussseite: Logo ueber der Karte, ruhiger Hintergrund */
html.fm-erfolg body, html.fm-erfolg #root > div { background: #f3f5f4; }
#fm-danke { font-family: "Urbanist", "Poppins", Arial, sans-serif; }
#fm-erfolg-logo { display: block; height: 30px; width: auto; margin: 0 auto 20px; }

/* Hinweis „Fertig unterschrieben“ beim erneuten Oeffnen eines fertigen Vorgangs (PdfRequestFiles: ModalUi mit
   md:max-w-[400px], drei Knoepfe mit mr-[5px]). Breiter, Knoepfe in einer Reihe, Herunterladen (primaer) zuerst. */
html.fm-signer .md\:max-w-\[400px\] { max-width: 540px !important; }
html.fm-signer div.flex.flex-col.mt-3 > div:has(> .op-btn) { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
html.fm-signer div.flex.flex-col.mt-3 > div:has(> .op-btn) > .op-btn { margin: 0 !important; }
html.fm-signer div.flex.flex-col.mt-3 > div:has(> .op-btn) > .op-btn-primary { order: -1; }

/* Ablehnen-Dialog (PdfDeclineModal mit Textfeld): „Zurueck“ ist der Hauptknopf und steht zuerst, „Ja, ablehnen“
   zurueckhaltend daneben — Gruen heisst „weiter“, nicht „ablehnen“. Texte: flowmode.js + locales-overrides.json. */
html.fm-signer .op-modal-box:has(textarea) .m-\[15px\] { display: flex; flex-wrap: wrap; gap: 8px; }
html.fm-signer .op-modal-box:has(textarea) .m-\[15px\] > .op-btn { margin: 0 !important; }
html.fm-signer .op-modal-box:has(textarea) .m-\[15px\] > .op-btn-secondary { order: -1; background-color: #4E6B5C !important; border-color: #4E6B5C !important; color: #fff !important; }
html.fm-signer .op-modal-box:has(textarea) .m-\[15px\] > .op-btn-primary { background-color: transparent !important; border: 1px solid #c9a5a5 !important; color: #8a2b2b !important; }

/* Unterschrift „Schreiben“: ausgewaehlte Schrift hellgruen statt hellblau (TypeSignature.jsx, Inline-Stil). */
.tabWidth > div[style*="rgb(206, 225, 247)"] { background-color: #d4ddd7 !important; }

/* Kein doppeltes Scrollen: Dokumentbereich genau so hoch wie der Rest des Fensters (Wert: flowmode.js, --fm-dok-hoehe),
   die Seite selbst scrollt dann nicht mehr. Nur ab 768 px — am Handy bleibt OpenSigns Verhalten. */
@media (min-width: 768px) {
  html.fm-signer.fm-hoehe, html.fm-signer.fm-hoehe body { overflow: hidden; }
  html.fm-signer.fm-hoehe .ScrollbarsCustom { height: var(--fm-dok-hoehe) !important; }
}
/* Herausgezoomt ist die Seite schmaler als die Spalte: mittig statt links (Seite + Felder liegen zusammen in diesem Block). */
html.fm-signer .ScrollbarsCustom-Content > div.relative { margin-left: auto; margin-right: auto; }
