/* ============================================================
   PRINT STYLESHEET — Zusammenfassung (Mitgliedsantrag / Änderung / Kündigung)
   ------------------------------------------------------------
   Loaded via <link media="print"> as the LAST stylesheet, so it
   wins the cascade over all design themes (light / dark / classic
   / embedded). Because of media="print", these rules are also
   completely inert on screen — no @media wrapper needed inside.

   Goal: render a neutral, printer-friendly A4 document of the
   summary, independent of the currently selected design.
   ============================================================ */

@page {
  size: A4;
  margin: 1.5cm;
}

/* Force exact background/border reproduction where the browser
   supports it (Chromium, modern Firefox / Safari). */
*,
*::before,
*::after {
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* Strip the theme gradient from the page. The qualified selector
   `html body` raises specificity above the design CSS body rule
   (which uses !important on a single `body` selector); combined
   with print.css being last in source order, this always wins. */
html,
html body,
body {
  background: #ffffff !important;
  background-image: none !important;
  color: #000000 !important;
  min-height: 0 !important;
}

/* Generic opt-out class — anything tagged .no-print disappears.
   `html body` raised specificity in case a theme adds a stronger
   rule on .summary-print-btn or any .no-print descendant. */
html body .no-print,
html body .summary-print-btn,
.no-print,
.summary-print-btn,
button.summary-print-btn {
  display: none !important;
  visibility: hidden !important;
}

/* Hide framework / wizard chrome that has no value on paper —
   incl. the entire club-logo header block (empty circle when the
   logo image is missing), the submit button row, captcha, etc. */
#blazor-error-ui,
.form-footer,
#smartwizard > .nav,
altcha-widget,
#finishButton,
button[type="submit"],
#clear-signature-button,
.text-danger,
.validation-message,
.club-header-outside,
.club-logo,
.form-header-default,
.form-title {
  display: none !important;
}

/* SmartWizard manages tab-pane visibility via inline display
   styles — it does NOT add an .active class to tab-panes (only
   to nav anchors). So we must NOT override .tab-pane display
   ourselves, otherwise we'd hide the very step the user is on.
   The inactive panes already carry inline display:none from
   jQuery .hide(), so they stay hidden naturally.

   But SmartWizard's slide animations can leave the active pane
   with position:absolute or a fixed inline height. Reset those
   so the printed content flows naturally. */
#smartwizard,
#smartwizard > .tab-content,
#smartwizard > .tab-content > .tab-pane {
  position: static !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

/* Hide the "Antrag senden!" / navigation button rows that sit
   directly under each step's content. */
#smartwizard .tab-pane > .d-flex.justify-content-end,
#smartwizard .tab-pane > .mt-4.d-flex {
  display: none !important;
}

/* ------------------------------------------------------------
   Page wrapper / container — strip ALL theme decoration
   ------------------------------------------------------------ */

.form-page-wrapper,
html body .form-page-wrapper {
  background: #ffffff !important;
  background-image: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  display: block !important;
}

/* Raised specificity (`html body .form-container`) to beat any
   design-CSS rule that targets `.form-container` with !important. */
.form-container,
html body .form-container,
.form-container.gradient-advanced,
html body .form-container.gradient-advanced {
  background: #ffffff !important;
  background-image: none !important;
  background-color: #ffffff !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

/* (Header / logo block is hidden via the rule above — no
   additional styling needed for .club-header-outside / .club-logo
   / .form-title.) */

/* Section header bar above "Zusammenfassung" */
.custom-header {
  margin-bottom: 0.75rem !important;
  border-left-color: #000000 !important;
  background: transparent !important;
}
.custom-header .title {
  color: #000000 !important;
}

/* ------------------------------------------------------------
   Summary cards — neutral document look
   ------------------------------------------------------------ */

.summary-wrapper {
  gap: 0.5rem !important;
  background: transparent !important;
}

.summary-card {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #b8b8b8 !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  page-break-inside: avoid;
  break-inside: avoid;
}

.summary-card-header {
  background: #f3f3f3 !important;
  background-image: none !important;
  border-bottom: 1px solid #b8b8b8 !important;
}

.summary-card-body {
  background: #ffffff !important;
  background-image: none !important;
}

.summary-card-title,
.summary-label,
.summary-value,
.summary-custom-fields p,
.summary-custom-fields p b,
#divFamMembersSumarize p {
  color: #000000 !important;
}

/* Recolor every SVG-based icon to solid black ink for crisp
   printing — this overrides the theme-driven CSS filter chain. */
.summary-card-icon,
.summary-inline-icon,
.summary-custom-fields img,
#divFamMembersSumarize img,
.form-header-default img {
  filter: brightness(0) saturate(100%) !important;
  opacity: 0.85 !important;
}

/* Items / family rows: don't split across pages */
.summary-item,
#divFamMembersSumarize > div {
  page-break-inside: avoid;
  break-inside: avoid;
  background: transparent !important;
}

/* Alerts (notes + cancellation banner): keep visible but
   in muted, printer-friendly colors. */
.alert {
  background: #fafafa !important;
  background-image: none !important;
  color: #000000 !important;
  border: 1px solid #999999 !important;
  page-break-inside: avoid;
}
.alert-danger {
  border-color: #b00020 !important;
  color: #b00020 !important;
}
.alert-warning {
  border-color: #8a6d3b !important;
}

/* Consent / Datenschutz checkboxes — keep them visible so they
   can be ticked / signed by hand on the printout. */
.form-check {
  page-break-inside: avoid;
}
.form-check-label,
.form-check-label a {
  color: #000000 !important;
  text-decoration: none !important;
}

/* Signature area — keep the canvas box visible as a place for
   a handwritten signature; the Löschen button is hidden above. */
#signature-pad {
  border: 1px solid #b8b8b8 !important;
  background: #ffffff !important;
  page-break-inside: avoid;
}
#signature-text {
  color: #000000 !important;
}
