@media print {
    /* More aggressive reset to prevent blank pages */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
        background-image: none !important;
        background-color: #ffffff !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }

    /* Hide non-essential elements */
    [data-include="content/header.html"],
    [data-include="content/footer.html"],
    .btn,
    .no-print {
        display: none !important;
    }

    /* Ensure the main content area is fully visible */
    main#content {
        visibility: visible;
        width: 100%;
        position: static;
        overflow: visible;
        margin: 0;
        padding: 0;
    }

    /* Make sure all children of the main content are visible */
    main#content * {
        visibility: visible;
    }

    /* Reset form section positioning to allow normal document flow */
    #mitsol-signup-form-section,
    #openserve-signup-form-section,
    #schweet_web-signup-form-section {
        position: static !important;
        width: 100% !important;
        page-break-inside: avoid;
        margin: 0;
        padding: 0;
    }

    /* Prevent page breaks inside form sections and other important elements */
    .card, .form-section {
        page-break-inside: avoid;
        margin-bottom: 20px; /* Add some spacing between sections */
    }

    /* Remove page break after the last element to prevent blank pages */
    .form-section:last-child {
        page-break-after: avoid;
    }


    /* Ensure form fields are styled for printing */
    input, textarea, select {
        border: 1px solid #ccc;
    }
}