14370

ID14370
Data2026-09-14
Symbol2026/09/14/14370
InstytucjaZakład Ubezpieczeń Społecznych
NazwaWniosek o rehabilitację leczniczą w ramach prewencji rentowej ZUS - ZUS PR-4
Czy Aktualny1

Ustawy (1)

  • URI://Dziennik_Ustaw/2025/1703/16b/1
  • Art. 16b ust. 1 ustawy z dnia 17 lutego 2005 r. o informatyzacji działalności podmiotów realizujących zadania publiczne (Dz. U. z 2025 r. poz. 1703)

    Pliki

    Styl

    <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wnio="http://crd.gov.pl/wzor/2026/09/14/14370/" version="1.0">
    
        <xsl:variable name="zus-param-document-name" select="'PR-4'"/>
        <xsl:variable name="zus-param-document-title" select="'Wniosek o rehabilitację leczniczą w ramach prewencji rentowej ZUS w zakresie schorzeń'"/>
        <xsl:variable name="zus-param-max-pages">
            <xsl:value-of select="5"/>
        </xsl:variable>
        <xsl:variable name="zus-param-page-width" select="880"/>
        <xsl:variable name="zus-param-page-height" select="1220"/>
        <xsl:variable name="zus-param-page-content-height" select="1110"/>
        <xsl:variable name="zus-param-debug-borders" select="0"/>
    
        <!-- #region DOCUMENT ROOT -->
        <xsl:template match="/">
            <html lang="pl">
                <head>
                    <title>PR-4</title>
                    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    
                    <xsl:call-template name="zus-init-styles"/>
                </head>
                <body style="text-align: center; font-family: Arial;">
                    <xsl:call-template name="strona-1"/>
                    <xsl:call-template name="strona-2"/>
                    <xsl:call-template name="strona-3"/>
                    <xsl:call-template name="strona-4"/>
                    <xsl:call-template name="strona-5"/>
                </body>
            </html>
        </xsl:template>
        <!-- #endregion DOCUMENT ROOT -->
    
        <!-- #region Strona 1 -->
        <xsl:template name="strona-1">
            <xsl:call-template name="zus-page">
                <xsl:with-param name="index" select="1"/>
    
                <xsl:with-param name="content">
    
                    <xsl:call-template name="zus-section">
                        <xsl:with-param name="top" select="0"/>
                        <xsl:with-param name="height" select="300"/>
    
                        <xsl:with-param name="no-header" select="1"/>
                        <xsl:with-param name="content">
    <!--                        pierwszy wiersz checkboxów -->
    
                            <xsl:call-template name="zus-forms-section-checkbox">
                                <xsl:with-param name="top" select="20"/>
                                <xsl:with-param name="left" select="0"/>
                                <xsl:with-param name="width" select="207"/>
    
                                <xsl:with-param name="title" select="'narządu ruchu'"/>
                                <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:ZakresRehabilitacji/wnio:SchorzeniaNarzadowRuchu"/>
                            </xsl:call-template>
    
                            <xsl:call-template name="zus-forms-section-checkbox">
                                <xsl:with-param name="top" select="20"/>
                                <xsl:with-param name="left" select="207"/>
                                <xsl:with-param name="width" select="207"/>
    
                                <xsl:with-param name="title" select="'układu krążenia'"/>
                                <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:ZakresRehabilitacji/wnio:SchorzeniaUkladuKrazenia"/>
                            </xsl:call-template>
    
                            <xsl:call-template name="zus-forms-section-checkbox">
                                <xsl:with-param name="top" select="20"/>
                                <xsl:with-param name="left" select="414"/>
                                <xsl:with-param name="width" select="207"/>
    
                                <xsl:with-param name="title" select="'układu oddechowego'"/>
                                <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:ZakresRehabilitacji/wnio:SchorzeniaUkladuOddechowego"/>
                            </xsl:call-template>
    
                            <xsl:call-template name="zus-forms-section-checkbox">
                                <xsl:with-param name="top" select="20"/>
                                <xsl:with-param name="left" select="621"/>
                                <xsl:with-param name="width" select="207"/>
    
                                <xsl:with-param name="title" select="'psychosomatycznych'"/>
                                <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:ZakresRehabilitacji/wnio:SchorzeniaPsychosomatyczne"/>
                            </xsl:call-template>
    
    <!--                        drugi wiersz checkboxów-->
                            <xsl:call-template name="zus-forms-section-checkbox">
                                <xsl:with-param name="top" select="60"/>
                                <xsl:with-param name="left" select="0"/>
                                <xsl:with-param name="width" select="207"/>
    
                                <xsl:with-param name="title" select="'po leczeniu nowotworu; gruczołu piersiowego'"/>
                                <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:ZakresRehabilitacji/wnio:RehabilitacjaPoOperacjiNowotworuPiersi"/>
                            </xsl:call-template>
    
                            <xsl:call-template name="zus-forms-section-checkbox">
                                <xsl:with-param name="top" select="60"/>
                                <xsl:with-param name="left" select="207"/>
                                <xsl:with-param name="width" select="207"/>
    
                                <xsl:with-param name="title" select="'narządu głosu'"/>
                                <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:ZakresRehabilitacji/wnio:SchorzeniaNarzadowGlosu"/>
                            </xsl:call-template>
    
                            <xsl:call-template name="zus-forms-section-checkbox">
                                <xsl:with-param name="top" select="60"/>
                                <xsl:with-param name="left" select="414"/>
                                <xsl:with-param name="width" select="207"/>
    
                                <xsl:with-param name="title" select="'ośrodkowego układu; nerwowego'"/>
                                <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:ZakresRehabilitacji/wnio:SchorzeniaOsrodkowegoUkladuNerwowego"/>
                            </xsl:call-template>
    
                            <xsl:call-template name="zus-forms-section-checkbox">
                                <xsl:with-param name="top" select="60"/>
                                <xsl:with-param name="left" select="621"/>
                                <xsl:with-param name="width" select="207"/>
    
                                <xsl:with-param name="title" select="'narządu ruchu po wypadku'"/>
                                <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:ZakresRehabilitacji/wnio:SchorzeniaNarzaduRuchuPoWypadku"/>
                            </xsl:call-template>
    
                            <!--                        trzeci wiersz checkboxów -->
    
                            <xsl:call-template name="zus-forms-section-checkbox">
                                <xsl:with-param name="top" select="100"/>
                                <xsl:with-param name="left" select="0"/>
                                <xsl:with-param name="width" select="250"/>
                                <xsl:with-param name="aria-describedby" select="'inneSchorzeniaOpis'"/>
    
                                <xsl:with-param name="title" select="'innych prowadzonych przez ZUS'"/>
                                <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:ZakresRehabilitacji/wnio:InneSchorzenia"/>
                            </xsl:call-template>
    
                            <xsl:call-template name="zus-forms-box">
                                <xsl:with-param name="top" select="105"/>
                                <xsl:with-param name="left" select="250"/>
    
                                <xsl:with-param name="width" select="590"/>
                                <xsl:with-param name="height" select="25"/>
    
                                <xsl:with-param name="txt-align" select="'left'"/>
                                <xsl:with-param name="txt-font-size" select="18"/>
    
                                <xsl:with-param name="txt-padding-left" select="5"/>
                                <xsl:with-param name="txt-padding-right" select="5"/>
                                <xsl:with-param name="id" select="'inneSchorzeniaOpis'"/>
                                <xsl:with-param name="aria-hidden" select="'true'"/>
    
                                <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:ZakresRehabilitacji/wnio:InneSchorzeniaOpis"/>
                            </xsl:call-template>
    
    
                            <xsl:call-template name="zus-text">
                                <xsl:with-param name="top" select="140"/>
                                <xsl:with-param name="left" select="0"/>
                                <xsl:with-param name="width" select="830"/>
                                <xsl:with-param name="height" select="20"/>
                                <xsl:with-param name="line-height" select="20"/>
    
                                <xsl:with-param name="font-size" select="14"/>
                                <xsl:with-param name="text" select="'Z rehabilitacji możesz skorzystać, jeśli jesteś zagrożony częściową lub całkowitą niezdolnością do pracy oraz rokujesz odzyskanie zdolności do pracy po rehabilitacji.'"/>
                            </xsl:call-template>
    
    
    
                        </xsl:with-param>
                    </xsl:call-template>
    
                    <xsl:call-template name="p1-Instrukcja-wypelnienia">
                        <xsl:with-param name="top" select="220"/>
                    </xsl:call-template>
    
                    <xsl:call-template name="p1-Dane-pacjenta">
                        <xsl:with-param name="top" select="435"/>
                    </xsl:call-template>
    
                    <!-- #region Adres zamieszkania -->
                    <xsl:call-template name="p1-Adres-zamieszkania">
                        <xsl:with-param name="top" select="790"/>
                    </xsl:call-template>
                    <!-- #endregion -->
    
    
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <xsl:template name="p1-Instrukcja-wypelnienia">
            <xsl:param name="top"/>
    
            <xsl:call-template name="zus-section">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="header" select="'Instrukcja wypełniania'"/>
                <xsl:with-param name="height" select="400"/>
    
                <xsl:with-param name="content">
                    <p style="margin: 0; font-size: 14px;">
                        <xsl:text>Ten wniosek wypełniasz Ty i Twój lekarz, jeśli chcesz otrzymać skierowanie na rehabilitację leczniczą.</xsl:text> <br/>
                        <xsl:text>Wypełnij samodzielnie: Dane pacjenta, Adres zamieszkania, Adres do korespondencji i Pozostałe informacje.</xsl:text> <br/>
                        <xsl:text>Do wniosku dołącz kopie wyników badań i konsultacji specjalistycznych, które potwierdzają rozpoznanie choroby podstawowej i chorób współistniejących.</xsl:text> <br/>
                        <xsl:text>Lekarz wypełnia: Rozpoznanie, Choroby współistniejące, Rokowanie odzyskania zdolności do pracy i Dane placówki, w której wystawiono wniosek.</xsl:text> <br/>
                        <xsl:text>Wypełniony wniosek złóż do ZUS nie później niż 30 dni po jego wystawieniu przez lekarza.</xsl:text> <br/>
                    </p>
                </xsl:with-param>
            </xsl:call-template>
    
    
        </xsl:template>
    
        <xsl:template name="p1-Dane-pacjenta">
            <xsl:param name="top"/>
    
            <xsl:call-template name="zus-forms-universal-builder">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="title" select="'Dane pacjenta'"/>
    
                <!-- 1. PESEL -->
                <xsl:with-param name="field1_type" select="'pesel'"/>
                <xsl:with-param name="field1_node" select="//wnio:TrescDokumentu/wnio:DaneIdentyfikacyjneOsobyZainteresowanej/wnio:PESEL"/>
    
                <!-- 2. Rodzaj, seria i numer dokumentu -->
                <xsl:with-param name="field2_type" select="'rodzajIseria'"/>
                <xsl:with-param name="field2_node" select="//wnio:TrescDokumentu/wnio:DaneIdentyfikacyjneOsobyZainteresowanej/wnio:RodzajDokumentu"/>
                <xsl:with-param name="field2_node2" select="//wnio:TrescDokumentu/wnio:DaneIdentyfikacyjneOsobyZainteresowanej/wnio:SeriaINumerDokumentu"/>
                <xsl:with-param name="field2_params" select="concat(                 'detail=', 'Podaj, jeśli nie masz nadanego numeru PESEL'             )"/>
    
                <!-- 3. Data urodzenia -->
                <xsl:with-param name="field3_type" select="'date'"/>
                <xsl:with-param name="field3_node" select="//wnio:TrescDokumentu/wnio:DaneIdentyfikacyjneOsobyZainteresowanej/wnio:DataUrodzenia"/>
                <xsl:with-param name="field3_params" select="concat(                 'label=', 'Data urodzenia', '|',                 'pattern=', 'xLxLxxxx', '|',                 'format=', 'xsdate', '|',                 'detail=', 'Podaj, jeśli nie masz nadanego numeru PESEL'             )"/>
    
                <!-- 4. Imię -->
                <xsl:with-param name="field4_type" select="'imie'"/>
                <xsl:with-param name="field4_node" select="//wnio:TrescDokumentu/wnio:DaneIdentyfikacyjneOsobyZainteresowanej/wnio:Imie"/>
    
                <!-- 5. Nazwisko -->
                <xsl:with-param name="field5_type" select="'nazwisko'"/>
                <xsl:with-param name="field5_node" select="//wnio:TrescDokumentu/wnio:DaneIdentyfikacyjneOsobyZainteresowanej/wnio:Nazwisko"/>
    
                <!-- 6. Numer telefonu -->
                <xsl:with-param name="field6_type" select="'text'"/>
                <xsl:with-param name="field6_node" select="//wnio:TrescDokumentu/wnio:AdresZamieszkaniaOsobyZainteresowanej/wnio:NumerTelefonu"/>
                <xsl:with-param name="field6_params" select="concat(                 'label=', 'Numer telefonu', '|',                 'detail=', 'To pole nie jest obowiązkowe. Wypełnij je, jeśli się zgadzasz, żebyśmy przetwarzali Twój numer telefonu. Ułatwi nam to kontakt z Tobą'             )"/>
    
                <!-- 7. Adres e-mail -->
                <xsl:with-param name="field7_type" select="'text'"/>
                <xsl:with-param name="field7_node" select="//wnio:TrescDokumentu/wnio:AdresZamieszkaniaOsobyZainteresowanej/wnio:AdresPocztyElektronicznej"/>
                <xsl:with-param name="field7_params" select="concat(                 'label=', 'Adres e-mail', '|',                 'detail=', 'To pole nie jest obowiązkowe. Wypełnij je, jeśli się zgadzasz, żebyśmy przetwarzali Twój adres e-mail. Ułatwi nam to kontakt z Tobą'             )"/>
    
            </xsl:call-template>
        </xsl:template>
    
        <xsl:template name="p1-Adres-zamieszkania">
            <xsl:param name="top"/>
    
            <xsl:call-template name="zus-section">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="height" select="270"/>
                <xsl:with-param name="header" select="'Adres zamieszkania'"/>
                <xsl:with-param name="content">
                    <!-- Wspólne parametry -->
                    <xsl:variable name="labelWidth" select="300"/>
                    <xsl:variable name="boxStart" select="$labelWidth + 10"/>
                    <xsl:variable name="boxEnd" select="$zus-param-page-width - 40 - 10"/>
                    <xsl:variable name="fullBoxWidth" select="$boxEnd - $boxStart"/>
                    <xsl:variable name="spacing" select="10"/>
                    
                    <!-- Row 1: Kod pocztowy + Miejscowość (obok siebie) -->
                    <xsl:variable name="row1_top" select="0"/>
                    <xsl:variable name="field1_boxWidth" select="150"/>
                    <xsl:variable name="field1_end" select="$boxStart + $field1_boxWidth"/>
                    <xsl:variable name="label2_width" select="100"/>
                    <xsl:variable name="field2_boxWidth" select="$boxEnd - ($field1_end + $spacing + $label2_width + 10)"/>
    
                    <!-- Kod pocztowy (lewe pole) -->
                    <xsl:call-template name="zus-forms-element-textfield">
                        <xsl:with-param name="top" select="$row1_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="labelWidth" select="$labelWidth"/>
                        <xsl:with-param name="boxWidth" select="$field1_boxWidth"/>
                        <xsl:with-param name="title" select="'Kod pocztowy'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:AdresZamieszkaniaOsobyZainteresowanej/wnio:KodPocztowy | //wnio:TrescDokumentu/wnio:AdresZamieszkaniaOsobyZainteresowanej/wnio:ZagranicznyKodPocztowy[not(../wnio:KodPocztowy)]"/>
                    </xsl:call-template>
    
                    <!-- Miejscowość (prawe pole) -->
                    <xsl:variable name="field2_left" select="$field1_end + $spacing"/>
                    <xsl:call-template name="zus-content-block">
                        <xsl:with-param name="top" select="$row1_top"/>
                        <xsl:with-param name="left" select="$field2_left"/>
                        <xsl:with-param name="width" select="$label2_width + 10 + $field2_boxWidth"/>
                        <xsl:with-param name="height" select="30"/>
                        <xsl:with-param name="content">
                            <!-- Etykieta Miejscowość -->
                            <xsl:call-template name="zus-text">
                                <xsl:with-param name="top" select="0"/>
                                <xsl:with-param name="left" select="0"/>
                                <xsl:with-param name="width" select="$label2_width"/>
                                <xsl:with-param name="height" select="25"/>
                                <xsl:with-param name="line-height" select="25"/>
                                <xsl:with-param name="font-size" select="12"/>
                                <xsl:with-param name="text-align" select="'right'"/>
                                <xsl:with-param name="text" select="'Miejscowość'"/>
                            </xsl:call-template>
                            <!-- Pole Miejscowość -->
                            <xsl:variable name="miejscowoscFontSize">
                                <xsl:choose>
                                    <xsl:when test="string-length(normalize-space(//wnio:TrescDokumentu/wnio:AdresZamieszkaniaOsobyZainteresowanej/wnio:Miejscowosc)) &gt; 28">12</xsl:when>
                                    <xsl:when test="string-length(normalize-space(//wnio:TrescDokumentu/wnio:AdresZamieszkaniaOsobyZainteresowanej/wnio:Miejscowosc)) &gt; 22">14</xsl:when>
                                    <xsl:when test="string-length(normalize-space(//wnio:TrescDokumentu/wnio:AdresZamieszkaniaOsobyZainteresowanej/wnio:Miejscowosc)) &gt; 16">16</xsl:when>
                                    <xsl:otherwise>18</xsl:otherwise>
                                </xsl:choose>
                            </xsl:variable>
                            <xsl:call-template name="zus-forms-box">
                                <xsl:with-param name="top" select="0"/>
                                <xsl:with-param name="left" select="$label2_width + 10"/>
                                <xsl:with-param name="width" select="$field2_boxWidth"/>
                                <xsl:with-param name="height" select="25"/>
                                <xsl:with-param name="txt-align" select="'left'"/>
                                <xsl:with-param name="txt-font-size" select="$miejscowoscFontSize"/>
                                <xsl:with-param name="txt-padding-left" select="5"/>
                                <xsl:with-param name="txt-padding-right" select="5"/>
                                <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:AdresZamieszkaniaOsobyZainteresowanej/wnio:Miejscowosc"/>
                            </xsl:call-template>
                        </xsl:with-param>
                    </xsl:call-template>
    
                    <!-- Row 2: Ulica (pełna szerokość) -->
                    <xsl:variable name="row2_top" select="35"/>
                    <xsl:call-template name="zus-forms-element-textfield">
                        <xsl:with-param name="top" select="$row2_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="labelWidth" select="$labelWidth"/>
                        <xsl:with-param name="boxWidth" select="$fullBoxWidth"/>
                        <xsl:with-param name="title" select="'Ulica'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:AdresZamieszkaniaOsobyZainteresowanej/wnio:Ulica"/>
                    </xsl:call-template>
    
                    <!-- Row 3: Numer domu + Numer lokalu (obok siebie) -->
                    <xsl:variable name="row3_top" select="70"/>
                    <xsl:variable name="field3_boxWidth" select="150"/>
                    <xsl:variable name="field3_end" select="$boxStart + $field3_boxWidth"/>
                    <xsl:variable name="label4_width" select="100"/>
                    <xsl:variable name="field4_boxWidth" select="$boxEnd - ($field3_end + $spacing + $label4_width + 10)"/>
    
                    <!-- Numer domu (lewe pole) -->
                    <xsl:call-template name="zus-forms-element-textfield">
                        <xsl:with-param name="top" select="$row3_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="labelWidth" select="$labelWidth"/>
                        <xsl:with-param name="boxWidth" select="$field3_boxWidth"/>
                        <xsl:with-param name="title" select="'Numer domu'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:AdresZamieszkaniaOsobyZainteresowanej/wnio:NumerDomu"/>
                    </xsl:call-template>
    
                    <!-- Numer lokalu (prawe pole) -->
                    <xsl:variable name="field4_left" select="$field3_end + $spacing"/>
                    <xsl:call-template name="zus-content-block">
                        <xsl:with-param name="top" select="$row3_top"/>
                        <xsl:with-param name="left" select="$field4_left"/>
                        <xsl:with-param name="width" select="$label4_width + 10 + $field4_boxWidth"/>
                        <xsl:with-param name="height" select="30"/>
                        <xsl:with-param name="content">
                            <!-- Etykieta Numer lokalu -->
                            <xsl:call-template name="zus-text">
                                <xsl:with-param name="top" select="0"/>
                                <xsl:with-param name="left" select="0"/>
                                <xsl:with-param name="width" select="$label4_width"/>
                                <xsl:with-param name="height" select="25"/>
                                <xsl:with-param name="line-height" select="25"/>
                                <xsl:with-param name="font-size" select="12"/>
                                <xsl:with-param name="text-align" select="'right'"/>
                                <xsl:with-param name="text" select="'Numer lokalu'"/>
                            </xsl:call-template>
                            <!-- Pole Numer lokalu -->
                            <xsl:call-template name="zus-forms-box">
                                <xsl:with-param name="top" select="0"/>
                                <xsl:with-param name="left" select="$label4_width + 10"/>
                                <xsl:with-param name="width" select="$field4_boxWidth"/>
                                <xsl:with-param name="height" select="25"/>
                                <xsl:with-param name="txt-align" select="'left'"/>
                                <xsl:with-param name="txt-font-size" select="18"/>
                                <xsl:with-param name="txt-padding-left" select="5"/>
                                <xsl:with-param name="txt-padding-right" select="5"/>
                                <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:AdresZamieszkaniaOsobyZainteresowanej/wnio:NumerLokalu"/>
                            </xsl:call-template>
                        </xsl:with-param>
                    </xsl:call-template>
    
                    <!-- Row 4: Nazwa państwa (pełna szerokość) z podpisem -->
                    <xsl:variable name="row4_top" select="105"/>
                    <xsl:call-template name="zus-forms-element-textfield">
                        <xsl:with-param name="top" select="$row4_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="labelWidth" select="$labelWidth"/>
                        <xsl:with-param name="boxWidth" select="$fullBoxWidth"/>
                        <xsl:with-param name="title" select="'Nazwa państwa'"/>
                        <xsl:with-param name="detail" select="'Podaj, jeśli Twój adres jest inny niż polski'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:AdresZamieszkaniaOsobyZainteresowanej/wnio:NazwaPanstwa"/>
                    </xsl:call-template>
    
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <xsl:template name="p2-Adres-do-korespondencji">
            <xsl:param name="top"/>
    
            <xsl:call-template name="zus-section">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="height" select="220"/>
                <xsl:with-param name="header" select="'Adres do korespondencji'"/>
                <xsl:with-param name="content">
                    <!-- Instrukcja na górze -->
                    <xsl:call-template name="zus-text">
                        <xsl:with-param name="top" select="0"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="width" select="$zus-param-page-width - 40"/>
                        <xsl:with-param name="height" select="20"/>
                        <xsl:with-param name="line-height" select="20"/>
                        <xsl:with-param name="font-size" select="12"/>
                        <xsl:with-param name="text" select="'Podaj, jeśli adres do korespondencji jest inny niż adres zamieszkania'"/>
                    </xsl:call-template>
    
                    <!-- Wspólne parametry -->
                    <xsl:variable name="labelWidth" select="300"/>
                    <xsl:variable name="boxStart" select="$labelWidth + 10"/>
                    <xsl:variable name="boxEnd" select="$zus-param-page-width - 40 - 10"/>
                    <xsl:variable name="fullBoxWidth" select="$boxEnd - $boxStart"/>
                    <xsl:variable name="spacing" select="10"/>
                    
                    <!-- Row 1: Kod pocztowy + Miejscowość (obok siebie) -->
                    <xsl:variable name="row1_top" select="25"/>
                    <xsl:variable name="field1_boxWidth" select="150"/>
                    <xsl:variable name="field1_end" select="$boxStart + $field1_boxWidth"/>
                    <xsl:variable name="label2_width" select="100"/>
                    <xsl:variable name="field2_boxWidth" select="$boxEnd - ($field1_end + $spacing + $label2_width + 10)"/>
    
                    <!-- Kod pocztowy (lewe pole) -->
                    <xsl:call-template name="zus-forms-element-textfield">
                        <xsl:with-param name="top" select="$row1_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="labelWidth" select="$labelWidth"/>
                        <xsl:with-param name="boxWidth" select="$field1_boxWidth"/>
                        <xsl:with-param name="title" select="'Kod pocztowy'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:AdresDoKorespondencjiOsobyZainteresowanej/wnio:KodPocztowy | //wnio:TrescDokumentu/wnio:AdresDoKorespondencjiOsobyZainteresowanej/wnio:ZagranicznyKodPocztowy[not(../wnio:KodPocztowy)]"/>
                    </xsl:call-template>
    
                    <!-- Miejscowość (prawe pole) -->
                    <xsl:variable name="field2_left" select="$field1_end + $spacing"/>
                    <xsl:call-template name="zus-content-block">
                        <xsl:with-param name="top" select="$row1_top"/>
                        <xsl:with-param name="left" select="$field2_left"/>
                        <xsl:with-param name="width" select="$label2_width + 10 + $field2_boxWidth"/>
                        <xsl:with-param name="height" select="30"/>
                        <xsl:with-param name="content">
                            <!-- Etykieta Miejscowość -->
                            <xsl:call-template name="zus-text">
                                <xsl:with-param name="top" select="0"/>
                                <xsl:with-param name="left" select="0"/>
                                <xsl:with-param name="width" select="$label2_width"/>
                                <xsl:with-param name="height" select="25"/>
                                <xsl:with-param name="line-height" select="25"/>
                                <xsl:with-param name="font-size" select="12"/>
                                <xsl:with-param name="text-align" select="'right'"/>
                                <xsl:with-param name="text" select="'Miejscowość'"/>
                            </xsl:call-template>
                            <!-- Pole Miejscowość -->
                            <xsl:variable name="miejscowoscFontSize">
                                <xsl:choose>
                                    <xsl:when test="string-length(normalize-space(//wnio:TrescDokumentu/wnio:AdresDoKorespondencjiOsobyZainteresowanej/wnio:Miejscowosc)) &gt; 28">12</xsl:when>
                                    <xsl:when test="string-length(normalize-space(//wnio:TrescDokumentu/wnio:AdresDoKorespondencjiOsobyZainteresowanej/wnio:Miejscowosc)) &gt; 22">14</xsl:when>
                                    <xsl:when test="string-length(normalize-space(//wnio:TrescDokumentu/wnio:AdresDoKorespondencjiOsobyZainteresowanej/wnio:Miejscowosc)) &gt; 16">16</xsl:when>
                                    <xsl:otherwise>18</xsl:otherwise>
                                </xsl:choose>
                            </xsl:variable>
                            <xsl:call-template name="zus-forms-box">
                                <xsl:with-param name="top" select="0"/>
                                <xsl:with-param name="left" select="$label2_width + 10"/>
                                <xsl:with-param name="width" select="$field2_boxWidth"/>
                                <xsl:with-param name="height" select="25"/>
                                <xsl:with-param name="txt-align" select="'left'"/>
                                <xsl:with-param name="txt-font-size" select="$miejscowoscFontSize"/>
                                <xsl:with-param name="txt-padding-left" select="5"/>
                                <xsl:with-param name="txt-padding-right" select="5"/>
                                <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:AdresDoKorespondencjiOsobyZainteresowanej/wnio:Miejscowosc"/>
                            </xsl:call-template>
                        </xsl:with-param>
                    </xsl:call-template>
    
                    <!-- Row 2: Ulica (pełna szerokość) -->
                    <xsl:variable name="row2_top" select="60"/>
                    <xsl:call-template name="zus-forms-element-textfield">
                        <xsl:with-param name="top" select="$row2_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="labelWidth" select="$labelWidth"/>
                        <xsl:with-param name="boxWidth" select="$fullBoxWidth"/>
                        <xsl:with-param name="title" select="'Ulica'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:AdresDoKorespondencjiOsobyZainteresowanej/wnio:Ulica"/>
                    </xsl:call-template>
    
                    <!-- Row 3: Numer domu + Numer lokalu (obok siebie) -->
                    <xsl:variable name="row3_top" select="95"/>
                    <xsl:variable name="field3_boxWidth" select="150"/>
                    <xsl:variable name="field3_end" select="$boxStart + $field3_boxWidth"/>
                    <xsl:variable name="label4_width" select="100"/>
                    <xsl:variable name="field4_boxWidth" select="$boxEnd - ($field3_end + $spacing + $label4_width + 10)"/>
    
                    <!-- Numer domu (lewe pole) -->
                    <xsl:call-template name="zus-forms-element-textfield">
                        <xsl:with-param name="top" select="$row3_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="labelWidth" select="$labelWidth"/>
                        <xsl:with-param name="boxWidth" select="$field3_boxWidth"/>
                        <xsl:with-param name="title" select="'Numer domu'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:AdresDoKorespondencjiOsobyZainteresowanej/wnio:NumerDomu"/>
                    </xsl:call-template>
    
                    <!-- Numer lokalu (prawe pole) -->
                    <xsl:variable name="field4_left" select="$field3_end + $spacing"/>
                    <xsl:call-template name="zus-content-block">
                        <xsl:with-param name="top" select="$row3_top"/>
                        <xsl:with-param name="left" select="$field4_left"/>
                        <xsl:with-param name="width" select="$label4_width + 10 + $field4_boxWidth"/>
                        <xsl:with-param name="height" select="30"/>
                        <xsl:with-param name="content">
                            <!-- Etykieta Numer lokalu -->
                            <xsl:call-template name="zus-text">
                                <xsl:with-param name="top" select="0"/>
                                <xsl:with-param name="left" select="0"/>
                                <xsl:with-param name="width" select="$label4_width"/>
                                <xsl:with-param name="height" select="25"/>
                                <xsl:with-param name="line-height" select="25"/>
                                <xsl:with-param name="font-size" select="12"/>
                                <xsl:with-param name="text-align" select="'right'"/>
                                <xsl:with-param name="text" select="'Numer lokalu'"/>
                            </xsl:call-template>
                            <!-- Pole Numer lokalu -->
                            <xsl:call-template name="zus-forms-box">
                                <xsl:with-param name="top" select="0"/>
                                <xsl:with-param name="left" select="$label4_width + 10"/>
                                <xsl:with-param name="width" select="$field4_boxWidth"/>
                                <xsl:with-param name="height" select="25"/>
                                <xsl:with-param name="txt-align" select="'left'"/>
                                <xsl:with-param name="txt-font-size" select="18"/>
                                <xsl:with-param name="txt-padding-left" select="5"/>
                                <xsl:with-param name="txt-padding-right" select="5"/>
                                <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:AdresDoKorespondencjiOsobyZainteresowanej/wnio:NumerLokalu"/>
                            </xsl:call-template>
                        </xsl:with-param>
                    </xsl:call-template>
    
                    <!-- Row 4: Nazwa państwa (pełna szerokość) z podpisem -->
                    <xsl:variable name="row4_top" select="130"/>
                    <xsl:call-template name="zus-forms-element-textfield">
                        <xsl:with-param name="top" select="$row4_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="labelWidth" select="$labelWidth"/>
                        <xsl:with-param name="boxWidth" select="$fullBoxWidth"/>
                        <xsl:with-param name="title" select="'Nazwa państwa'"/>
                        <xsl:with-param name="detail" select="'Podaj, jeśli Twój adres do korespondencji jest inny niż polski'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:AdresDoKorespondencjiOsobyZainteresowanej/wnio:NazwaPanstwa"/>
                    </xsl:call-template>
    
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <xsl:template name="p2-Pozostale-informacje">
            <xsl:param name="top"/>
    
            <xsl:call-template name="zus-section">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="height" select="320"/>
                <xsl:with-param name="header" select="'Pozostałe informacje'"/>
                <xsl:with-param name="content">
                    <!-- Wspólne parametry -->
                    <xsl:variable name="labelWidth" select="300"/>
                    <xsl:variable name="boxStart" select="$labelWidth + 10"/>
                    <xsl:variable name="boxEnd" select="$zus-param-page-width - 40 - 10"/>
                    <xsl:variable name="fullBoxWidth" select="$boxEnd - $boxStart"/>
                    <xsl:variable name="zawodBoxHeight" select="70"/>
                    <xsl:variable name="zawodRowGap" select="5"/>
                    
                    <!-- Row 1: Zawód wykonywany (wysokość x2 dla długich nazw zawodów) -->
                    <xsl:variable name="row1_top" select="0"/>
                    <xsl:call-template name="zus-forms-element-textfield">
                        <xsl:with-param name="top" select="$row1_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="labelWidth" select="$labelWidth"/>
                        <xsl:with-param name="boxWidth" select="$fullBoxWidth"/>
                        <xsl:with-param name="boxHeight" select="$zawodBoxHeight"/>
                        <xsl:with-param name="title" select="'Zawód wykonywany'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:DaneIdentyfikacyjneOsobyZainteresowanej/wnio:ZawodWykonywany"/>
                    </xsl:call-template>
    
                    <!-- Row 2: Zawód wyuczony -->
                    <xsl:variable name="row2_top" select="$row1_top + $zawodBoxHeight + $zawodRowGap"/>
                    <xsl:call-template name="zus-forms-element-textfield">
                        <xsl:with-param name="top" select="$row2_top + 4"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="labelWidth" select="$labelWidth"/>
                        <xsl:with-param name="boxWidth" select="$fullBoxWidth"/>
                        <xsl:with-param name="boxHeight" select="$zawodBoxHeight"/>
                        <xsl:with-param name="title" select="'Zawód wyuczony'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:DaneIdentyfikacyjneOsobyZainteresowanej/wnio:ZawodWyuczony"/>
                    </xsl:call-template>
    
                    <!-- Row 3: Rodzaj pracy (z etykietą po lewej i checkboxami po prawej) -->
                    <xsl:variable name="row3_top" select="$row2_top + $zawodBoxHeight + $zawodRowGap + 4"/>
                    <xsl:variable name="checkbox_spacing" select="20"/>
                    <xsl:variable name="checkbox_width" select="150"/>
                    
                    <!-- Etykieta "Rodzaj pracy" po lewej -->
                    <xsl:call-template name="zus-text">
                        <xsl:with-param name="top" select="$row3_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="width" select="$labelWidth"/>
                        <xsl:with-param name="height" select="25"/>
                        <xsl:with-param name="line-height" select="25"/>
                        <xsl:with-param name="font-size" select="12"/>
                        <xsl:with-param name="text-align" select="'right'"/>
                        <xsl:with-param name="text" select="'Rodzaj pracy'"/>
                    </xsl:call-template>
    
                    <!-- Checkbox "fizyczna" -->
                    <xsl:call-template name="zus-forms-element-checkbox">
                        <xsl:with-param name="top" select="$row3_top"/>
                        <xsl:with-param name="left" select="$boxStart"/>
                        <xsl:with-param name="width" select="$checkbox_width"/>
                        <xsl:with-param name="title" select="'fizyczna'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:DaneIdentyfikacyjneOsobyZainteresowanej/wnio:RodzajPracy/wnio:PracaFizyczna"/>
                    </xsl:call-template>
    
                    <!-- Checkbox "umysłowa" -->
                    <xsl:call-template name="zus-forms-element-checkbox">
                        <xsl:with-param name="top" select="$row3_top"/>
                        <xsl:with-param name="left" select="$boxStart + $checkbox_width + $checkbox_spacing"/>
                        <xsl:with-param name="width" select="$checkbox_width"/>
                        <xsl:with-param name="title" select="'umysłowa'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:DaneIdentyfikacyjneOsobyZainteresowanej/wnio:RodzajPracy/wnio:PracaUmyslowa"/>
                    </xsl:call-template>
    
                    <!-- Row 4: Data (odstęp pod checkboxami Rodzaj pracy) -->
                    <xsl:variable name="row4_gap" select="60"/>
                    <xsl:variable name="row4_top" select="$row3_top + $row4_gap"/>
                    <xsl:variable name="data_boxWidth" select="200"/>
    
                    <!-- Data -->
                    <xsl:call-template name="zus-forms-element-patternbox">
                        <xsl:with-param name="top" select="$row4_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="labelWidth" select="$labelWidth"/>
                        <xsl:with-param name="boxWidth" select="$data_boxWidth"/>
                        <xsl:with-param name="title" select="'Data'"/>
                        <xsl:with-param name="pattern" select="'xLxLxxxx'"/>
                        <xsl:with-param name="format" select="'xsdate'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:Data"/>
                    </xsl:call-template>
    
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <xsl:template name="p2-Rozpoznanie">
            <xsl:param name="top"/>
            <xsl:param name="sectionHeight" select="$zus-param-page-content-height"/>
            <xsl:param name="boxHeight" select="1040"/>
    
            <xsl:call-template name="zus-section">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="height" select="$sectionHeight"/>
                <xsl:with-param name="header" select="'Rozpoznanie (w języku polskim)'"/>
                <xsl:with-param name="content">
                    <!-- Wspólne parametry -->
                    <xsl:variable name="boxWidth" select="$zus-param-page-width - 40 - 20"/>
                    <xsl:variable name="boxTop" select="0"/>
                    
                    <!-- Duże pole tekstowe z obsługą wielowierszowego tekstu -->
                    <xsl:variable name="boxStyles" select="concat(                     'border: 1px solid black; ',                     'background-color: white; ',                     'overflow: hidden; ',                     'top: ', $boxTop, 'px; ',                     'left: 0px; ',                     'display: block; ',                     'position: absolute; ',                     'width: ', $boxWidth, 'px; ',                     'height: ', $boxHeight, 'px; ',                     'color: black; ',                     'font-size: 16px; ',                     'text-align: left; ',                     'padding: 5px; ',                     'line-height: 1.4; ',                     'white-space: pre-wrap; ',                     'word-wrap: break-word;'                 )"/>
                    
                    <div class="multiline-box" style="{$boxStyles}">
                        <xsl:value-of select="//wnio:TrescDokumentu/wnio:Rozpoznanie/wnio:NumerStatystyczny"/>
                        <xsl:text> - </xsl:text>
                        <xsl:value-of select="//wnio:TrescDokumentu/wnio:Rozpoznanie/wnio:Choroba"/>
                    </div>
    
                    <!-- Mały label na dole -->
                    <xsl:call-template name="zus-text">
                        <xsl:with-param name="top" select="$boxTop + $boxHeight + 10"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="width" select="$boxWidth"/>
                        <xsl:with-param name="height" select="15"/>
                        <xsl:with-param name="line-height" select="15"/>
                        <xsl:with-param name="font-size" select="10"/>
                        <xsl:with-param name="text-align" select="'left'"/>
                        <xsl:with-param name="text" select="'Podaj wraz z numerami statystycznymi'"/>
                    </xsl:call-template>
    
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <xsl:template name="p2-Choroby-wspolistniejace">
            <xsl:param name="top"/>
            <xsl:param name="sectionHeight" select="1060"/>
            <xsl:param name="boxHeight" select="990"/>
    
            <xsl:call-template name="zus-section">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="height" select="$sectionHeight"/>
                <xsl:with-param name="header" select="'Choroby współistniejące'"/>
                <xsl:with-param name="content">
                    <!-- Wspólne parametry -->
                    <xsl:variable name="boxWidth" select="$zus-param-page-width - 40 - 20"/>
                    <xsl:variable name="boxTop" select="0"/>
                    <xsl:variable name="chorobyNodes" select="//wnio:TrescDokumentu/wnio:ChorobyWspolistniejace/wnio:Choroba"/>
                    
                    <!-- Duże pole tekstowe z obsługą wielowierszowego tekstu -->
                    <xsl:variable name="boxStyles" select="concat(                     'border: 1px solid black; ',                     'background-color: white; ',                     'overflow: hidden; ',                     'top: ', $boxTop, 'px; ',                     'left: 0px; ',                     'display: block; ',                     'position: absolute; ',                     'width: ', $boxWidth, 'px; ',                     'height: ', $boxHeight, 'px; ',                     'color: black; ',                     'font-size: 16px; ',                     'text-align: left; ',                     'padding: 5px; ',                     'line-height: 1.4; ',                     'white-space: pre-wrap; ',                     'word-wrap: break-word;'                 )"/>
                    
                    <div class="multiline-box" style="{$boxStyles}">
                        <xsl:for-each select="$chorobyNodes">
                            <xsl:if test="position() &gt; 1">
                                <xsl:text>
    
    </xsl:text>
                            </xsl:if>
                            <xsl:value-of select="wnio:NumerStatystyczny"/>
                            <xsl:text> - </xsl:text>
                            <xsl:value-of select="wnio:Nazwa"/>
                        </xsl:for-each>
                    </div>
    
                    <!-- Mały label na dole -->
                    <xsl:call-template name="zus-text">
                        <xsl:with-param name="top" select="$boxTop + $boxHeight + 10"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="width" select="$boxWidth"/>
                        <xsl:with-param name="height" select="15"/>
                        <xsl:with-param name="line-height" select="15"/>
                        <xsl:with-param name="font-size" select="10"/>
                        <xsl:with-param name="text-align" select="'left'"/>
                        <xsl:with-param name="text" select="'Podaj wraz z numerami statystycznymi'"/>
                    </xsl:call-template>
    
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <!-- #region Strona 2 -->
        <xsl:template name="strona-2">
            <xsl:call-template name="zus-page">
                <xsl:with-param name="index" select="2"/>
                <xsl:with-param name="content">
    
                    <xsl:call-template name="p2-Adres-do-korespondencji">
                        <xsl:with-param name="top" select="0"/>
                    </xsl:call-template>
    
                    <xsl:call-template name="p2-Pozostale-informacje">
                        <xsl:with-param name="top" select="250"/>
                    </xsl:call-template>
    
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <!-- #region Strona 3 -->
        <xsl:template name="strona-3">
            <xsl:call-template name="zus-page">
                <xsl:with-param name="index" select="3"/>
                <xsl:with-param name="content">
    
                    <xsl:call-template name="p2-Rozpoznanie">
                        <xsl:with-param name="top" select="0"/>
                    </xsl:call-template>
    
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <!-- #region Strona 4 -->
        <xsl:template name="strona-4">
            <xsl:call-template name="zus-page">
                <xsl:with-param name="index" select="4"/>
                <xsl:with-param name="content">
    
                    <xsl:variable name="choroby_section_height" select="1060"/>
                    <xsl:variable name="rokowanie_gap" select="15"/>
    
                    <xsl:call-template name="p2-Choroby-wspolistniejace">
                        <xsl:with-param name="top" select="0"/>
                    </xsl:call-template>
    
                    <xsl:variable name="rokowanie_top" select="$choroby_section_height + $rokowanie_gap"/>
                    <xsl:call-template name="zus-text">
                        <xsl:with-param name="top" select="$rokowanie_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="width" select="$zus-param-page-width - 40"/>
                        <xsl:with-param name="height" select="25"/>
                        <xsl:with-param name="line-height" select="25"/>
                        <xsl:with-param name="font-size" select="14"/>
                        <xsl:with-param name="bold" select="'true'"/>
                        <xsl:with-param name="text-align" select="'left'"/>
                        <xsl:with-param name="text" select="'Pacjent rokuje odzyskanie zdolności do pracy po zakończeniu rehabilitacji.'"/>
                    </xsl:call-template>
    
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <!-- #region Strona 5 -->
        <xsl:template name="strona-5">
            <xsl:call-template name="zus-page">
                <xsl:with-param name="index" select="5"/>
                <xsl:with-param name="content">
    
                    <xsl:call-template name="p3-Dane-placowki">
                        <xsl:with-param name="top" select="0"/>
                    </xsl:call-template>
    
                    <!-- Tekst RODO na dole strony -->
                    <xsl:variable name="rodo_top" select="1050"/>
                    <xsl:variable name="rodo_width" select="$zus-param-page-width - 40"/>
                    
                    <!-- Linia oddzielająca (jak pod nagłówkami sekcji) -->
                    <xsl:call-template name="zus-content-block">
                        <xsl:with-param name="top" select="$rodo_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="width" select="$rodo_width"/>
                        <xsl:with-param name="height" select="1"/>
                        <xsl:with-param name="bg-border-bottom" select="'1px solid black'"/>
                        <xsl:with-param name="content"/>
                    </xsl:call-template>
    
                    <!-- Tekst RODO -->
                    <xsl:call-template name="zus-text">
                        <xsl:with-param name="top" select="$rodo_top + 10"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="width" select="$rodo_width"/>
                        <xsl:with-param name="height" select="50"/>
                        <xsl:with-param name="line-height" select="14"/>
                        <xsl:with-param name="font-size" select="10"/>
                        <xsl:with-param name="text-align" select="'left'"/>
                        <xsl:with-param name="text">Informacje, o których mowa w art. 13 ust. 1 i 2 Rozporządzenia Parlamentu Europejskiego i Rady (UE) 2016/679 z dnia 27 kwietnia 2016 r. w sprawie ochrony osób fizycznych w związku z przetwarzaniem danych osobowych i w sprawie swobodnego przepływu takich danych oraz uchylenia dyrektywy 95/46/WE (RODO), są dostępne w centrali lub terenowych jednostkach organizacyjnych ZUS oraz na stronie internetowej ZUS pod adresem: <a href="https://www.zus.pl/rodo">www.zus.pl/rodo</a>.</xsl:with-param>
                    </xsl:call-template>
    
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <xsl:template name="p3-Dane-placowki">
            <xsl:param name="top"/>
    
            <xsl:call-template name="zus-section">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="height" select="400"/>
                <xsl:with-param name="header" select="'Dane placówki, w której wystawiono wniosek'"/>
                <xsl:with-param name="content">
                    <!-- Wspólne parametry -->
                    <xsl:variable name="labelWidth" select="300"/>
                    <xsl:variable name="boxStart" select="$labelWidth + 10"/>
                    <xsl:variable name="boxEnd" select="$zus-param-page-width - 40 - 10"/>
                    <xsl:variable name="fullBoxWidth" select="$boxEnd - $boxStart"/>
                    <xsl:variable name="spacing" select="10"/>
                    
                    <!-- Row 1: Nazwa (podwójna wysokość) -->
                    <xsl:variable name="row1_top" select="0"/>
                    <xsl:call-template name="zus-content-block">
                        <xsl:with-param name="top" select="$row1_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="width" select="$zus-param-page-width - 40"/>
                        <xsl:with-param name="height" select="60"/>
                        <xsl:with-param name="content">
                            <!-- Etykieta Nazwa -->
                            <xsl:call-template name="zus-text">
                                <xsl:with-param name="top" select="0"/>
                                <xsl:with-param name="left" select="0"/>
                                <xsl:with-param name="width" select="$labelWidth"/>
                                <xsl:with-param name="height" select="50"/>
                                <xsl:with-param name="line-height" select="50"/>
                                <xsl:with-param name="font-size" select="12"/>
                                <xsl:with-param name="text-align" select="'right'"/>
                                <xsl:with-param name="text" select="'Nazwa'"/>
                            </xsl:call-template>
                            <!-- Pole Nazwa z podwójną wysokością -->
                            <xsl:call-template name="zus-forms-box">
                                <xsl:with-param name="top" select="0"/>
                                <xsl:with-param name="left" select="$boxStart"/>
                                <xsl:with-param name="width" select="$fullBoxWidth"/>
                                <xsl:with-param name="height" select="50"/>
                                <xsl:with-param name="txt-align" select="'left'"/>
                                <xsl:with-param name="txt-font-size" select="18"/>
                                <xsl:with-param name="txt-padding-left" select="5"/>
                                <xsl:with-param name="txt-padding-right" select="5"/>
                                <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:DanePlacowki/wnio:Nazwa"/>
                            </xsl:call-template>
                        </xsl:with-param>
                    </xsl:call-template>
    
                    <!-- Row 2: Kod pocztowy + Miejscowość (obok siebie) -->
                    <xsl:variable name="row2_top" select="70"/>
                    <xsl:variable name="field1_boxWidth" select="150"/>
                    <xsl:variable name="field1_end" select="$boxStart + $field1_boxWidth"/>
                    <xsl:variable name="label2_width" select="100"/>
                    <xsl:variable name="field2_boxWidth" select="$boxEnd - ($field1_end + $spacing + $label2_width + 10)"/>
    
                    <!-- Kod pocztowy (lewe pole) -->
                    <xsl:call-template name="zus-forms-element-textfield">
                        <xsl:with-param name="top" select="$row2_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="labelWidth" select="$labelWidth"/>
                        <xsl:with-param name="boxWidth" select="$field1_boxWidth"/>
                        <xsl:with-param name="title" select="'Kod pocztowy'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:DanePlacowki/wnio:KodPocztowy"/>
                    </xsl:call-template>
    
                    <!-- Miejscowość (prawe pole) -->
                    <xsl:variable name="field2_left" select="$field1_end + $spacing"/>
                    <xsl:call-template name="zus-content-block">
                        <xsl:with-param name="top" select="$row2_top"/>
                        <xsl:with-param name="left" select="$field2_left"/>
                        <xsl:with-param name="width" select="$label2_width + 10 + $field2_boxWidth"/>
                        <xsl:with-param name="height" select="30"/>
                        <xsl:with-param name="content">
                            <!-- Etykieta Miejscowość -->
                            <xsl:call-template name="zus-text">
                                <xsl:with-param name="top" select="0"/>
                                <xsl:with-param name="left" select="0"/>
                                <xsl:with-param name="width" select="$label2_width"/>
                                <xsl:with-param name="height" select="25"/>
                                <xsl:with-param name="line-height" select="25"/>
                                <xsl:with-param name="font-size" select="12"/>
                                <xsl:with-param name="text-align" select="'right'"/>
                                <xsl:with-param name="text" select="'Miejscowość'"/>
                            </xsl:call-template>
                            <!-- Pole Miejscowość -->
                            <xsl:variable name="miejscowoscFontSize">
                                <xsl:choose>
                                    <xsl:when test="string-length(normalize-space(//wnio:TrescDokumentu/wnio:DanePlacowki/wnio:Miejscowosc)) &gt; 28">12</xsl:when>
                                    <xsl:when test="string-length(normalize-space(//wnio:TrescDokumentu/wnio:DanePlacowki/wnio:Miejscowosc)) &gt; 22">14</xsl:when>
                                    <xsl:when test="string-length(normalize-space(//wnio:TrescDokumentu/wnio:DanePlacowki/wnio:Miejscowosc)) &gt; 16">16</xsl:when>
                                    <xsl:otherwise>18</xsl:otherwise>
                                </xsl:choose>
                            </xsl:variable>
                            <xsl:call-template name="zus-forms-box">
                                <xsl:with-param name="top" select="0"/>
                                <xsl:with-param name="left" select="$label2_width + 10"/>
                                <xsl:with-param name="width" select="$field2_boxWidth"/>
                                <xsl:with-param name="height" select="25"/>
                                <xsl:with-param name="txt-align" select="'left'"/>
                                <xsl:with-param name="txt-font-size" select="$miejscowoscFontSize"/>
                                <xsl:with-param name="txt-padding-left" select="5"/>
                                <xsl:with-param name="txt-padding-right" select="5"/>
                                <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:DanePlacowki/wnio:Miejscowosc"/>
                            </xsl:call-template>
                        </xsl:with-param>
                    </xsl:call-template>
    
                    <!-- Row 3: Ulica (pełna szerokość) -->
                    <xsl:variable name="row3_top" select="105"/>
                    <xsl:call-template name="zus-forms-element-textfield">
                        <xsl:with-param name="top" select="$row3_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="labelWidth" select="$labelWidth"/>
                        <xsl:with-param name="boxWidth" select="$fullBoxWidth"/>
                        <xsl:with-param name="title" select="'Ulica'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:DanePlacowki/wnio:Ulica"/>
                    </xsl:call-template>
    
                    <!-- Row 4: Numer domu + Numer lokalu (obok siebie) -->
                    <xsl:variable name="row4_top" select="140"/>
                    <xsl:variable name="field3_boxWidth" select="150"/>
                    <xsl:variable name="field3_end" select="$boxStart + $field3_boxWidth"/>
                    <xsl:variable name="label4_width" select="100"/>
                    <xsl:variable name="field4_boxWidth" select="$boxEnd - ($field3_end + $spacing + $label4_width + 10)"/>
    
                    <!-- Numer domu (lewe pole) -->
                    <xsl:call-template name="zus-forms-element-textfield">
                        <xsl:with-param name="top" select="$row4_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="labelWidth" select="$labelWidth"/>
                        <xsl:with-param name="boxWidth" select="$field3_boxWidth"/>
                        <xsl:with-param name="title" select="'Numer domu'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:DanePlacowki/wnio:NumerDomu"/>
                    </xsl:call-template>
    
                    <!-- Numer lokalu (prawe pole) -->
                    <xsl:variable name="field4_left" select="$field3_end + $spacing"/>
                    <xsl:call-template name="zus-content-block">
                        <xsl:with-param name="top" select="$row4_top"/>
                        <xsl:with-param name="left" select="$field4_left"/>
                        <xsl:with-param name="width" select="$label4_width + 10 + $field4_boxWidth"/>
                        <xsl:with-param name="height" select="30"/>
                        <xsl:with-param name="content">
                            <!-- Etykieta Numer lokalu -->
                            <xsl:call-template name="zus-text">
                                <xsl:with-param name="top" select="0"/>
                                <xsl:with-param name="left" select="0"/>
                                <xsl:with-param name="width" select="$label4_width"/>
                                <xsl:with-param name="height" select="25"/>
                                <xsl:with-param name="line-height" select="25"/>
                                <xsl:with-param name="font-size" select="12"/>
                                <xsl:with-param name="text-align" select="'right'"/>
                                <xsl:with-param name="text" select="'Numer lokalu'"/>
                            </xsl:call-template>
                            <!-- Pole Numer lokalu -->
                            <xsl:call-template name="zus-forms-box">
                                <xsl:with-param name="top" select="0"/>
                                <xsl:with-param name="left" select="$label4_width + 10"/>
                                <xsl:with-param name="width" select="$field4_boxWidth"/>
                                <xsl:with-param name="height" select="25"/>
                                <xsl:with-param name="txt-align" select="'left'"/>
                                <xsl:with-param name="txt-font-size" select="18"/>
                                <xsl:with-param name="txt-padding-left" select="5"/>
                                <xsl:with-param name="txt-padding-right" select="5"/>
                                <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:DanePlacowki/wnio:NumerLokalu"/>
                            </xsl:call-template>
                        </xsl:with-param>
                    </xsl:call-template>
    
                    <!-- Row 5: Nazwa państwa (pełna szerokość) z podpisem -->
                    <xsl:variable name="row5_top" select="175"/>
                    <xsl:call-template name="zus-forms-element-textfield">
                        <xsl:with-param name="top" select="$row5_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="labelWidth" select="$labelWidth"/>
                        <xsl:with-param name="boxWidth" select="$fullBoxWidth"/>
                        <xsl:with-param name="title" select="'Nazwa państwa'"/>
                        <xsl:with-param name="detail" select="'Podaj, jeśli adres jest inny niż polski'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:DanePlacowki/wnio:NazwaPanstwa"/>
                    </xsl:call-template>
    
                    <!-- Row 6: Numer telefonu -->
                    <xsl:variable name="row6_top" select="220"/>
                    <xsl:call-template name="zus-forms-element-textfield">
                        <xsl:with-param name="top" select="$row6_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="labelWidth" select="$labelWidth"/>
                        <xsl:with-param name="boxWidth" select="$fullBoxWidth"/>
                        <xsl:with-param name="title" select="'Numer telefonu'"/>
                        <xsl:with-param name="detail" select="'Podaj numer telefonu placówki - to ułatwi nam kontakt w sprawie'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:DanePlacowki/wnio:NumerTelefonu"/>
                    </xsl:call-template>
    
                    <!-- Row 7: Adres e-mail -->
                    <xsl:variable name="row7_top" select="265"/>
                    <xsl:call-template name="zus-forms-element-textfield">
                        <xsl:with-param name="top" select="$row7_top"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="labelWidth" select="$labelWidth"/>
                        <xsl:with-param name="boxWidth" select="$fullBoxWidth"/>
                        <xsl:with-param name="title" select="'Adres e-mail'"/>
                        <xsl:with-param name="detail" select="'Podaj adres e-mail placówki - to ułatwi nam kontakt w sprawie'"/>
                        <xsl:with-param name="node" select="//wnio:TrescDokumentu/wnio:DanePlacowki/wnio:AdresPocztyElektronicznej"/>
                    </xsl:call-template>
    
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <!-- #region ZUS-XSLT-COMMONS -->
        <!-- Wbudowane style pomocnicze -->
        <xsl:template name="zus-init-styles">
            <style type="text/css">
                * {
                box-sizing: border-box;
                }
    
                div {
                page-break-inside: avoid !important;
                }
    
                .dynamiczna-ramka {
                height:auto;
                min-height:20px;
                height:auto !important;
                height:25px;
                }
            </style>
            <xsl:if test="$zus-param-debug-borders = 1">
                <style type="text/css">
                    .ramki-pomocnicze {
                    border: 1px dotted red;
                    }
                </style>
            </xsl:if>
        </xsl:template>
    
        <!-- Pages template -->
        <xsl:template name="zus-page">
            <xsl:param name="index" select="''"/>
            <xsl:param name="break-after" select="'always'"/>
            <xsl:param name="content"/>
    
            <xsl:variable name="cssStyle" select="concat(             'background-color: ', 'white', ';',             'margin-top: ', '15px', ';',             'margin-left: ', 'auto', ';',             'margin-right: ', 'auto', ';',             'margin-bottom: ', '15px', ';',             'overflow: ', 'hidden', ';',             'width: ', $zus-param-page-width, 'px', ';',             'height: ', $zus-param-page-height, 'px', ';',             'page-break-after: ', $break-after, ';',             'position: ', 'relative', ';',             'text-align: ', 'left', ';',             'font-family: ', 'Arial', ';',             'box-sizing: border-box;'         )"/>
    
            <div style="{$cssStyle}" class="ramki-pomocnicze">
                <xsl:variable name="page-showLogo">
                    <xsl:choose>
                        <xsl:when test="$index = 1">
                            <xsl:value-of select="1"/>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:value-of select="0"/>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:variable>
    
                <xsl:variable name="page-contentHeight">
                    <xsl:choose>
                        <xsl:when test="$index = 1">
                            <xsl:value-of select="975"/>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:value-of select="1110"/>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:variable>
    
                <xsl:variable name="page-contentTop">
                    <xsl:choose>
                        <xsl:when test="$index = 1">
                            <xsl:value-of select="200"/>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:value-of select="65"/>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:variable>
    
                <xsl:call-template name="zus-logo-header">
                    <xsl:with-param name="showLogo" select="$page-showLogo"/>
                </xsl:call-template>
    
                <xsl:if test="$index = 1">
                    <xsl:call-template name="zus-logo-header-subtitle">
                        <xsl:with-param name="top" select="55"/>
                    </xsl:call-template>
                </xsl:if>
    
                <xsl:call-template name="zus-content-block">
                    <xsl:with-param name="top" select="$page-contentTop"/>
                    <xsl:with-param name="left" select="20"/>
    
                    <xsl:with-param name="height" select="$page-contentHeight"/>
                    <xsl:with-param name="width" select="$zus-param-page-width - 40"/>
    
                    <xsl:with-param name="content" select="$content"/>
                </xsl:call-template>
    
                <xsl:if test="$index != ''">
                    <div style="padding: 5px; border-top: 1px solid black; top: {$zus-param-page-height - 40}px; left: 0px; width: 100%; position: absolute; height: 30px; text-align: right; font-weight: bold;">
                        <span>Strona </span>
                        <span><xsl:value-of select="$index"/></span>
                        <xsl:if test="$zus-param-max-pages != 0">
                            <span> z </span>
                            <span><xsl:value-of select="$zus-param-max-pages"/></span>
                        </xsl:if>
                    </div>
                </xsl:if>
    
            </div>
        </xsl:template>
    
        <!-- Nagłówek dokumentów  -->
        <xsl:template name="zus-logo-header">
            <xsl:param name="showLogo" select="1"/>
            <xsl:param name="title" select="$zus-param-document-name"/>
    
            <xsl:variable name="bgCss">
                <xsl:choose>
                    <xsl:when test="$showLogo = 1">
                        <xsl:value-of select="'background-color: #FDF5A2;'"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="''"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <div style="top: 0px; left: 0px; width: {$zus-param-page-width}px; position: absolute;">
                <xsl:if test="$showLogo = 1">
                    <div>
                        <img style="position:absolute; top:0px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANIAAAAvCAYAAACWlZSFAAAAnnpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjabY7RDcMgDET/maIjnI1tYBzSFKkbZPyYgBoi9X3g4yydL3yObwuvDimCaMpWzOBIkcLVRcZAAaqgPv29kDombU8/KA/B2a14LzD9SO50vc3sGWQlJ8gSNLrc8Huu6P9fYdlaEmsaLRolmF5Bo4WfWdv8Wrm/XN1nS8Snz60HLYQTH8k/pZtNp+MAAAAJcEhZcwAALiMAAC4jAXilP3YAABoqSURBVHic7Z15nFTVsce/dW7PiiwCkoADagIqPKM+MRJFYLobxGhi4oLxE1eY6RkQxafPiHlREfe4oCAIPd0jLolJJPpMXF6U6Zlhc8e8YEQN8kRkUQRBEJnp6Xvr/dGz9fRyeyYDjIbf59Mf5nNO1am6Tdc959SpqiO4YQIW4/3/AAY2tyniypcMAdazITKYmTgJPWH/ApRJSdStoVJJoGpKQlvIdz/I1IxSlTMoi1Sl7Jt7Uh/yu12CmjOAYQjdE55NGv9WHGLRsUxZ9npGWe1FsPhULM8TlFYN6tRxD2Cfw+NKMc53Fsh3Eto6YkZxPJxsRCf3BrkYISc9mypO9KHkdjGIZOAD0FTaCkHvf2BZNwM9Ep4nNTV48h5l1skncM0rezLL28eo8N2AyMA0vcsIRH6TSO+dhJgROPb9lNe+12asAEaOpzQytU37ZMQcR+yrGUx5eQsh36+AHALVN2fWbeyViB7DHvtWptVuSOgLe69GzdGtWhpQfZ8GZxFTaz/JOG4XhHGlEJnWKZJUY4g8nNTuFEwCCjPzsozypW8n64a2W48ZeAj7n8CyZgE9suYTjqZntzvaLW9vQ+gHUpT44UxEykC7J9DOGZyHMXcjBLA8yTO5iB+kJKEt7CvFyEOormHKy1saCc9G5LyMej106sGI/hohQIEpTepXcwbIpa10HorIreR51hL2JdN3cWQ2pODo7yGM6SRZz1OyeFObNsGYcndWO8Vs1EEMHHs/yAUd4nWYRnCMt9N06QwEqqcRqDqz+SOxqxB6gC6mtHpBAm3hwHOB3ihPgl7ErJMLMo4d9HvBzAMqKIvMapdeOXkXAzk4PI3IJGak+K0Jn7foHvHzed1A1HkBTJAK7/h2ydvPyGxIludKkI4v5BLgVCQ1VfrGAYMz8+knOLueTt2l7ZuRQv5RoJn3VJkgGCzPw8wZkf1Mti8xo9iDWr8F6pG6y5JmbLXKQF4j2jAT6EmPwvPTjrVg9BCM/BHVJXxsX5GWrqJ4LJXFY5PaRQIY/oLaD4AM5FD/Ga76T1+xC+eLS1G2YswMV/ouhPSGNOvk3qi5sHPE6EdsqPlLUrMjk91ZeZjylQ2doobo9f/8i0EOp/Cg+ztDnU5HkTUT4fvYBChZkTj7P+Q9CtHRqC5k6tJ3UV5DKUseRA1h3wSsnOdAN+PIBGbWxpLJ6EvIvxTjeRbbyk/oq/CdAhyDIwspr10OugYjgayeoXzlV4hTBXKS64zZhZDekLrnlyAue5dsoVQmORkqRw5A+JELp03MDmUYN/sZKTi8J8i4rOkzYyJh3487aazOwQLfaESmo4QojzyT1J8rpSB7cHb8obFlIcLJzC8+pg2lB6QCYQgia6mq+jKhN+Q9B+FwhN7Au5jokZRFnkugiRvNZ2zYFG9XHkH1DOb7Ds3qWZRtgMXBeT2zou8CSG1IE7AQc3mnSFBixDSFkyG3BFw8bsqLTKldl7bfSDuWdr1OcJWXCBuIAlGUeqAOtA7RPSh1qMxmYXGvdoy397CwuBceeQxlDc6Oq5P6nxyWC+ZS0Heh52kEfRMQjb/Ycq02M4VEKY0cDFwNnMVp/jubu4LFfRFrIYgH+AeBSDmTln6cwH5/cS9UzgfeYcC3fxKX5exBxINHEo840kKKgCjRXduy/g72M1K7vxdhc4Y91JXbkStR6+7MRPo8U6o3JjTNwCCmJA1DK1Y76EqTLYQBWVIqONdhOXOZWFvf0taFEbMWINIfxzmZ8pVfJfXv6H8OhkNQtmNJy95D+QzkIhYWT2dibV0CT2lkNiH/MQjXEva9QWn1IjZt2ckh/b9DHi8i5LcVA0ChuQjRAqBfiywBdBtCCTO4PWl10hoh/7eAcaCLO21Jvw+Q/hyp7RebCmH/Za40jpO8NCvyng5ymAvnx/Sqed51/GxhHAUrG8p3KK2+t9Pk7m2Eiy8FzkeZTnn1WylphACi6yiJHJ3ggAj5xwEvYZsJwONJfBs2T2Vg/6NQeZgK72rKat6B1dsI+dPrYySA8r8EIick6um/AOR3DPKNh+r/Sclb4f03YCFgEXN+lfnBuxbcD2TTIewbDTIsI42ynk01Kb40M9F1fHUqOR/bZfzsYyxsXZ+dHWlWVF0ClSO7o545gIBeRXjslW0o7icWfQ6RYmy9LcmLtyESoci/Pn7mlMKQZq6OMr/XeXgKXkfM0wSHn0T5yi/inXI0Yf/2BHrb/jEix+KQfPZo2c8Q82zHkTKg6TfRj/DY9Y1/54P2BT4kpqczueZv7fw29is6bkgqZe4/Yg0nTeNzBuch/NCFMQZOZRZKkHWYxe76lfTw7Aa6uVAeTch7BoGaF7IbeD8iZ5dDNC/+5hZIsQJ9HSunANVpRPl9Ev9MHIL2hWCOJzg8B3UWgrUkgWbKy1uoOPU0TO5paPchwJtg3wPmkKTxDDEcnUqD/VhS38TaOir854MOBgSHeVjOn5r7RaLYzvv06ruc8xdlfoF2QXTMFfzoSX1o6L4BJPU6GRqdDM7hSfujsHckWMszjq/6LIHIWa56hH33gLnWZazTCEQWN9JXgHF3w6qux9lxbMvbdy/hQKzdNwbuIUKpEO1+WUYjAhBeSDKiuMjjspDw2w7p5YZ65yZQd0+QyCCsng/uFR0O4BuJjhmSkMXhmp0cyQCgHJ6ZTxUrWp2VHul9P6kxtfYTHOdyyCYiQi4i6JvQTgkH8C+K9htSpd8LclRGGmU9H6dyMgBCHxfebUxa9llWukh7zpEaUVbzJOjvshkcS+YTHNW/3TIO4JuBkP92Qv4VhMYWu5G235Ac3INMRZMjGZqg5Lpwf95undqLaPQK0A3uhNIHk5t8mHwA33wE/eXA1agzi0BVrRt5+wxp/in9EPlpRholhtqZfnz1Gfpwzy/qBFy+fHtjIqH74lDkdCr8nRPlcQCdhU4KpE4DRTC6E/gBZTVPZcPSPvd3TsFlQF5GGuEFSmvTv+1Ft2b8HlQHMAMPM0kOlOxMBCKLCY99CEgf2dwEw91UnFpF2fJ/7FWdOoIK39mIPABcRCCyLKEv5H8WtJBAdfwENez/G0o8rElQlM+BKjz2HUys3dFI8wLKv6WQdDeByDzC/jdQ+qXURZnN9roQvfP/3twmxFDWYJwQJY0/yrB/AeCjNHJkXE/fwyCpTnkfJRC5CYBK73GouREoRumByAbU+QOm/g7Wb6+nqP+atN+R6LXEGt7Byk293XDs4WB9D0MlduxCZMkrUN2y/K/0no9j7sHZMTRl5AjtMySBLCJ4HU0fZArgsC7jPCiSx6H+f4fIG+3QrWOwt0/H6jXOdc+HdMPkP8aTjHQ9JN7XEOmGyCBUU3lRv4VI63OzQ4GNiMwGxyAyFOQqbHMCEE+FUL6FkIsjiUmMYr/a+Md8tM1ZnOF6lD6IVlEQE0QGARHgCdB80HNRs4iQdzKBmgqgL0pRq2foi3IIKtMT1bdXARD0noljnkL4DHQ+IptR5xhErkTz97B69e0cOqBNNIrmYJgJ1GM3LCfH0w+VQTj6DEgbZ9aur5Ce+Yg5AsuziNCI4QRe+7S522n8jmPd0/5yszekkH8srrlDrGdxJLXVt2BVFtLOA/a+IZWv/Ir5vkvIYXkWAa0j2On/FURu2et67U2IfExpVcvSO+Tvh5ifM2dwHtM+aFp2f05ZVWr3f2tegFBxCXgGIFxDaWRVc66Ww7uUNdJOIMj4se+BuQJI7c0V6gmkkDlnRA+MeQQjH6K7R1L6SsseunLkbez+dBuLsFnUhjfsuxWkG45eQvmyzVR6+zXKWZ5SToWvSY9+cNDvmcG49qyK2rNHSpG70hZaySKXN3bd+pVAyumxlValWUVWa8p6DO3DlOrXUckuhVy5gQXFJ/7TMrsShINQ3cy0D6Lt5l0weghYDwAvUVr1QFq6+G/iI6B3u2UUdDsXkb7Y9owEIwIoWbGplfG3IOQfBXI9SJiy6v9un0BnBjCGQf672sOV3Yw0r/jbiLhFGrg5GeKY9kE94cNqQM5MTyS9iZlZQOaw+46dgiVjQ+w2iqwzEPl+RjqRHCzP412yCEq2UL5LhfeXiBjgBGAYhgkkxhf1I+Rviep3nCWUtwkgLhueg5XzW6AOu/4yUsQnNWOB9zjgZODFDJrlJ8hE/0qg+ncgxwNgy4psHo/g2J6IPg6sZfuW5JQS4UeNEeZxxPbc21KLAhqXkAcD1xL2vUZp9aJsxGb3U8yzJoKr2/oFAhmcDK0RSxH31RYilxH2uYT/dFIa/MzaGI59CW4zJcSLoHQv+HWnyN0/6ImYE0COR6Qv0AeHtnUo8hE5rvljSfJZ2om9ZiKcCFJK+bLNSf3CuYTHLifsfwvLvAl8iiHT/6eVIFNoDJvS+JK7oSG7GVN0AUh/1LmQX6zanYKif4KcvIOSnWc9I78EakEqCY12TycimxlJEcIScHU4ujkZWmOz/UeKPPfF16PpIALcTdh3GDv3XJdyBpBOdIOW175Hhe96jJnjSitmKiHfMwSqs4vA2KuwG8ADmsKbKuQCDW3a3qI00hKxUeG9BmPdR3DsUsqrmmIg11Nalb74SIV3DEauQwkSqPpTaiLdgFAdl693svOr51xm8d0pZQr/B0BBzveAzN932HcxyAU4zvWU1axMrRYhAlX3ZRznfGzm77kAT8FKyH0a1QVuvzT3GanSPx7hCBeqj7NwMrRgZm0d6mRRlUYEzBX06PY+Yf9VzD8l0fBUO2txF0dZ9VxUF2dBaUC6Rt0G234bVDEkFiCpHDkAZChIZueO8F7jv9klPj506sEY05iNu/0/09KpvEZJ5CZKIrdSWr2ow0vhWOxPgI0wPSlp5kksJjQmxzx06nfAzAWtYWP1PR2S1RpTXt4C9gSEIxBucCPPZkbKIl3C2cR473VkU0DJtp+jfOnb5DizsaUsqfhkagwEeYCcwvsI+d4FViNmC8qprpymXdmtSkwnkiOrcNsYixxLyOfb77PS5GWrCfn+B2QqFb6t2LHnyfV8G0fuQFRQZ3YigxYyr3gweUDMDAC5GdhNTmxpCwl5jUl2rdj0U8prt5KTuwAYiDqXIj2OoKLVqjDWsIlYQ8eOBxQrWWbsc8qXriHkn4WYXxD2PUdQ7kXYiDiD2WluYDyrmBCZys6836DkYdt3c6h3aIJvMD9nHQ2NE7Pot5PkbKx5P6VOgdpXCXuvQax5bupnNqTKkQNQ1wIlgBkBjHCn0waIPQLE81NCvgAiL5Fl6ipgIeYYIF6wY2+cb0+p3kjIezViPZoF9Xm4LTf2BRzzcyytBDOTnNxbG18dG3Hs85KXOOIlzxM/vPSogryHOmcxsVV1U5HvItbfE/n0v6jw/hkx8RJeRpJzjjwyhVjDEx16BpHuSTLVzAOuIBCZTmjs54hMx2o6AzKK8go0zGaH/4cYOTleEdeTvDKqc07HovH5zLVJe7V+xenjKUtrHiLkH4HIJZnUz2xImjepnQVD3PDnhI1poLqasP8WkJmdKOOfR6DmMUL+ckROyUgnjNpHGmVGedUXwHk8OHIAeblDUNnFJmdVUhmtaP1J5HpalsNq7SJQ9WkCjdXwUxyTvN+KxrYR++QrCouGpNVDd33GlSt3UVk8hDo7fS6XZV9B1LQc6trRcizrmhR0TWMogaq7mDP4fgoGHoMt3YjxEVdUfwTAY8euJ9o7k16b6L4nxs5+qWkOqf2M7cOXQPch6K6Pkvp7Riaxs/hWLq/dTZqqiOnf6TMwFPk/bDyl7hzYznjKq19Kas824a4jEB1HSZoi+plQ4T0LY6XZSDcjyotVha5nZ+lwILHvG4P0m/WB3h92qhGhaymrTr2RL60uB52VXZ7QPsLGT/+CurrDczltRN99os8BdGmkNySVLGpytwOq4QxF75XSyH+CcxHojk6V21HMXB1tdr1mQqzga1MN9AD2HlIbUqi4CMStQEl7EAVZ6EpVWvMEdnQYwkJU9270dzZQdd8fxrI8KDyAbzTSzEimFJGOVxhKgv6JQORTdzqgfNlmSqomYTgK1XtQTVH3YR/g1yO7A5ld84rD1u1b941CB9CVkcZY5AeovtNpUtRx9cMnoSTyf8B1wHTCY49HdRRGjkd1MEh/hB6o5qIiSNu9lbRUBVe7YzNb77zzXJMMRdczc3XXmJHCvsNwnCE48hmTa1bRFPtWOXIADSYeAGyJEottS4gta43g8BxMj2NRczA4mymrWd08ThPmFR+EZQ8iGt3AtNd2JvTNGJZL/z6pMwTkqzUJlVODo/pD7tHxEl47VjVXbAoW90Xt1BEvOR6bkpr3qRw5ACdmJ6Q6NGHuKYdR6HGYuHQDwVFDaXB2cOWKttcJQdD3XQDKq9e2tI0chMkbjFLHF1v/1hxiNGdED3Jzi7Ct9UytTayF3vj9pjakQOT0lO37B0pp1V+Bv+4zicHhhSDulT6FN/eBNpkRv5o0DHIJxhgMEPa/jzacTWDpu2jeXXjMxc30OTlK2L8KtScTqH21uT3ouwLL3AQcEvflWhDyr0X0akqrn23hpxiT9yyenPOBxIDOQ3sfjslL/QK2rCOAdTw8eiBOzvzGrUN8RWR61VPhX0DdR9MxVhniuT3lGA4bgSI07y4o+BFB3/cTDAEgryCEQx3CWYRz7sQjXoKjjko4dgl7/SCLUb0RuJ1g8dEYE0RkFEg88KzXIV9S4Z/F4sgt5BeejrH+gMc5C3g2QV7j99u5ITbfBMwo9mB6PYrId11plfa71Tsb43yTgEtRLcOOHYLERgF/h5xWKQeqNDhFaGwgOOOAQsTzfHPuUIV/JpZ5EHWWEXPGYDuDUftMhC2oeYaQP/PtfEnQ2VhyZMJnHRsIFvfFyVkGjATnKuzYUGyORbgjfqFdnzwa6ucn8eLMJV6T/cZmEcLBWPIUT2a4+kVj/wFiYeW2XAQwAQs196OsYc/6e1lYfDiWtQyRI3GcUhw9igZOAOZj8DFsWFbBAp24D/oGIOQdDtZshJFZUEcx0dQXoO1LiIwAPicQaapMu7zxk4iWGoMbCPlvQXicgsJTCfreR/gv4GkC1ee24ljLwuJqYtabCHOZcfhzzFyXXA9+/in9kpaKyjYmLk5O/Q75bwQGIfgpqa5p1fM20DphsqUUckXx8YgngOgfCVS3cljpNmAYXxRWABeTCoGlHxLy3gXWzVSMmUfZkjcY5wsgHIPo6Y0pPXcBPbFlOOU1ra9XbVkBVXwraei2SDSksK8U5OuRuNaxm9VTQ/SgxryXoWQdeOT8IeuyYXsTqmsQ04eQfy71e+7hipeTT+bbQlRAmq7FmYCIB40lB3pOrK0j7H8QZAGDvuOFdS3hN8qhVPgeROQc4insWUAmACspqapxJQWYdXIBYj2BsIVofeJxjLIO1d9jzD2E/K8SiKTeh+/5+G4KD78Yybmf4PAzEZkJPE1J9UvMGJYL/AThRcqrku8obgdaDCm+L7gHpGvc+eOGTo2za/dgddh0jbCmL7bOpdchXoTLyS+cQnjsK9j2nUmJeL8e2Z2CmJDf7RiQG1DditQvR/LPAcA0pN7bxPRdPAK2iTsRLHrGS67LLIRXUU01G0wl5G9VXLPhZ2zY/RFC/yyj6+PoXjALkSPR2FguX55YsF+AQPW9jXFws1gw5i0mL3klaYxpH9QTLpoG1gtYPZ8CKaQ+Gk/4K+p7KEg+qquz0kfN3YT8v0xslMHQ2v1tev7sa2NE+xuqdyRtcvcXfrFqN4HI6dh6InAn6BFY1p8JeVvd2SpCn4KdFHb/AmNWoOKA/WNKVuwifpkaxHJSV4cyTjyh02iUkH8qjvVIY8+vKI2ckjL6XXgLkYXNn1j+NtgTQ3Fwq0LVhArvWYiUo849BGpr09J9XjcJ1bV4PE8SGpF6DVZa+xeUZ8D4Ued2pjZdjmaavIjZ6YRGMLIw4aO6FlrPSJLN7eIHgLKEDfad7oT7GPG7kd5izqjZFOStQ6yfAo03aqiCMwpHFCf2GZOXfkCTW1t5CwHEjAKS6xuIiaeqOLyF6GDgtnjqhX6QVhflFQJVyfla4f7voYzkSayM1ZiCo/pjrDCib2J/cVPG556+YhfB4nOwrNfhoN+TvlZhBDgbY7U4iAK1Gwn5t4KMySijCaIvUhJJ9NqFfaNAfhCfkSqKjwc9KavB/pWh+g65em7Ky4n3FxaMGha/H7cR3a1diDpom1Cr0poVlFW/zOSla2h9NrTny0UoWzByO3P9ieWk540eishVqL5OWeQNAtW/Q53UmafZQHkYkSJ2+JONI1jclFsmmLyFoAXYXJTVrX3lte+h9qS454/R7dIofpfu8QR9U9r0SfzmlOwQn5HEU87erl75tYcux7HP5tLarnWvqSf3aTS3GyH/fIx+RkwuQPBg80hW/NNe20lF8YWI5xny9e+E/L9F2YThSJQLQXaidcn7IIcJhHwtF83FWAbReM0O4RQq/YlpEbEdlTg75mB6nY7hRkL+U1B9ESMGZTwiY6goPhFjjQHGo7oES35EZau6kco2SiOp88QCtX8k7LsPMde266bSqH0LeZYXS+YR8o9HZAmOnY+Rn4A5juDYo8giuN8wr/ggRH+eveR/OexGnRv42PZSXtv1woHE+QmiSxGm4cgshFyU05gciW+glS0gmfdzZbVVRO3hwIsIP8NwC4gf0RANX/17QoVZy9qN6lpETgC5uPmTY45DTAOqa1GG4HB5wsd07075ygacHWfg6HUI/TByM8h1CFFwfJTV/i/KqfF9hxQljQE/a34mJbnQTo/q60GfAv0kqQ++QHUtMU0s3zW19kvsHWNQnQlyFMptGOtqHNmMcUZSXrUe4cvG50oupqJsQXWtUOELYEzqon3/2vgQ9HGUh7KOE2wvDuQjfWPgQaSUbOauJmRzftPhRWInFHxMi6bSXaogDvHqNnUgu4BtwCbUWYvyNo6saH6j702IcVD9etbHO4AE/D8WEG8SgvPNYAAAAABJRU5ErkJggg=="/>
                    </div>
                </xsl:if>
                <div style="color: black; {$bgCss} top: 0px; right: 0px; font-weight: bold; width: 600px; font-size: 30px; position: absolute; height: 55px; text-align: right; ">
                    <xsl:value-of select="$title"/> 
                </div>
                <div style="border-top: 1px solid black; top: 55px; left: 0px; width: 100%; position: absolute; height: 1px; ">
                    <span/>
                </div>
            </div>
        </xsl:template>
    
        <!-- Tytuł główny dokumentu -->
        <xsl:template name="zus-logo-header-subtitle">
            <xsl:param name="top"/>
            <xsl:param name="title" select="$zus-param-document-title"/>
    
            <xsl:variable name="title1" select="normalize-space(substring-before(concat($title, ';'), ';'))"/>
            <xsl:variable name="remaining1" select="substring-after(concat($title, ';'), ';')"/>
    
            <xsl:variable name="title2" select="normalize-space(substring-before(concat($remaining1, ';'), ';'))"/>
            <xsl:variable name="remaining2" select="substring-after(concat($remaining1, ';'), ';')"/>
    
            <xsl:variable name="title3" select="normalize-space(substring-before(concat($remaining2, ';'), ';'))"/>
            <xsl:variable name="remaining3" select="substring-after(concat($remaining2, ';'), ';')"/>
    
            <xsl:variable name="title4" select="normalize-space(substring-before(concat($remaining3, ';'), ';'))"/>
            <xsl:variable name="remaining4" select="substring-after(concat($remaining3, ';'), ';')"/>
    
            <xsl:variable name="title5" select="normalize-space(substring-before(concat($remaining4, ';'), ';'))"/>
            <xsl:variable name="remaining5" select="substring-after(concat($remaining4, ';'), ';')"/>
    
            <xsl:variable name="title6" select="normalize-space(substring-before(concat($remaining5, ';'), ';'))"/>
            <xsl:variable name="remaining6" select="substring-after(concat($remaining5, ';'), ';')"/>
    
            <xsl:variable name="title7" select="normalize-space(substring-before(concat($remaining6, ';'), ';'))"/>
            <xsl:variable name="remaining7" select="substring-after(concat($remaining6, ';'), ';')"/>
    
            <xsl:variable name="title8" select="normalize-space(substring-before(concat($remaining7, ';'), ';'))"/>
            <xsl:variable name="remaining8" select="substring-after(concat($remaining7, ';'), ';')"/>
    
            <xsl:variable name="lineCount">
                <xsl:choose>
                    <xsl:when test="$title8 != ''">8</xsl:when>
                    <xsl:when test="$title7 != ''">7</xsl:when>
                    <xsl:when test="$title6 != ''">6</xsl:when>
                    <xsl:when test="$title5 != ''">5</xsl:when>
                    <xsl:when test="$title4 != ''">4</xsl:when>
                    <xsl:when test="$title3 != ''">3</xsl:when>
                    <xsl:when test="$title2 != ''">2</xsl:when>
                    <xsl:otherwise>1</xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="adjustedHeight">
                <xsl:choose>
                    <xsl:when test="$lineCount = 1">
                        <xsl:value-of select="18"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="18 * $lineCount"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <div style="color: black; padding-top:15px; top: {$top}px; left: 0px; font-weight: bold; width: 100%; font-size: 16px; position: absolute; text-align: center; height: {$adjustedHeight}px;">
                <xsl:if test="$title1 != ''">
                    <xsl:value-of select="$title1"/>
                </xsl:if>
                <xsl:if test="$title2 != ''">
                    <br/>
                    <xsl:value-of select="$title2"/>
                </xsl:if>
                <xsl:if test="$title3 != ''">
                    <br/>
                    <xsl:value-of select="$title3"/>
                </xsl:if>
                <xsl:if test="$title4 != ''">
                    <br/>
                    <xsl:value-of select="$title4"/>
                </xsl:if>
                <xsl:if test="$title5 != ''">
                    <br/>
                    <xsl:value-of select="$title5"/>
                </xsl:if>
                <xsl:if test="$title6 != ''">
                    <br/>
                    <xsl:value-of select="$title6"/>
                </xsl:if>
                <xsl:if test="$title7 != ''">
                    <br/>
                    <xsl:value-of select="$title7"/>
                </xsl:if>
                <xsl:if test="$title8 != ''">
                    <br/>
                    <xsl:value-of select="$title8"/>
                </xsl:if>
            </div>
        </xsl:template>
    
        <!-- Blok zawartości sekcji -->
        <xsl:template name="zus-content-block">
            <xsl:param name="top" select="0"/>
            <xsl:param name="left" select="0"/>
    
            <xsl:param name="height" select="0"/>
            <xsl:param name="width" select="880"/>
    
            <xsl:param name="bg-color" select="''"/>
            <xsl:param name="bg-border" select="''"/>
            <xsl:param name="bg-border-top" select="''"/>
            <xsl:param name="bg-border-right" select="''"/>
            <xsl:param name="bg-border-bottom" select="''"/>
            <xsl:param name="bg-border-left" select="''"/>
    
            <xsl:param name="content"/>
    
            <xsl:variable name="heightCss">
                <xsl:choose>
                    <xsl:when test="$height = 0">
                        <xsl:value-of select="''"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="concat('height: ', $height, 'px;')"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="leftCss">
                <xsl:choose>
                    <xsl:when test="$left = 0">
                        <xsl:value-of select="''"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="concat('left: ', $left, 'px;')"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="backgroundCss">
                <xsl:choose>
                    <xsl:when test="$bg-color = ''">
                        <xsl:value-of select="''"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="concat('background-color: ', $bg-color, ';')"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="borderCss">
                <xsl:value-of select="''"/>
                <xsl:if test="$bg-border != ''">
                    <xsl:value-of select="concat('border: ', $bg-border, '; ')"/>
                </xsl:if>
                <xsl:if test="$bg-border-top != ''">
                    <xsl:value-of select="concat('border-top: ', $bg-border-top, '; ')"/>
                </xsl:if>
                <xsl:if test="$bg-border-right != ''">
                    <xsl:value-of select="concat('border-right: ', $bg-border-right, '; ')"/>
                </xsl:if>
                <xsl:if test="$bg-border-bottom != ''">
                    <xsl:value-of select="concat('border-bottom: ', $bg-border-bottom, '; ')"/>
                </xsl:if>
                <xsl:if test="$bg-border-left != ''">
                    <xsl:value-of select="concat('border-left: ', $bg-border-left, '; ')"/>
                </xsl:if>
            </xsl:variable>
    
            <div style="width: {$width}px; position: absolute; top: {$top}px; {$heightCss} margin-right: auto; text-align: left; {$leftCss} {$borderCss} {$backgroundCss}" class="ramki-pomocnicze">
                <xsl:copy-of select="$content"/>
            </div>
        </xsl:template>
    
        <!-- Budulec pól formularza (box) -->
        <xsl:template name="zus-forms-box">
            <xsl:param name="node"/>
    
            <xsl:param name="top"/>
            <xsl:param name="left" select="0"/>
            <xsl:param name="height" select="25"/>
            <xsl:param name="width" select="100"/>
    
            <xsl:param name="txt-color" select="'black'"/>
            <xsl:param name="txt-font-size" select="18"/>
    
            <xsl:param name="txt-padding-top" select="''"/>
            <xsl:param name="txt-padding-right" select="''"/>
            <xsl:param name="txt-padding-bottom" select="''"/>
            <xsl:param name="txt-padding-left" select="''"/>
    
            <xsl:param name="txt-align" select="'center'"/>
            <xsl:param name="txt-overflow" select="'hidden'"/>
    
            <xsl:param name="bg-color" select="'white'"/>
            <xsl:param name="bg-border" select="'1px solid black'"/>
            <xsl:param name="bg-border-top" select="''"/>
            <xsl:param name="bg-border-right" select="''"/>
            <xsl:param name="bg-border-bottom" select="''"/>
            <xsl:param name="bg-border-left" select="''"/>
    
            <xsl:param name="txt-line-height" select="$height"/>
    
            <xsl:variable name="borderStyles">
                <xsl:value-of select="concat('border: ', $bg-border, '; ')"/>
                <xsl:if test="$bg-border-top != ''">
                    <xsl:value-of select="concat('border-top: ', $bg-border-top, '; ')"/>
                </xsl:if>
                <xsl:if test="$bg-border-right != ''">
                    <xsl:value-of select="concat('border-right: ', $bg-border-right, '; ')"/>
                </xsl:if>
                <xsl:if test="$bg-border-bottom != ''">
                    <xsl:value-of select="concat('border-bottom: ', $bg-border-bottom, '; ')"/>
                </xsl:if>
                <xsl:if test="$bg-border-left != ''">
                    <xsl:value-of select="concat('border-left: ', $bg-border-left, '; ')"/>
                </xsl:if>
            </xsl:variable>
    
            <xsl:variable name="backgroundStyles">
                <xsl:value-of select="concat($borderStyles,                                          'background-color: ', $bg-color, '; ',                                          'overflow: ', $txt-overflow, '; ',                                          'top: ', $top, 'px; ',                                          'left: ', $left, 'px; ',                                          'display: block; ',                                          'position: absolute; ',                                          'width: ', $width, 'px; ',                                          'height: ', $height, 'px;')"/>
            </xsl:variable>
    
            <xsl:variable name="paddingStyles">
                <xsl:if test="$txt-padding-top != ''">
                    <xsl:value-of select="concat('padding-top: ', $txt-padding-top, 'px; ')"/>
                </xsl:if>
                <xsl:if test="$txt-padding-right != ''">
                    <xsl:value-of select="concat('padding-right: ', $txt-padding-right, 'px; ')"/>
                </xsl:if>
                <xsl:if test="$txt-padding-bottom != ''">
                    <xsl:value-of select="concat('padding-bottom: ', $txt-padding-bottom, 'px; ')"/>
                </xsl:if>
                <xsl:if test="$txt-padding-left != ''">
                    <xsl:value-of select="concat('padding-left: ', $txt-padding-left, 'px; ')"/>
                </xsl:if>
            </xsl:variable>
    
            <xsl:variable name="textStyles">
                <xsl:value-of select="concat('color: ', $txt-color, '; ',                                          'font-size: ', $txt-font-size, 'px; ',                                          'text-align: ', $txt-align, '; ',                                          $paddingStyles,                                          'line-height: ', $txt-line-height, 'px; ',                                          'display: block;')"/>
            </xsl:variable>
    
            <xsl:variable name="allStyles">
                <xsl:value-of select="concat($backgroundStyles, $textStyles)"/>
            </xsl:variable>
    
            <div style="{$allStyles}">
                <xsl:value-of select="$node"/>
            </div>
        </xsl:template>
    
        <!-- Budulec pól formularza (pola literowane) -->
        <xsl:template name="zus-forms-box-split">
            <xsl:param name="top" select="0"/>
            <xsl:param name="left" select="0"/>
            <xsl:param name="node"/>
    
            <xsl:param name="split-pattern" select="'xLxxxLxxxLxxxLxxxLxxxLxxxL'"/>
    
            <xsl:param name="index" select="1"/>
            <xsl:param name="pattern-index" select="1"/>
    
            <xsl:variable name="string-length" select="string-length($node)"/>
            <xsl:variable name="pattern-length" select="string-length($split-pattern)"/>
    
            <xsl:if test="$pattern-index &lt;= $pattern-length">
                <xsl:variable name="char">
                    <xsl:choose>
                        <xsl:when test="$index &lt;= $string-length">
                            <xsl:value-of select="substring($node, $index, 1)"/>
                        </xsl:when>
                        <xsl:otherwise> </xsl:otherwise>
                    </xsl:choose>
                </xsl:variable>
    
                <xsl:variable name="pattern-char" select="substring($split-pattern, $pattern-index, 1)"/>
    
                <xsl:variable name="text-border">
                    <xsl:choose>
                        <xsl:when test="$pattern-char = 'x'">
                            <xsl:value-of select="'1px solid black'"/>
                        </xsl:when>
                        <xsl:when test="$pattern-char = 'L'">
                            <xsl:value-of select="'2px solid black'"/>
                        </xsl:when>
                    </xsl:choose>
                </xsl:variable>
    
                <xsl:variable name="text-left">
                    <xsl:choose>
                        <xsl:when test="$pattern-char = 'x'">
                            <xsl:value-of select="$left + 24"/>
                        </xsl:when>
                        <xsl:when test="$pattern-char = 'L'">
                            <xsl:value-of select="$left + 25"/>
                        </xsl:when>
                    </xsl:choose>
                </xsl:variable>
    
                <xsl:variable name="is-first">
                    <xsl:choose>
                        <xsl:when test="$index = 1">
                            <xsl:value-of select="'1px solid black'"/>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:value-of select="'none'"/>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:variable>
    
                <xsl:variable name="is-last">
                    <xsl:choose>
                        <xsl:when test="$index = $string-length">
                            <xsl:value-of select="'black'"/>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:value-of select="'black'"/>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:variable>
    
                <xsl:call-template name="zus-forms-box">
                    <xsl:with-param name="top" select="$top"/>
                    <xsl:with-param name="left" select="$left"/>
    
                    <xsl:with-param name="width" select="25"/>
    
                    <xsl:with-param name="txt-color" select="$is-last"/>
    
    
                    <xsl:with-param name="bg-border-right" select="$text-border"/>
    
    
                    <xsl:with-param name="node" select="$char"/>
                </xsl:call-template>
    
                <div style="box-sizing: content-box;">
                    <xsl:call-template name="zus-forms-box-split">
                        <xsl:with-param name="node" select="$node"/>
                        <xsl:with-param name="split-pattern" select="$split-pattern"/>
                        <xsl:with-param name="index" select="$index + 1"/>
                        <xsl:with-param name="pattern-index" select="$pattern-index + 1"/>
                        <xsl:with-param name="top" select="$top"/>
                        <xsl:with-param name="left" select="$text-left"/>
                    </xsl:call-template>
                </div>
            </xsl:if>
        </xsl:template>
    
        <!-- Element formularza -->
        <xsl:template name="zus-forms-element-checkbox">
            <xsl:param name="top"/>
            <xsl:param name="left" select="0"/>
            <xsl:param name="width" select="250"/>
    
            <xsl:param name="title"/>
            <xsl:param name="node"/>
    
            <xsl:variable name="title1" select="normalize-space(substring-before(concat($title, ';'), ';'))"/>
            <xsl:variable name="remaining1" select="substring-after(concat($title, ';'), ';')"/>
    
            <xsl:variable name="title2" select="normalize-space(substring-before(concat($remaining1, ';'), ';'))"/>
            <xsl:variable name="remaining2" select="substring-after(concat($remaining1, ';'), ';')"/>
    
            <xsl:variable name="title3" select="normalize-space(substring-before(concat($remaining2, ';'), ';'))"/>
            <xsl:variable name="remaining3" select="substring-after(concat($remaining2, ';'), ';')"/>
    
            <xsl:variable name="title4" select="normalize-space(substring-before(concat($remaining3, ';'), ';'))"/>
    
            <xsl:variable name="lineCount">
                <xsl:choose>
                    <xsl:when test="$title4 != ''">4</xsl:when>
                    <xsl:when test="$title3 != ''">3</xsl:when>
                    <xsl:when test="$title2 != ''">2</xsl:when>
                    <xsl:otherwise>1</xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="adjustedTop">
                <xsl:choose>
                    <xsl:when test="$lineCount = 1">
                        <xsl:value-of select="10"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="5"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="boxCss" select="concat(             'border: 1px solid black;',             'background-color: white;',             'overflow: hidden;',             'color: black;',             'top: ', '5', 'px;',             'left: ', '0', 'px;',             'display: block;',             'width: 25px;',             'font-size: 14px;',             'position: absolute;',             'height: 25px;'         )"/>
    
            <xsl:call-template name="zus-content-block">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="width" select="$width"/>
                <xsl:with-param name="height" select="40"/>
                <xsl:with-param name="left" select="$left"/>
    
                <xsl:with-param name="content">
                    <div style="{$boxCss}">
                        <xsl:if test="$node = 'true'">
                            <span style="text-align: center; line-height: 25px;  display: block;">X</span>
                        </xsl:if>
                    </div>
                    <div style="color: black; top: {$adjustedTop}px; left: 40px; font-size: 12px; font-family: arial; position: absolute; ">
                        <xsl:if test="$title1 != ''">
                            <xsl:value-of select="$title1"/>
                        </xsl:if>
                        <xsl:if test="$title2 != ''">
                            <br/>
                            <xsl:value-of select="$title2"/>
                        </xsl:if>
                        <xsl:if test="$title3 != ''">
                            <br/>
                            <xsl:value-of select="$title3"/>
                        </xsl:if>
                        <xsl:if test="$title4 != ''">
                            <br/>
                            <xsl:value-of select="$title4"/>
                        </xsl:if>
                    </div>
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <!-- Element formularza -->
        <xsl:template name="zus-forms-section-checkbox">
            <xsl:param name="top"/>
            <xsl:param name="left" select="0"/>
            <xsl:param name="width" select="250"/>
    
            <xsl:param name="title"/>
            <xsl:param name="node"/>
    
            <xsl:param name="title2" select="''"/>
            <xsl:param name="node2" select="''"/>
    
            <xsl:param name="title3" select="''"/>
            <xsl:param name="node3" select="''"/>
    
            <xsl:param name="title4" select="''"/>
            <xsl:param name="node4" select="''"/>
    
            <xsl:param name="title5" select="''"/>
            <xsl:param name="node5" select="''"/>
    
            <xsl:param name="title6" select="''"/>
            <xsl:param name="node6" select="''"/>
    
            <xsl:param name="title7" select="''"/>
            <xsl:param name="node7" select="''"/>
    
    
            <xsl:variable name="lineCount">
                <xsl:choose>
                    <xsl:when test="$title7 != ''">7</xsl:when>
                    <xsl:when test="$title6 != ''">6</xsl:when>
                    <xsl:when test="$title5 != ''">5</xsl:when>
                    <xsl:when test="$title4 != ''">4</xsl:when>
                    <xsl:when test="$title4 != ''">4</xsl:when>
                    <xsl:when test="$title3 != ''">3</xsl:when>
                    <xsl:when test="$title2 != ''">2</xsl:when>
                    <xsl:otherwise>1</xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="adjustedHeight">
                <xsl:choose>
                    <xsl:when test="$lineCount = 1">
                        <xsl:value-of select="40"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="$lineCount * 40"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
    
            <xsl:call-template name="zus-content-block">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="width" select="$width"/>
                <xsl:with-param name="height" select="$adjustedHeight"/>
                <xsl:with-param name="left" select="$left"/>
    
                <xsl:with-param name="content">
    
    
                    <xsl:variable name="top_cb_0" select="0"/>
    
                    <!-- Checkbox -->
                    <xsl:call-template name="zus-forms-element-checkbox">
                        <xsl:with-param name="top" select="$top_cb_0"/>
                        <xsl:with-param name="left" select="0"/>
                        <xsl:with-param name="width" select="$width"/>
    
                        <xsl:with-param name="title" select="$title"/>
                        <xsl:with-param name="node" select="$node"/>
                    </xsl:call-template>
    
                    <xsl:variable name="top_cb_1">
                        <xsl:choose>
                            <xsl:when test="$title != ''">
                                <xsl:value-of select="$top_cb_0 + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$top_cb_0"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <!-- Checkbox -->
                    <xsl:if test="$title2 != ''">
                        <xsl:call-template name="zus-forms-element-checkbox">
                            <xsl:with-param name="top" select="$top_cb_1"/>
                            <xsl:with-param name="left" select="0"/>
                            <xsl:with-param name="width" select="$width"/>
    
                            <xsl:with-param name="title" select="$title2"/>
                            <xsl:with-param name="node" select="$node2"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="top_cb_2">
                        <xsl:choose>
                            <xsl:when test="$title2 != ''">
                                <xsl:value-of select="$top_cb_1 + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$top_cb_1"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <!-- Checkbox -->
                    <xsl:if test="$title3 != ''">
                        <xsl:call-template name="zus-forms-element-checkbox">
                            <xsl:with-param name="top" select="$top_cb_2"/>
                            <xsl:with-param name="left" select="0"/>
                            <xsl:with-param name="width" select="$width"/>
    
                            <xsl:with-param name="title" select="$title3"/>
                            <xsl:with-param name="node" select="$node3"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="top_cb_3">
                        <xsl:choose>
                            <xsl:when test="$title3 != ''">
                                <xsl:value-of select="$top_cb_2 + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$top_cb_2"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <!-- Checkbox -->
                    <xsl:if test="$title4 != ''">
                        <xsl:call-template name="zus-forms-element-checkbox">
                            <xsl:with-param name="top" select="$top_cb_3"/>
                            <xsl:with-param name="left" select="0"/>
                            <xsl:with-param name="width" select="$width"/>
    
                            <xsl:with-param name="title" select="$title4"/>
                            <xsl:with-param name="node" select="$node4"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="top_cb_4">
                        <xsl:choose>
                            <xsl:when test="$title4 != ''">
                                <xsl:value-of select="$top_cb_3 + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$top_cb_3"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <!-- Checkbox -->
                    <xsl:if test="$title5 != ''">
                        <xsl:call-template name="zus-forms-element-checkbox">
                            <xsl:with-param name="top" select="$top_cb_4"/>
                            <xsl:with-param name="left" select="0"/>
                            <xsl:with-param name="width" select="$width"/>
    
                            <xsl:with-param name="title" select="$title5"/>
                            <xsl:with-param name="node" select="$node5"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="top_cb_5">
                        <xsl:choose>
                            <xsl:when test="$title5 != ''">
                                <xsl:value-of select="$top_cb_4 + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$top_cb_4"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <!-- Checkbox -->
                    <xsl:if test="$title6 != ''">
                        <xsl:call-template name="zus-forms-element-checkbox">
                            <xsl:with-param name="top" select="$top_cb_5"/>
                            <xsl:with-param name="left" select="0"/>
                            <xsl:with-param name="width" select="$width"/>
    
                            <xsl:with-param name="title" select="$title6"/>
                            <xsl:with-param name="node" select="$node6"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="top_cb_6">
                        <xsl:choose>
                            <xsl:when test="$title6 != ''">
                                <xsl:value-of select="$top_cb_5 + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$top_cb_5"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <!-- Checkbox -->
                    <xsl:if test="$title7 != ''">
                        <xsl:call-template name="zus-forms-element-checkbox">
                            <xsl:with-param name="top" select="$top_cb_6"/>
                            <xsl:with-param name="left" select="0"/>
                            <xsl:with-param name="width" select="$width"/>
    
                            <xsl:with-param name="title" select="$title7"/>
                            <xsl:with-param name="node" select="$node7"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="top_cb_7">
                        <xsl:choose>
                            <xsl:when test="$title7 != ''">
                                <xsl:value-of select="$top_cb_6 + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$top_cb_6"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <!-- Element globalny -->
        <xsl:template name="zus-text">
            <xsl:param name="top" select="0"/>
            <xsl:param name="left" select="0"/>
            <xsl:param name="height" select="25"/>
            <xsl:param name="width" select="100"/>
    
            <xsl:param name="text" select="''"/>
    
            <!-- Define Parameters for CSS Properties -->
            <xsl:param name="font-size" select="12"/>
            <xsl:param name="line-height" select="25"/>
            <xsl:param name="color" select="'black'"/>
            <xsl:param name="padding" select="''"/>
            <xsl:param name="text-align" select="'left'"/>
            <xsl:param name="bold" select="'false'"/>
            <xsl:param name="italic" select="'false'"/>
            <xsl:param name="underlined" select="'false'"/>
            <xsl:param name="font-family" select="'Arial'"/>
            <xsl:param name="word-spacing" select="''"/>
            <xsl:param name="white-space" select="''"/>
            <xsl:param name="text-indent" select="''"/>
            <xsl:param name="letter-spacing" select="''"/>
            <xsl:param name="text-transform" select="''"/>
            <xsl:param name="vertical-align" select="'middle'"/>
    
            <!-- Start Building the Style Attribute -->
            <xsl:variable name="style">
                <xsl:if test="$font-size">
                    <xsl:text>font-size: </xsl:text><xsl:value-of select="$font-size"/><xsl:text>px;</xsl:text>
                </xsl:if>
                <xsl:if test="$line-height">
                    <xsl:text>line-height: </xsl:text><xsl:value-of select="$line-height"/><xsl:text>px;</xsl:text>
                </xsl:if>
                <xsl:if test="$color">
                    <xsl:text>color: </xsl:text><xsl:value-of select="$color"/><xsl:text>;</xsl:text>
                </xsl:if>
                <xsl:if test="$padding">
                    <xsl:text>padding: </xsl:text><xsl:value-of select="$padding"/><xsl:text>px;</xsl:text>
                </xsl:if>
                <xsl:if test="$text-align">
                    <xsl:text>text-align: </xsl:text><xsl:value-of select="$text-align"/><xsl:text>;</xsl:text>
                </xsl:if>
                <xsl:if test="$bold">
                    <xsl:text>font-weight: </xsl:text>
                    <xsl:choose>
                        <xsl:when test="$bold='true'">bold</xsl:when>
                        <xsl:otherwise>normal</xsl:otherwise>
                    </xsl:choose>
                    <xsl:text>;</xsl:text>
                </xsl:if>
                <xsl:if test="$italic">
                    <xsl:text>font-style: </xsl:text>
                    <xsl:choose>
                        <xsl:when test="$italic='true'">italic</xsl:when>
                        <xsl:otherwise>normal</xsl:otherwise>
                    </xsl:choose>
                    <xsl:text>;</xsl:text>
                </xsl:if>
                <xsl:if test="$underlined">
                    <xsl:text>text-decoration: </xsl:text>
                    <xsl:choose>
                        <xsl:when test="$underlined='true'">underline</xsl:when>
                        <xsl:otherwise>none</xsl:otherwise>
                    </xsl:choose>
                    <xsl:text>;</xsl:text>
                </xsl:if>
                <xsl:if test="$font-family">
                    <xsl:text>font-family: </xsl:text><xsl:value-of select="$font-family"/><xsl:text>;</xsl:text>
                </xsl:if>
                <xsl:if test="$word-spacing">
                    <xsl:text>word-spacing: </xsl:text><xsl:value-of select="$word-spacing"/><xsl:text>;</xsl:text>
                </xsl:if>
                <xsl:if test="$white-space">
                    <xsl:text>white-space: </xsl:text><xsl:value-of select="$white-space"/><xsl:text>;</xsl:text>
                </xsl:if>
                <xsl:if test="$text-indent">
                    <xsl:text>text-indent: </xsl:text><xsl:value-of select="$text-indent"/><xsl:text>;</xsl:text>
                </xsl:if>
                <xsl:if test="$letter-spacing">
                    <xsl:text>letter-spacing: </xsl:text><xsl:value-of select="$letter-spacing"/><xsl:text>;</xsl:text>
                </xsl:if>
                <xsl:if test="$text-transform">
                    <xsl:text>text-transform: </xsl:text><xsl:value-of select="$text-transform"/><xsl:text>;</xsl:text>
                </xsl:if>
                <xsl:if test="$vertical-align">
                    <xsl:text>vertical-align: </xsl:text><xsl:value-of select="$vertical-align"/><xsl:text>;</xsl:text>
                </xsl:if>
            </xsl:variable>
    
            <xsl:call-template name="zus-content-block">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="left" select="$left"/>
                <xsl:with-param name="height" select="$height"/>
                <xsl:with-param name="width" select="$width"/>
    
                <xsl:with-param name="content">
                    <div style="{$style}"><xsl:value-of select="$text"/></div>
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <!-- Element sekcji na dokumencie -->
        <xsl:template name="zus-section">
            <xsl:param name="top" select="0"/>
            <xsl:param name="height" select="200"/>
            <xsl:param name="width" select="$zus-param-page-width - 45"/>
    
    
            <xsl:param name="header" select="''"/>
            <xsl:param name="content" select="''"/>
    
            <xsl:param name="no-header" select="0"/>
    
            <xsl:variable name="header_fix">
                <xsl:choose>
                    <xsl:when test="$no-header = 1 or $no-header = 'true'">
                        <xsl:value-of select="0"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="35"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <!-- Section block -->
            <xsl:call-template name="zus-content-block">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="height" select="$height"/>
                <xsl:with-param name="width" select="$width"/>
    
                <xsl:with-param name="content">
                    <!-- Section header block -->
                    <xsl:if test="$no-header != 1 and $no-header != 'true'">
                        <xsl:call-template name="zus-content-block">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="height" select="25"/>
                            <xsl:with-param name="width" select="$width"/>
                            <xsl:with-param name="bg-border-bottom" select="'1px solid black'"/>
    
                            <xsl:with-param name="content">
                                <xsl:call-template name="zus-text">
                                    <xsl:with-param name="top" select="0"/>
                                    <xsl:with-param name="width" select="$width"/>
                                    <xsl:with-param name="bold" select="'true'"/>
    
                                    <xsl:with-param name="font-size" select="14"/>
                                    <xsl:with-param name="text" select="$header"/>
                                </xsl:call-template>
                            </xsl:with-param>
                        </xsl:call-template>
                    </xsl:if>
    
                    <!-- Content block -->
                    <xsl:call-template name="zus-content-block">
                        <xsl:with-param name="top" select="$header_fix"/>
                        <xsl:with-param name="height" select="$height - $header_fix"/>
                        <xsl:with-param name="width" select="$width"/>
    
                        <xsl:with-param name="content">
                            <xsl:copy-of select="$content"/>
                        </xsl:with-param>
                    </xsl:call-template>
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <!-- Element formularza - pole tekstowe -->
        <xsl:template name="zus-forms-element-textfield">
            <xsl:param name="top"/>
            <xsl:param name="left" select="0"/>
    
            <xsl:param name="width" select="$zus-param-page-width - 40 - 10"/>
    
            <xsl:param name="font-size-box" select="18"/>
            <xsl:param name="font-size-label" select="12"/>
    
            <xsl:param name="text-align-box" select="'left'"/>
            <xsl:param name="text-align-label" select="'right'"/>
    
            <xsl:param name="labelWidth" select="300"/>
            <xsl:param name="boxWidth" select="$zus-param-page-width - 40 - 300 - 20"/>
    
            <xsl:param name="title" select="''"/>
            <xsl:param name="detail" select="''"/>
    
            <xsl:param name="node"/>
            <xsl:param name="boxHeight" select="25"/>
    
            <xsl:variable name="title1" select="normalize-space(substring-before(concat($title, ';'), ';'))"/>
            <xsl:variable name="remaining1" select="substring-after(concat($title, ';'), ';')"/>
    
            <xsl:variable name="title2" select="normalize-space(substring-before(concat($remaining1, ';'), ';'))"/>
    
            <xsl:variable name="detail1" select="normalize-space(substring-before(concat($detail, ';'), ';'))"/>
            <xsl:variable name="detailRemaining1" select="substring-after(concat($detail, ';'), ';')"/>
    
            <xsl:variable name="detail2" select="normalize-space(substring-before(concat($detailRemaining1, ';'), ';'))"/>
    
            <xsl:variable name="lineCount">
                <xsl:choose>
                    <xsl:when test="$title2 != ''">2</xsl:when>
                    <xsl:otherwise>1</xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="adjustedHeight">
                <xsl:choose>
                    <xsl:when test="$lineCount = 1">
                        <xsl:value-of select="25"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="12"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="labelRowHeight">
                <xsl:choose>
                    <xsl:when test="$boxHeight &gt; 25">
                        <xsl:value-of select="$boxHeight"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="$adjustedHeight"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="adjustedContentHeight">
                <xsl:choose>
                    <xsl:when test="$detail1 = ''">
                        <xsl:value-of select="$boxHeight + 5"/>
                    </xsl:when>
                    <xsl:when test="$detail2 != ''">
                        <xsl:value-of select="$boxHeight + 27"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="$boxHeight + 15"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="fieldLineHeight">
                <xsl:choose>
                    <xsl:when test="$boxHeight &gt; 25">20</xsl:when>
                    <xsl:otherwise><xsl:value-of select="$boxHeight"/></xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="fieldMultiline">
                <xsl:choose>
                    <xsl:when test="$boxHeight &gt; 25">1</xsl:when>
                    <xsl:otherwise>0</xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="fieldPaddingTop">
                <xsl:if test="$boxHeight &gt; 25">2</xsl:if>
            </xsl:variable>
    
            <xsl:variable name="fieldPaddingBottom">
                <xsl:if test="$boxHeight &gt; 25">2</xsl:if>
            </xsl:variable>
    
            <xsl:variable name="effectiveFontSize">
                <xsl:choose>
                    <xsl:when test="$boxHeight &gt; 25">14</xsl:when>
                    <xsl:otherwise><xsl:value-of select="$font-size-box"/></xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:call-template name="zus-content-block">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="width" select="$width"/>
                <xsl:with-param name="height" select="$adjustedContentHeight"/>
                <xsl:with-param name="left" select="$left"/>
    
                <xsl:with-param name="content">
                    <xsl:if test="string($title1) != ''">
                        <xsl:call-template name="zus-text">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="width" select="$labelWidth"/>
                            <xsl:with-param name="height" select="$labelRowHeight"/>
                            <xsl:with-param name="line-height" select="$adjustedHeight"/>
                            <xsl:with-param name="font-size" select="$font-size-label"/>
                            <xsl:with-param name="text-align" select="$text-align-label"/>
    
                            <xsl:with-param name="text" select="$title1"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="string($title2) != ''">
                        <xsl:call-template name="zus-text">
                            <xsl:with-param name="top" select="12"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="width" select="$labelWidth"/>
                            <xsl:with-param name="height" select="$labelRowHeight"/>
                            <xsl:with-param name="line-height" select="$adjustedHeight"/>
                            <xsl:with-param name="font-size" select="$font-size-label"/>
                            <xsl:with-param name="text-align" select="$text-align-label"/>
    
    
                            <xsl:with-param name="text" select="$title2"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:call-template name="zus-forms-box">
                        <xsl:with-param name="top" select="0"/>
                        <xsl:with-param name="left" select="$labelWidth + 10"/>
    
                        <xsl:with-param name="width" select="$boxWidth"/>
                        <xsl:with-param name="height" select="$boxHeight"/>
    
                        <xsl:with-param name="txt-align" select="$text-align-box"/>
                        <xsl:with-param name="txt-font-size" select="$effectiveFontSize"/>
    
                        <xsl:with-param name="txt-padding-left" select="5"/>
                        <xsl:with-param name="txt-padding-right" select="5"/>
                        <xsl:with-param name="txt-padding-top" select="$fieldPaddingTop"/>
                        <xsl:with-param name="txt-padding-bottom" select="$fieldPaddingBottom"/>
                        <xsl:with-param name="txt-line-height" select="$fieldLineHeight"/>
                        <xsl:with-param name="multiline" select="$fieldMultiline"/>
    
                        <xsl:with-param name="node" select="$node"/>
                    </xsl:call-template>
    
                    <xsl:if test="string($detail1) != ''">
                        <xsl:call-template name="zus-text">
                            <xsl:with-param name="top" select="$boxHeight + 1"/>
                            <xsl:with-param name="left" select="$labelWidth + 10"/>
    
                            <xsl:with-param name="width" select="$boxWidth"/>
                            <xsl:with-param name="height" select="12"/>
                            <xsl:with-param name="line-height" select="12"/>
                            <xsl:with-param name="font-size" select="10"/>
    
                            <xsl:with-param name="text" select="$detail1"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="string($detail2) != ''">
                        <xsl:call-template name="zus-text">
                            <xsl:with-param name="top" select="$boxHeight + 13"/>
                            <xsl:with-param name="left" select="$labelWidth + 10"/>
    
                            <xsl:with-param name="width" select="$boxWidth"/>
                            <xsl:with-param name="height" select="12"/>
                            <xsl:with-param name="line-height" select="12"/>
                            <xsl:with-param name="font-size" select="10"/>
    
                            <xsl:with-param name="text" select="$detail2"/>
                        </xsl:call-template>
                    </xsl:if>
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <!-- Element formularza - obszar tekstowy -->
        <xsl:template name="zus-forms-element-textarea">
            <xsl:param name="top"/>
            <xsl:param name="left" select="0"/>
    
            <xsl:param name="height" select="100"/>
            <xsl:param name="width" select="$zus-param-page-width - 40 - 10"/>
    
            <xsl:param name="font-size-box" select="18"/>
            <xsl:param name="font-size-label" select="12"/>
    
            <xsl:param name="line-height-box" select="20"/>
    
            <xsl:param name="labelWidth" select="300"/>
            <xsl:param name="boxWidth" select="$zus-param-page-width - 40 - 300 - 20"/>
    
    
    
            <xsl:param name="title" select="''"/>
            <xsl:param name="detail" select="''"/>
    
            <xsl:param name="node"/>
    
            <xsl:variable name="title1" select="normalize-space(substring-before(concat($title, ';'), ';'))"/>
            <xsl:variable name="remaining1" select="substring-after(concat($title, ';'), ';')"/>
    
            <xsl:variable name="title2" select="normalize-space(substring-before(concat($remaining1, ';'), ';'))"/>
            <xsl:variable name="remaining2" select="substring-after(concat($remaining1, ';'), ';')"/>
    
            <xsl:variable name="title3" select="normalize-space(substring-before(concat($remaining2, ';'), ';'))"/>
            <xsl:variable name="remaining3" select="substring-after(concat($remaining2, ';'), ';')"/>
    
            <xsl:variable name="title4" select="normalize-space(substring-before(concat($remaining3, ';'), ';'))"/>
    
            <xsl:variable name="detail1" select="normalize-space(substring-before(concat($detail, ';'), ';'))"/>
            <xsl:variable name="detailRemaining1" select="substring-after(concat($detail, ';'), ';')"/>
    
            <xsl:variable name="detail2" select="normalize-space(substring-before(concat($detailRemaining1, ';'), ';'))"/>
    
            <xsl:variable name="lineCount">
                <xsl:choose>
                    <xsl:when test="$title4 != ''">4</xsl:when>
                    <xsl:when test="$title3 != ''">3</xsl:when>
                    <xsl:when test="$title2 != ''">2</xsl:when>
                    <xsl:otherwise>1</xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="adjustedHeight">
                <xsl:choose>
                    <xsl:when test="$lineCount = 1">
                        <xsl:value-of select="$height"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="$height div $lineCount"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="adjustedContentHeight">
                <xsl:choose>
                    <xsl:when test="$detail1 = ''">
                        <xsl:value-of select="$height"/>
                    </xsl:when>
                    <xsl:when test="$detail2 != ''">
                        <xsl:value-of select="$height + 22"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="$height + 10"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:call-template name="zus-content-block">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="width" select="$width"/>
                <xsl:with-param name="height" select="$adjustedContentHeight"/>
                <xsl:with-param name="left" select="$left"/>
    
                <xsl:with-param name="content">
                    <xsl:if test="string($title1) != ''">
                        <xsl:call-template name="zus-text">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="width" select="$labelWidth"/>
                            <xsl:with-param name="height" select="$adjustedHeight"/>
                            <xsl:with-param name="line-height" select="$adjustedHeight"/>
                            <xsl:with-param name="font-size" select="$font-size-label"/>
                            <xsl:with-param name="text-align" select="'right'"/>
    
                            <xsl:with-param name="text" select="$title1"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="string($title2) != ''">
                        <xsl:call-template name="zus-text">
                            <xsl:with-param name="top" select="$adjustedHeight"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="width" select="$labelWidth"/>
                            <xsl:with-param name="height" select="$adjustedHeight"/>
                            <xsl:with-param name="line-height" select="$adjustedHeight"/>
                            <xsl:with-param name="font-size" select="$font-size-label"/>
                            <xsl:with-param name="text-align" select="'right'"/>
    
    
                            <xsl:with-param name="text" select="$title2"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="string($title3) != ''">
                        <xsl:call-template name="zus-text">
                            <xsl:with-param name="top" select="$adjustedHeight * 2"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="width" select="$labelWidth"/>
                            <xsl:with-param name="height" select="$adjustedHeight"/>
                            <xsl:with-param name="line-height" select="$adjustedHeight"/>
                            <xsl:with-param name="font-size" select="$font-size-label"/>
                            <xsl:with-param name="text-align" select="'right'"/>
    
    
                            <xsl:with-param name="text" select="$title3"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="string($title4) != ''">
                        <xsl:call-template name="zus-text">
                            <xsl:with-param name="top" select="$adjustedHeight * 3"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="width" select="$labelWidth"/>
                            <xsl:with-param name="height" select="$adjustedHeight"/>
                            <xsl:with-param name="line-height" select="$adjustedHeight"/>
                            <xsl:with-param name="font-size" select="$font-size-label"/>
                            <xsl:with-param name="text-align" select="'right'"/>
    
    
                            <xsl:with-param name="text" select="$title4"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="areaTextSize">
                        <xsl:choose>
                            <xsl:when test="string-length($node) &gt; 500">
                                <xsl:value-of select="10"/>
                            </xsl:when>
                            <xsl:when test="string-length($node) &gt; 250">
                                <xsl:value-of select="11"/>
                            </xsl:when>
                            <xsl:when test="string-length($node) &gt; 150">
                                <xsl:value-of select="14"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$font-size-box"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:variable name="areaLineSize">
                        <xsl:choose>
                            <xsl:when test="string-length($node) &gt; 500">
                                <xsl:value-of select="14"/>
                            </xsl:when>
                            <xsl:when test="string-length($node) &gt; 250">
                                <xsl:value-of select="16"/>
                            </xsl:when>
                            <xsl:when test="string-length($node) &gt; 150">
                                <xsl:value-of select="18"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$line-height-box"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:call-template name="zus-forms-box">
                        <xsl:with-param name="top" select="0"/>
                        <xsl:with-param name="left" select="$labelWidth + 10"/>
    
                        <xsl:with-param name="width" select="$boxWidth"/>
                        <xsl:with-param name="height" select="$height"/>
    
                        <xsl:with-param name="txt-align" select="'left'"/>
                        <xsl:with-param name="txt-font-size" select="$areaTextSize"/>
    
                        <xsl:with-param name="txt-line-height" select="$areaLineSize"/>
    
                        <xsl:with-param name="txt-padding-left" select="5"/>
                        <xsl:with-param name="txt-padding-right" select="5"/>
    
                        <xsl:with-param name="node" select="$node"/>
                    </xsl:call-template>
    
                    <xsl:if test="string($detail1) != ''">
                        <xsl:call-template name="zus-text">
                            <xsl:with-param name="top" select="26"/>
                            <xsl:with-param name="left" select="$labelWidth + 10"/>
    
                            <xsl:with-param name="width" select="$boxWidth"/>
                            <xsl:with-param name="height" select="12"/>
                            <xsl:with-param name="line-height" select="12"/>
                            <xsl:with-param name="font-size" select="10"/>
    
                            <xsl:with-param name="text" select="$detail1"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="string($detail2) != ''">
                        <xsl:call-template name="zus-text">
                            <xsl:with-param name="top" select="38"/>
                            <xsl:with-param name="left" select="$labelWidth + 10"/>
    
                            <xsl:with-param name="width" select="$boxWidth"/>
                            <xsl:with-param name="height" select="12"/>
                            <xsl:with-param name="line-height" select="12"/>
                            <xsl:with-param name="font-size" select="10"/>
    
                            <xsl:with-param name="text" select="$detail2"/>
                        </xsl:call-template>
                    </xsl:if>
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <!-- Element formularza - pole tekstowe -->
        <xsl:template name="zus-forms-element-radio-ab">
            <xsl:param name="top"/>
            <xsl:param name="left" select="0"/>
    
            <xsl:param name="width" select="$zus-param-page-width - 40 - 10"/>
    
            <xsl:param name="font-size-label" select="12"/>
    
            <xsl:param name="labelWidth" select="300"/>
            <xsl:param name="boxWidth" select="$zus-param-page-width - 40 - 300 - 20"/>
    
            <xsl:param name="title" select="''"/>
            <xsl:param name="detail" select="''"/>
    
            <xsl:param name="nodeA"/>
            <xsl:param name="labelA"/>
    
            <xsl:param name="nodeB"/>
            <xsl:param name="labelB"/>
    
            <xsl:variable name="title1" select="normalize-space(substring-before(concat($title, ';'), ';'))"/>
            <xsl:variable name="remaining1" select="substring-after(concat($title, ';'), ';')"/>
    
            <xsl:variable name="title2" select="normalize-space(substring-before(concat($remaining1, ';'), ';'))"/>
    
            <xsl:variable name="detail1" select="normalize-space(substring-before(concat($detail, ';'), ';'))"/>
            <xsl:variable name="detailRemaining1" select="substring-after(concat($detail, ';'), ';')"/>
    
            <xsl:variable name="detail2" select="normalize-space(substring-before(concat($detailRemaining1, ';'), ';'))"/>
    
            <xsl:variable name="lineCount">
                <xsl:choose>
                    <xsl:when test="$title2 != ''">2</xsl:when>
                    <xsl:otherwise>1</xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="adjustedHeight">
                <xsl:choose>
                    <xsl:when test="$lineCount = 1">
                        <xsl:value-of select="30"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="20"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="adjustedContentHeight">
                <xsl:choose>
                    <xsl:when test="$detail1 = ''">
                        <xsl:value-of select="40"/>
                    </xsl:when>
                    <xsl:when test="$detail2 != ''">
                        <xsl:value-of select="62"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="50"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:call-template name="zus-content-block">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="width" select="$width"/>
                <xsl:with-param name="height" select="$adjustedContentHeight"/>
                <xsl:with-param name="left" select="$left"/>
    
                <xsl:with-param name="content">
                    <xsl:if test="string($title1) != ''">
                        <xsl:call-template name="zus-text">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="width" select="$labelWidth"/>
                            <xsl:with-param name="height" select="$adjustedHeight"/>
                            <xsl:with-param name="line-height" select="$adjustedHeight"/>
                            <xsl:with-param name="font-size" select="$font-size-label"/>
                            <xsl:with-param name="text-align" select="'right'"/>
    
                            <xsl:with-param name="text" select="$title1"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="string($title2) != ''">
                        <xsl:call-template name="zus-text">
                            <xsl:with-param name="top" select="12"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="width" select="$labelWidth"/>
                            <xsl:with-param name="height" select="$adjustedHeight"/>
                            <xsl:with-param name="line-height" select="$adjustedHeight"/>
                            <xsl:with-param name="font-size" select="$font-size-label"/>
                            <xsl:with-param name="text-align" select="'right'"/>
    
    
                            <xsl:with-param name="text" select="$title2"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:call-template name="zus-forms-element-checkbox">
                        <xsl:with-param name="top" select="0"/>
                        <xsl:with-param name="left" select="$labelWidth + 10"/>
                        <xsl:with-param name="width" select="100"/>
    
                        <xsl:with-param name="title" select="$labelA"/>
                        <xsl:with-param name="node" select="$nodeA"/>
                    </xsl:call-template>
    
                    <xsl:call-template name="zus-forms-element-checkbox">
                        <xsl:with-param name="top" select="0"/>
                        <xsl:with-param name="left" select="$labelWidth + 115"/>
                        <xsl:with-param name="width" select="100"/>
    
                        <xsl:with-param name="title" select="$labelB"/>
                        <xsl:with-param name="node" select="$nodeB"/>
                    </xsl:call-template>
    
                    <xsl:if test="string($detail1) != ''">
                        <xsl:call-template name="zus-text">
                            <xsl:with-param name="top" select="26"/>
                            <xsl:with-param name="left" select="$labelWidth + 10"/>
    
                            <xsl:with-param name="width" select="$boxWidth"/>
                            <xsl:with-param name="height" select="12"/>
                            <xsl:with-param name="line-height" select="12"/>
                            <xsl:with-param name="font-size" select="10"/>
    
                            <xsl:with-param name="text" select="$detail1"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="string($detail2) != ''">
                        <xsl:call-template name="zus-text">
                            <xsl:with-param name="top" select="38"/>
                            <xsl:with-param name="left" select="$labelWidth + 10"/>
    
                            <xsl:with-param name="width" select="$boxWidth"/>
                            <xsl:with-param name="height" select="12"/>
                            <xsl:with-param name="line-height" select="12"/>
                            <xsl:with-param name="font-size" select="10"/>
    
                            <xsl:with-param name="text" select="$detail2"/>
                        </xsl:call-template>
                    </xsl:if>
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <!-- Element formularza - pole literowane -->
        <xsl:template name="zus-forms-element-patternbox">
            <xsl:param name="top"/>
            <xsl:param name="left" select="0"/>
    
            <xsl:param name="width" select="$zus-param-page-width - 40 - 10"/>
    
            <xsl:param name="font-size-box" select="18"/>
            <xsl:param name="font-size-label" select="12"/>
    
            <xsl:param name="labelWidth" select="300"/>
            <xsl:param name="boxWidth" select="$zus-param-page-width - 40 - 300 - 20"/>
    
            <xsl:param name="title" select="''"/>
            <xsl:param name="detail" select="''"/>
    
            <xsl:param name="pattern" select="'xLxLxxxx'"/>
            <xsl:param name="format" select="'raw'"/>
    
            <xsl:param name="node"/>
    
            <xsl:variable name="title1" select="normalize-space(substring-before(concat($title, ';'), ';'))"/>
            <xsl:variable name="remaining1" select="substring-after(concat($title, ';'), ';')"/>
    
            <xsl:variable name="title2" select="normalize-space(substring-before(concat($remaining1, ';'), ';'))"/>
    
            <xsl:variable name="detail1" select="normalize-space(substring-before(concat($detail, ';'), ';'))"/>
            <xsl:variable name="detailRemaining1" select="substring-after(concat($detail, ';'), ';')"/>
    
            <xsl:variable name="detail2" select="normalize-space(substring-before(concat($detailRemaining1, ';'), ';'))"/>
    
            <xsl:variable name="formatted_node">
                <xsl:choose>
                    <xsl:when test="$format = 'xsdate'">
                        <xsl:call-template name="zus-format-xsdate">
                            <xsl:with-param name="date" select="$node"/>
                        </xsl:call-template>
                    </xsl:when>
                    <xsl:otherwise><xsl:value-of select="$node"/></xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="lineCount">
                <xsl:choose>
                    <xsl:when test="$title2 != ''">2</xsl:when>
                    <xsl:otherwise>1</xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="adjustedHeight">
                <xsl:choose>
                    <xsl:when test="$lineCount = 1">
                        <xsl:value-of select="25"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="12"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:variable name="adjustedContentHeight">
                <xsl:choose>
                    <xsl:when test="$detail1 = ''">
                        <xsl:value-of select="30"/>
                    </xsl:when>
                    <xsl:when test="$detail2 != ''">
                        <xsl:value-of select="52"/>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="40"/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:variable>
    
            <xsl:call-template name="zus-content-block">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="width" select="$width"/>
                <xsl:with-param name="height" select="$adjustedContentHeight"/>
                <xsl:with-param name="left" select="$left"/>
    
                <xsl:with-param name="content">
                    <xsl:if test="string($title1) != ''">
                        <xsl:call-template name="zus-text">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="width" select="$labelWidth"/>
                            <xsl:with-param name="height" select="$adjustedHeight"/>
                            <xsl:with-param name="line-height" select="$adjustedHeight"/>
                            <xsl:with-param name="font-size" select="$font-size-label"/>
                            <xsl:with-param name="text-align" select="'right'"/>
    
                            <xsl:with-param name="text" select="$title1"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="string($title2) != ''">
                        <xsl:call-template name="zus-text">
                            <xsl:with-param name="top" select="12"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="width" select="$labelWidth"/>
                            <xsl:with-param name="height" select="$adjustedHeight"/>
                            <xsl:with-param name="line-height" select="$adjustedHeight"/>
                            <xsl:with-param name="font-size" select="$font-size-label"/>
                            <xsl:with-param name="text-align" select="'right'"/>
    
    
                            <xsl:with-param name="text" select="$title2"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <div style="box-sizing: content-box;">
                        <xsl:call-template name="zus-forms-box-split">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="left" select="$labelWidth + 10"/>
                            <xsl:with-param name="split-pattern" select="$pattern"/>
                            <xsl:with-param name="node" select="$formatted_node"/>
                        </xsl:call-template>
                    </div>
    
                    <xsl:if test="string($detail1) != ''">
                        <xsl:call-template name="zus-text">
                            <xsl:with-param name="top" select="26"/>
                            <xsl:with-param name="left" select="$labelWidth + 10"/>
    
                            <xsl:with-param name="width" select="$boxWidth"/>
                            <xsl:with-param name="height" select="12"/>
                            <xsl:with-param name="line-height" select="12"/>
                            <xsl:with-param name="font-size" select="10"/>
    
                            <xsl:with-param name="text" select="$detail1"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="string($detail2) != ''">
                        <xsl:call-template name="zus-text">
                            <xsl:with-param name="top" select="38"/>
                            <xsl:with-param name="left" select="$labelWidth + 10"/>
    
                            <xsl:with-param name="width" select="$boxWidth"/>
                            <xsl:with-param name="height" select="12"/>
                            <xsl:with-param name="line-height" select="12"/>
                            <xsl:with-param name="font-size" select="10"/>
    
                            <xsl:with-param name="text" select="$detail2"/>
                        </xsl:call-template>
                    </xsl:if>
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <!-- Gotowe kontrolki - Uniwersalny picker -->
        <xsl:template name="zus-forms-element-picker">
            <xsl:param name="type" select="'raw'"/>
            <xsl:param name="node" select="''"/>
            <xsl:param name="node2" select="''"/>
            <xsl:param name="node3" select="''"/>
            <xsl:param name="params" select="''"/>
    
    
    
            <xsl:choose>
    
                <!-- #region Generic types -->
                <xsl:when test="$type = 'text'">
                    <!-- #region Custom parameters support -->
                    <xsl:variable name="text_label">
                        <xsl:call-template name="zus-data-extract-param">
                            <xsl:with-param name="params" select="$params"/>
                            <xsl:with-param name="key" select="'label'"/>
                            <xsl:with-param name="default" select="'Data'"/>
                        </xsl:call-template>
                    </xsl:variable>
                    <xsl:variable name="text_detail">
                        <xsl:call-template name="zus-data-extract-param">
                            <xsl:with-param name="params" select="$params"/>
                            <xsl:with-param name="key" select="'detail'"/>
                            <xsl:with-param name="default" select="''"/>
                        </xsl:call-template>
                    </xsl:variable>
                    <!-- #endregion -->
    
                    <xsl:variable name="text_height">
                        <xsl:choose>
                            <xsl:when test="$text_detail != ''">
                                <xsl:value-of select="55"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="35"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <div style="position: relative; height: {$text_height}px; width: auto;" class="ramki-pomocnicze">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="title" select="$text_label"/>
                            <xsl:with-param name="detail" select="$text_detail"/>
                            <xsl:with-param name="node" select="$node"/>
                        </xsl:call-template>
                    </div>
                </xsl:when>
    
    
                <xsl:when test="$type = 'text-long'">
                    <!-- #region Custom parameters support -->
                    <xsl:variable name="text_label">
                        <xsl:call-template name="zus-data-extract-param">
                            <xsl:with-param name="params" select="$params"/>
                            <xsl:with-param name="key" select="'label'"/>
                            <xsl:with-param name="default" select="'Data'"/>
                        </xsl:call-template>
                    </xsl:variable>
                    <xsl:variable name="text_detail">
                        <xsl:call-template name="zus-data-extract-param">
                            <xsl:with-param name="params" select="$params"/>
                            <xsl:with-param name="key" select="'detail'"/>
                            <xsl:with-param name="default" select="''"/>
                        </xsl:call-template>
                    </xsl:variable>
                    <!-- #endregion -->
    
                    <xsl:variable name="text_height">
                        <xsl:choose>
                            <xsl:when test="$text_detail != ''">
                                <xsl:value-of select="55"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="35"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:variable name="var-font-size">
                        <xsl:choose>
                            <xsl:when test="string-length($node) &gt; 86">
                                <xsl:value-of select="8"/>
                            </xsl:when>
                            <xsl:when test="string-length($node) &gt; 70">
                                <xsl:value-of select="10"/>
                            </xsl:when>
                            <xsl:when test="string-length($node) &gt; 62">
                                <xsl:value-of select="12"/>
                            </xsl:when>
                            <xsl:when test="string-length($node) &gt; 48">
                                <xsl:value-of select="14"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="18"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <div style="position: relative; height: {$text_height}px; width: auto;" class="ramki-pomocnicze">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="left" select="0"/>
                            <xsl:with-param name="font-size-box" select="$var-font-size"/>
    
                            <xsl:with-param name="title" select="$text_label"/>
                            <xsl:with-param name="detail" select="$text_detail"/>
                            <xsl:with-param name="node" select="$node"/>
                        </xsl:call-template>
                    </div>
                </xsl:when>
    
                <xsl:when test="$type = 'text-size'">
                    <!-- #region Custom parameters support -->
                    <xsl:variable name="text_label">
                        <xsl:call-template name="zus-data-extract-param">
                            <xsl:with-param name="params" select="$params"/>
                            <xsl:with-param name="key" select="'label'"/>
                            <xsl:with-param name="default" select="'Data'"/>
                        </xsl:call-template>
                    </xsl:variable>
                    <xsl:variable name="text_detail">
                        <xsl:call-template name="zus-data-extract-param">
                            <xsl:with-param name="params" select="$params"/>
                            <xsl:with-param name="key" select="'detail'"/>
                            <xsl:with-param name="default" select="''"/>
                        </xsl:call-template>
                    </xsl:variable>
                    <!-- #endregion -->
    
                    <xsl:variable name="text_height">
                        <xsl:choose>
                            <xsl:when test="$text_detail != ''">
                                <xsl:value-of select="55"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="35"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <div style="position: relative; height: {$text_height}px; width: auto;" class="ramki-pomocnicze">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="title" select="$text_label"/>
                            <xsl:with-param name="detail" select="$text_detail"/>
                            <xsl:with-param name="node" select="$node"/>
                        </xsl:call-template>
                    </div>
                </xsl:when>
    
                <xsl:when test="$type = 'date'">
                    <!-- #region Custom parameters support -->
                    <xsl:variable name="date_label">
                        <xsl:call-template name="zus-data-extract-param">
                            <xsl:with-param name="params" select="$params"/>
                            <xsl:with-param name="key" select="'label'"/>
                            <xsl:with-param name="default" select="'Data'"/>
                        </xsl:call-template>
                    </xsl:variable>
                    <xsl:variable name="date_detail">
                        <xsl:call-template name="zus-data-extract-param">
                            <xsl:with-param name="params" select="$params"/>
                            <xsl:with-param name="key" select="'detail'"/>
                            <xsl:with-param name="default" select="''"/>
                        </xsl:call-template>
                    </xsl:variable>
                    <xsl:variable name="date_pattern">
                        <xsl:call-template name="zus-data-extract-param">
                            <xsl:with-param name="params" select="$params"/>
                            <xsl:with-param name="key" select="'pattern'"/>
                            <xsl:with-param name="default" select="''"/>
                        </xsl:call-template>
                    </xsl:variable>
                    <xsl:variable name="date_format">
                        <xsl:call-template name="zus-data-extract-param">
                            <xsl:with-param name="params" select="$params"/>
                            <xsl:with-param name="key" select="'format'"/>
                            <xsl:with-param name="default" select="'raw'"/>
                        </xsl:call-template>
                    </xsl:variable>
                    <!-- #endregion -->
    
                    <div style="position: relative; height: 45px; width: auto;" class="ramki-pomocnicze">
                        <xsl:call-template name="zus-forms-element-patternbox">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="title" select="$date_label"/>
                            <xsl:with-param name="detail" select="$date_detail"/>
                            <xsl:with-param name="pattern" select="$date_pattern"/>
                            <xsl:with-param name="format" select="$date_format"/>
    
                            <xsl:with-param name="node" select="$node"/>
                        </xsl:call-template>
                    </div>
                </xsl:when>
    
                <xsl:when test="$type = 'checkbox'">
                    <!-- #region Custom parameters support -->
                    <xsl:variable name="checkbox_label">
                        <xsl:call-template name="zus-data-extract-param">
                            <xsl:with-param name="params" select="$params"/>
                            <xsl:with-param name="key" select="'label'"/>
                            <xsl:with-param name="default" select="'Data'"/>
                        </xsl:call-template>
                    </xsl:variable>
                    <xsl:variable name="checkbox_detail">
                        <xsl:call-template name="zus-data-extract-param">
                            <xsl:with-param name="params" select="$params"/>
                            <xsl:with-param name="key" select="'detail'"/>
                            <xsl:with-param name="default" select="''"/>
                        </xsl:call-template>
                    </xsl:variable>
                    <!-- #endregion -->
    
                    <xsl:variable name="checkbox_height">
                        <xsl:choose>
                            <xsl:when test="$checkbox_detail != ''">
                                <xsl:value-of select="55"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="35"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <div style="position: relative; height: {$checkbox_height}px; width: auto;" class="ramki-pomocnicze">
                        <xsl:call-template name="zus-forms-element-patternbox">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="left" select="0"/>
                            <xsl:with-param name="boxWidth" select="35"/>
    
                            <xsl:with-param name="title" select="$checkbox_label"/>
                            <xsl:with-param name="detail" select="$checkbox_detail"/>
                            <xsl:with-param name="pattern" select="'x'"/>
    
                            <xsl:with-param name="node" select="$node"/>
                        </xsl:call-template>
                    </div>
                </xsl:when>
                <!-- #endregion -->
    
                <xsl:when test="$type = 'pesel'">
                    <!-- #region Custom parameters support -->
                    <xsl:variable name="pesel_label">
                        <xsl:call-template name="zus-data-extract-param">
                            <xsl:with-param name="params" select="$params"/>
                            <xsl:with-param name="key" select="'label'"/>
                            <xsl:with-param name="default" select="'PESEL'"/>
                        </xsl:call-template>
                    </xsl:variable>
                    <!-- #endregion -->
    
                    <div style="position: relative; height: 45px; width: auto;" class="ramki-pomocnicze">
                        <xsl:call-template name="zus-forms-element-patternbox">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="title" select="$pesel_label"/>
                            <xsl:with-param name="pattern" select="'xxxxxxxxxxx'"/>
    
                            <xsl:with-param name="node" select="$node"/>
                        </xsl:call-template>
                    </div>
                </xsl:when>
    
                <xsl:when test="$type = 'nip'">
                    <!-- #region Custom parameters support -->
                    <xsl:variable name="nip_label">
                        <xsl:call-template name="zus-data-extract-param">
                            <xsl:with-param name="params" select="$params"/>
                            <xsl:with-param name="key" select="'label'"/>
                            <xsl:with-param name="default" select="'NIP'"/>
                        </xsl:call-template>
                    </xsl:variable>
                    <xsl:variable name="nip_detail">
                        <xsl:call-template name="zus-data-extract-param">
                            <xsl:with-param name="params" select="$params"/>
                            <xsl:with-param name="key" select="'detail'"/>
                            <xsl:with-param name="default" select="''"/>
                        </xsl:call-template>
                    </xsl:variable>
                    <!-- #endregion -->
    
                    <div style="position: relative; height: 45px; width: auto;" class="ramki-pomocnicze">
                        <xsl:call-template name="zus-forms-element-patternbox">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="title" select="'NIP'"/>
                            <xsl:with-param name="detail" select="$nip_detail"/>
                            <xsl:with-param name="pattern" select="'xxxxxxxxxx'"/>
    
                            <xsl:with-param name="node" select="$node"/>
                        </xsl:call-template>
                    </div>
                </xsl:when>
    
                <xsl:when test="$type = 'rodzajIseria'">
                    <!-- #region Custom parameters support -->
                    <xsl:variable name="rodzaj_label">
                        <xsl:call-template name="zus-data-extract-param">
                            <xsl:with-param name="params" select="$params"/>
                            <xsl:with-param name="key" select="'label'"/>
                            <xsl:with-param name="default" select="'Rodzaj, seria i numer dokumentu;potwierdzającego tożsamość'"/>
                        </xsl:call-template>
                    </xsl:variable>
    
                    <xsl:variable name="rodzaj_detail">
                        <xsl:call-template name="zus-data-extract-param">
                            <xsl:with-param name="params" select="$params"/>
                            <xsl:with-param name="key" select="'detail'"/>
                            <xsl:with-param name="default" select="'Podaj, jeśli nie masz nadanego numeru PESEL'"/>
                        </xsl:call-template>
                    </xsl:variable>
                    <!-- #endregion -->
    
                    <xsl:variable name="rodzajIseriaString">
                        <xsl:choose>
                            <xsl:when test="string($node2) = ''">
                                <xsl:value-of select="''"/>
                            </xsl:when>
                            <xsl:when test="string($node) = '1'">
                                <xsl:value-of select="concat('DOWÓD OSOBISTY', ' ', $node2)"/>
                            </xsl:when>
                            <xsl:when test="string($node) = '2'">
                                <xsl:value-of select="concat('PASZPORT LUB INNY DOK.', ' ', $node2)"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="concat('PASZPORT LUB INNY DOK.', ' ', $node2)"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <div style="position: relative; height: 45px; width: auto;" class="ramki-pomocnicze">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="title" select="$rodzaj_label"/>
                            <xsl:with-param name="detail" select="$rodzaj_detail"/>
                            <xsl:with-param name="node" select="$rodzajIseriaString"/>
                        </xsl:call-template>
                    </div>
                </xsl:when>
    
                <xsl:when test="$type = 'dataurodzenia'">
                    <div style="position: relative; height: 45px; width: auto;" class="ramki-pomocnicze">
                        <xsl:call-template name="zus-forms-element-patternbox">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="title" select="'Data urodzenia'"/>
                            <xsl:with-param name="pattern" select="'xLxLxxxx'"/>
                            <xsl:with-param name="format" select="'xsdate'"/>
    
                            <xsl:with-param name="node" select="$node"/>
                        </xsl:call-template>
                    </div>
                </xsl:when>
    
                <xsl:when test="$type = 'imie'">
                    <div style="position: relative; height: 45px; width: auto;" class="ramki-pomocnicze">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="title" select="'Imię'"/>
                            <xsl:with-param name="node" select="$node"/>
                        </xsl:call-template>
                    </div>
                </xsl:when>
    
                <xsl:when test="$type = 'drugieimie'">
                    <div style="position: relative; height: 45px; width: auto;" class="ramki-pomocnicze">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="title" select="'Drugie imię'"/>
                            <xsl:with-param name="node" select="$node"/>
                        </xsl:call-template>
                    </div>
                </xsl:when>
    
                <xsl:when test="$type = 'nazwisko'">
                    <div style="position: relative; height: 45px; width: auto;" class="ramki-pomocnicze">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="title" select="'Nazwisko'"/>
                            <xsl:with-param name="node" select="$node"/>
                        </xsl:call-template>
                    </div>
                </xsl:when>
    
                <xsl:when test="$type = 'stancywilny'">
                    <div style="position: relative; height: 45px; width: auto;" class="ramki-pomocnicze">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="title" select="'Stan cywilny'"/>
                            <xsl:with-param name="node" select="$node"/>
                        </xsl:call-template>
                    </div>
                </xsl:when>
    
                <xsl:when test="$type = 'obywatelstwo'">
                    <div style="position: relative; height: 45px; width: auto;" class="ramki-pomocnicze">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="title" select="'Obywatelstwo'"/>
                            <xsl:with-param name="node" select="$node"/>
                        </xsl:call-template>
                    </div>
                </xsl:when>
    
                <xsl:otherwise>
                    <div style="position: relative; height: 45px; width: auto;" class="ramki-pomocnicze">
                        <xsl:value-of select="$node"/>
                    </div>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:template>
    
        <!-- Gotowe formularze - Uniwersalny budowniczy -->
        <xsl:template name="zus-forms-universal-builder">
            <xsl:param name="top"/>
            <xsl:param name="height" select="600"/>
            <xsl:param name="title" select="'Title'"/>
            <xsl:param name="no-header" select="'false'"/>
    
            <!-- #region Declaring Fields 1 to 12 -->
            <xsl:param name="field1_type" select="''"/>
            <xsl:param name="field1_node" select="''"/>
            <xsl:param name="field1_node2" select="''"/>
            <xsl:param name="field1_node3" select="''"/>
            <xsl:param name="field1_params" select="''"/>
    
            <xsl:param name="field2_type" select="''"/>
            <xsl:param name="field2_node" select="''"/>
            <xsl:param name="field2_node2" select="''"/>
            <xsl:param name="field2_node3" select="''"/>
            <xsl:param name="field2_params" select="''"/>
    
            <xsl:param name="field3_type" select="''"/>
            <xsl:param name="field3_node" select="''"/>
            <xsl:param name="field3_node2" select="''"/>
            <xsl:param name="field3_node3" select="''"/>
            <xsl:param name="field3_params" select="''"/>
    
            <xsl:param name="field4_type" select="''"/>
            <xsl:param name="field4_node" select="''"/>
            <xsl:param name="field4_node2" select="''"/>
            <xsl:param name="field4_node3" select="''"/>
            <xsl:param name="field4_params" select="''"/>
    
            <xsl:param name="field5_type" select="''"/>
            <xsl:param name="field5_node" select="''"/>
            <xsl:param name="field5_node2" select="''"/>
            <xsl:param name="field5_node3" select="''"/>
            <xsl:param name="field5_params" select="''"/>
    
            <xsl:param name="field6_type" select="''"/>
            <xsl:param name="field6_node" select="''"/>
            <xsl:param name="field6_node2" select="''"/>
            <xsl:param name="field6_node3" select="''"/>
            <xsl:param name="field6_params" select="''"/>
    
            <xsl:param name="field7_type" select="''"/>
            <xsl:param name="field7_node" select="''"/>
            <xsl:param name="field7_node2" select="''"/>
            <xsl:param name="field7_node3" select="''"/>
            <xsl:param name="field7_params" select="''"/>
    
            <xsl:param name="field8_type" select="''"/>
            <xsl:param name="field8_node" select="''"/>
            <xsl:param name="field8_node2" select="''"/>
            <xsl:param name="field8_node3" select="''"/>
            <xsl:param name="field8_params" select="''"/>
    
            <xsl:param name="field9_type" select="''"/>
            <xsl:param name="field9_node" select="''"/>
            <xsl:param name="field9_node2" select="''"/>
            <xsl:param name="field9_node3" select="''"/>
            <xsl:param name="field9_params" select="''"/>
    
            <xsl:param name="field10_type" select="''"/>
            <xsl:param name="field10_node" select="''"/>
            <xsl:param name="field10_node2" select="''"/>
            <xsl:param name="field10_node3" select="''"/>
            <xsl:param name="field10_params" select="''"/>
    
            <xsl:param name="field11_type" select="''"/>
            <xsl:param name="field11_node" select="''"/>
            <xsl:param name="field11_node2" select="''"/>
            <xsl:param name="field11_node3" select="''"/>
            <xsl:param name="field11_params" select="''"/>
    
            <xsl:param name="field12_type" select="''"/>
            <xsl:param name="field12_node" select="''"/>
            <xsl:param name="field12_node2" select="''"/>
            <xsl:param name="field12_node3" select="''"/>
            <xsl:param name="field12_params" select="''"/>
            <!-- #endregion Declaring Fields 1 to 12 -->
    
            <xsl:call-template name="zus-section">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="height" select="$height"/>
                <xsl:with-param name="header" select="$title"/>
                <xsl:with-param name="no-header" select="$no-header"/>
                <xsl:with-param name="content">
    
                    <!-- #region Fields 1 to 12 -->
                    <xsl:if test="$field1_type != ''">
                        <xsl:call-template name="zus-forms-element-picker">
                            <xsl:with-param name="type" select="$field1_type"/>
                            <xsl:with-param name="node" select="$field1_node"/>
                            <xsl:with-param name="node2" select="$field1_node2"/>
                            <xsl:with-param name="node3" select="$field1_node3"/>
                            <xsl:with-param name="params" select="$field1_params"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="$field2_type != ''">
                        <xsl:call-template name="zus-forms-element-picker">
                            <xsl:with-param name="type" select="$field2_type"/>
                            <xsl:with-param name="node" select="$field2_node"/>
                            <xsl:with-param name="node2" select="$field2_node2"/>
                            <xsl:with-param name="node3" select="$field2_node3"/>
                            <xsl:with-param name="params" select="$field2_params"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="$field3_type != ''">
                        <xsl:call-template name="zus-forms-element-picker">
                            <xsl:with-param name="type" select="$field3_type"/>
                            <xsl:with-param name="node" select="$field3_node"/>
                            <xsl:with-param name="node2" select="$field3_node2"/>
                            <xsl:with-param name="node3" select="$field3_node3"/>
                            <xsl:with-param name="params" select="$field3_params"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="$field4_type != ''">
                        <xsl:call-template name="zus-forms-element-picker">
                            <xsl:with-param name="type" select="$field4_type"/>
                            <xsl:with-param name="node" select="$field4_node"/>
                            <xsl:with-param name="node2" select="$field4_node2"/>
                            <xsl:with-param name="node3" select="$field4_node3"/>
                            <xsl:with-param name="params" select="$field4_params"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="$field5_type != ''">
                        <xsl:call-template name="zus-forms-element-picker">
                            <xsl:with-param name="type" select="$field5_type"/>
                            <xsl:with-param name="node" select="$field5_node"/>
                            <xsl:with-param name="node2" select="$field5_node2"/>
                            <xsl:with-param name="node3" select="$field5_node3"/>
                            <xsl:with-param name="params" select="$field5_params"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="$field6_type != ''">
                        <xsl:call-template name="zus-forms-element-picker">
                            <xsl:with-param name="type" select="$field6_type"/>
                            <xsl:with-param name="node" select="$field6_node"/>
                            <xsl:with-param name="node2" select="$field6_node2"/>
                            <xsl:with-param name="node3" select="$field6_node3"/>
                            <xsl:with-param name="params" select="$field6_params"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="$field7_type != ''">
                        <xsl:call-template name="zus-forms-element-picker">
                            <xsl:with-param name="type" select="$field7_type"/>
                            <xsl:with-param name="node" select="$field7_node"/>
                            <xsl:with-param name="node2" select="$field7_node2"/>
                            <xsl:with-param name="node3" select="$field7_node3"/>
                            <xsl:with-param name="params" select="$field7_params"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="$field8_type != ''">
                        <xsl:call-template name="zus-forms-element-picker">
                            <xsl:with-param name="type" select="$field8_type"/>
                            <xsl:with-param name="node" select="$field8_node"/>
                            <xsl:with-param name="node2" select="$field8_node2"/>
                            <xsl:with-param name="node3" select="$field8_node3"/>
                            <xsl:with-param name="params" select="$field8_params"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="$field9_type != ''">
                        <xsl:call-template name="zus-forms-element-picker">
                            <xsl:with-param name="type" select="$field9_type"/>
                            <xsl:with-param name="node" select="$field9_node"/>
                            <xsl:with-param name="node2" select="$field9_node2"/>
                            <xsl:with-param name="node3" select="$field9_node3"/>
                            <xsl:with-param name="params" select="$field9_params"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="$field10_type != ''">
                        <xsl:call-template name="zus-forms-element-picker">
                            <xsl:with-param name="type" select="$field10_type"/>
                            <xsl:with-param name="node" select="$field10_node"/>
                            <xsl:with-param name="node2" select="$field10_node2"/>
                            <xsl:with-param name="node3" select="$field10_node3"/>
                            <xsl:with-param name="params" select="$field10_params"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="$field11_type != ''">
                        <xsl:call-template name="zus-forms-element-picker">
                            <xsl:with-param name="type" select="$field11_type"/>
                            <xsl:with-param name="node" select="$field11_node"/>
                            <xsl:with-param name="node2" select="$field11_node2"/>
                            <xsl:with-param name="node3" select="$field11_node3"/>
                            <xsl:with-param name="params" select="$field11_params"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:if test="$field12_type != ''">
                        <xsl:call-template name="zus-forms-element-picker">
                            <xsl:with-param name="type" select="$field12_type"/>
                            <xsl:with-param name="node" select="$field12_node"/>
                            <xsl:with-param name="node2" select="$field12_node2"/>
                            <xsl:with-param name="node3" select="$field12_node3"/>
                            <xsl:with-param name="params" select="$field12_params"/>
                        </xsl:call-template>
                    </xsl:if>
                    <!-- #endregion Fields 1 to 12 -->
    
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <!-- Gotowe formularze - Dane osobowe uniwersalne -->
        <xsl:template name="zus-forms-universal-dane-osobowe">
            <xsl:param name="top"/>
            <xsl:param name="height" select="330"/>
            <xsl:param name="title" select="'Dane wnioskodawcy'"/>
            <xsl:param name="no-header" select="'false'"/>
    
            <xsl:param name="pesel" select="''"/>
            <xsl:param name="peselShowEmpty" select="1"/>
    
            <xsl:param name="rodzajdokumentu" select="''"/>
            <xsl:param name="seriadokumentu" select="''"/>
            <xsl:param name="rodzajiseriadokumentuShowEmpty" select="1"/>
    
            <xsl:param name="dataurodzenia" select="''"/>
            <xsl:param name="dataurodzeniaShowEmpty" select="1"/>
    
            <xsl:param name="imie" select="''"/>
            <xsl:param name="imieShowEmpty" select="1"/>
    
            <xsl:param name="drugieimie" select="''"/>
            <xsl:param name="drugieimieShowEmpty" select="1"/>
    
            <xsl:param name="nazwisko" select="''"/>
            <xsl:param name="nazwiskoShowEmpty" select="1"/>
    
            <xsl:param name="stancywilny" select="''"/>
            <xsl:param name="stancywilnyShowEmpty" select="1"/>
    
            <xsl:param name="obywatelstwo" select="''"/>
            <xsl:param name="obywatelstwoShowEmpty" select="1"/>
    
            <xsl:call-template name="zus-section">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="height" select="$height"/>
                <xsl:with-param name="header" select="$title"/>
                <xsl:with-param name="no-header" select="$no-header"/>
                <xsl:with-param name="content">
    
                    <xsl:variable name="currentTop" select="0"/>
    
                    <xsl:if test="string($pesel) != '' or $peselShowEmpty = 1 or $peselShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-patternbox">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="title" select="'PESEL'"/>
                            <xsl:with-param name="pattern" select="'xxxxxxxxxxx'"/>
    
                            <xsl:with-param name="node" select="$pesel"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="peselTop">
                        <xsl:choose>
                            <xsl:when test="string($pesel) != '' or $peselShowEmpty = 1 or $peselShowEmpty = 'true'">
                                <xsl:value-of select="$currentTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$currentTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:variable name="rodzajIseriaString">
                        <xsl:choose>
                            <xsl:when test="string($rodzajdokumentu) = '1'">
                                <xsl:value-of select="concat('DOWÓD OSOBISTY', ' ', $seriadokumentu)"/>
                            </xsl:when>
                            <xsl:when test="string($rodzajdokumentu) = '2'">
                                <xsl:value-of select="concat('PASZPORT LUB INNY DOK.', ' ', $seriadokumentu)"/>
                            </xsl:when>
                            <xsl:when test="string($seriadokumentu) = ''">
                                <xsl:value-of select="''"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="concat('PASZPORT LUB INNY DOK.', ' ', $seriadokumentu)"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($rodzajdokumentu) != '' or string($seriadokumentu) != '' or $rodzajiseriadokumentuShowEmpty = 1 or $rodzajiseriadokumentuShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$peselTop"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="title" select="'Rodzaj, seria i numer dokumentu;potwierdzającego tożsamość'"/>
                            <xsl:with-param name="detail" select="'Podaj, jeśli nie masz nadanego numeru PESEL'"/>
                            <xsl:with-param name="node" select="$rodzajIseriaString"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="rodzajiseriadokumentuTop">
                        <xsl:choose>
                            <xsl:when test="string($rodzajdokumentu) != '' or $rodzajiseriadokumentuShowEmpty = 1 or $rodzajiseriadokumentuShowEmpty = 'true'">
                                <xsl:value-of select="$peselTop + 50"/>
                            </xsl:when>
                            <xsl:when test="string($seriadokumentu) != '' or $rodzajiseriadokumentuShowEmpty = 1 or $rodzajiseriadokumentuShowEmpty = 'true'">
                                <xsl:value-of select="$peselTop + 50"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$peselTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($dataurodzenia) != '' or $dataurodzeniaShowEmpty = 1 or $dataurodzeniaShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-patternbox">
                            <xsl:with-param name="top" select="$rodzajiseriadokumentuTop"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="title" select="'Data urodzenia'"/>
                            <xsl:with-param name="pattern" select="'xLxLxxxx'"/>
                            <xsl:with-param name="format" select="'xsdate'"/>
    
                            <xsl:with-param name="node" select="$dataurodzenia"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="dataurodzeniaTop">
                        <xsl:choose>
                            <xsl:when test="string($dataurodzenia) != '' or $dataurodzeniaShowEmpty = 1 or $dataurodzeniaShowEmpty = 'true'">
                                <xsl:value-of select="$rodzajiseriadokumentuTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$rodzajiseriadokumentuTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($imie) != '' or $imieShowEmpty = 1 or $imieShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$dataurodzeniaTop"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="title" select="'Imię'"/>
                            <xsl:with-param name="node" select="$imie"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="imieTop">
                        <xsl:choose>
                            <xsl:when test="string($imie) != '' or $imieShowEmpty = 1 or $imieShowEmpty = 'true'">
                                <xsl:value-of select="$dataurodzeniaTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$dataurodzeniaTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($drugieimie) != '' or $drugieimieShowEmpty = 1 or $drugieimieShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$imieTop"/>
                            <xsl:with-param name="title" select="'Drugie imię'"/>
                            <xsl:with-param name="node" select="$drugieimie"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="drugieimieTop">
                        <xsl:choose>
                            <xsl:when test="string($drugieimie) != '' or $drugieimieShowEmpty = 1 or $drugieimieShowEmpty = 'true'">
                                <xsl:value-of select="$imieTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$imieTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($nazwisko) != '' or $nazwiskoShowEmpty = 1 or $nazwiskoShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$drugieimieTop"/>
                            <xsl:with-param name="title" select="'Nazwisko'"/>
                            <xsl:with-param name="node" select="$nazwisko"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="nazwiskoTop">
                        <xsl:choose>
                            <xsl:when test="string($nazwisko) != '' or $nazwiskoShowEmpty = 1 or $nazwiskoShowEmpty = 'true'">
                                <xsl:value-of select="$drugieimieTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$drugieimieTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($stancywilny) != '' or $stancywilnyShowEmpty = 1 or $stancywilnyShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$nazwiskoTop"/>
                            <xsl:with-param name="title" select="'Stan cywilny'"/>
                            <xsl:with-param name="node" select="$stancywilny"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="stancywilnyTop">
                        <xsl:choose>
                            <xsl:when test="string($stancywilny) != '' or $stancywilnyShowEmpty = 1 or $stancywilnyShowEmpty = 'true'">
                                <xsl:value-of select="$nazwiskoTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$nazwiskoTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($obywatelstwo) != '' or $obywatelstwoShowEmpty = 1 or $obywatelstwoShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$stancywilnyTop"/>
                            <xsl:with-param name="title" select="'Obywatelstwo'"/>
                            <xsl:with-param name="node" select="$obywatelstwo"/>
                        </xsl:call-template>
                    </xsl:if>
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <!-- Gotowe formularze - Dane adresowe uniwersalne -->
        <xsl:template name="zus-forms-universal-dane-adresowe">
            <xsl:param name="top"/>
            <xsl:param name="height" select="480"/>
            <xsl:param name="title" select="'Adres'"/>
            <xsl:param name="no-header" select="'false'"/>
    
            <xsl:param name="ulica" select="''"/>
            <xsl:param name="ulicaShowEmpty" select="1"/>
    
            <xsl:param name="numerdomu" select="''"/>
            <xsl:param name="numerdomuShowEmpty" select="1"/>
    
            <xsl:param name="numerlokalu" select="''"/>
            <xsl:param name="numerlokaluShowEmpty" select="1"/>
    
            <xsl:param name="kodpocztowyPolski" select="''"/>
            <xsl:param name="kodpocztowyPolskiShowEmpty" select="1"/>
    
            <xsl:param name="kodpocztowyZagraniczny" select="''"/>
            <xsl:param name="kodpocztowyZagranicznyShowEmpty" select="1"/>
    
            <xsl:param name="miejscowosc" select="''"/>
            <xsl:param name="miejscowoscShowEmpty" select="1"/>
    
            <xsl:param name="gminadzielnica" select="''"/>
            <xsl:param name="gminadzielnicaShowEmpty" select="1"/>
    
            <xsl:param name="powiat" select="''"/>
            <xsl:param name="powiatShowEmpty" select="1"/>
    
            <xsl:param name="wojewodztwo" select="''"/>
            <xsl:param name="wojewodztwoShowEmpty" select="1"/>
    
            <xsl:param name="panstwo" select="''"/>
            <xsl:param name="panstwoShowEmpty" select="1"/>
    
            <xsl:param name="datazamieszkaniazagranica" select="''"/>
            <xsl:param name="datazamieszkaniazagranicaShowEmpty" select="1"/>
    
            <xsl:param name="numertelefonu" select="''"/>
            <xsl:param name="numertelefonuShowEmpty" select="1"/>
    
            <xsl:param name="adresemail" select="''"/>
            <xsl:param name="adresemailShowEmpty" select="1"/>
    
            <xsl:call-template name="zus-section">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="height" select="$height"/>
                <xsl:with-param name="header" select="$title"/>
                <xsl:with-param name="no-header" select="$no-header"/>
                <xsl:with-param name="content">
    
                    <xsl:variable name="currentTop" select="0"/>
    
                    <xsl:if test="string($ulica) != '' or $ulicaShowEmpty = 1 or $ulicaShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$currentTop"/>
                            <xsl:with-param name="title" select="'Ulica'"/>
                            <xsl:with-param name="node" select="$ulica"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="ulicaTop">
                        <xsl:choose>
                            <xsl:when test="string($ulica) != '' or $ulicaShowEmpty = 1 or $ulicaShowEmpty = 'true'">
                                <xsl:value-of select="$currentTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$currentTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($numerdomu) != '' or $numerdomuShowEmpty = 1 or $numerdomuShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$ulicaTop"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="width" select="366"/>
                            <xsl:with-param name="boxWidth" select="150"/>
    
                            <xsl:with-param name="title" select="'Numer domu'"/>
                            <xsl:with-param name="node" select="$numerdomu"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="numerLokaluLeft">
                        <xsl:choose>
                            <xsl:when test="string($numerdomu) != '' or $numerdomuShowEmpty = 1 or $numerdomuShowEmpty = 'true'">
                                <xsl:value-of select="466"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="0"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($numerlokalu) != '' or $numerlokaluShowEmpty = 1 or $numerlokaluShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$ulicaTop"/>
                            <xsl:with-param name="left" select="$numerLokaluLeft"/>
    
                            <xsl:with-param name="width" select="366"/>
    
                            <xsl:with-param name="labelWidth" select="156"/>
                            <xsl:with-param name="boxWidth" select="198"/>
    
                            <xsl:with-param name="title" select="'Numer lokalu'"/>
                            <xsl:with-param name="node" select="$numerlokalu"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="numerdomuTop">
                        <xsl:choose>
                            <xsl:when test="string($numerdomu) != '' or $numerdomuShowEmpty = 1 or $numerdomuShowEmpty = 'true'">
                                <xsl:value-of select="$ulicaTop + 40"/>
                            </xsl:when>
                            <xsl:when test="string($numerlokalu) != '' or $numerlokaluShowEmpty = 1 or $numerlokaluShowEmpty = 'true'">
                                <xsl:value-of select="$ulicaTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$ulicaTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:variable name="kodpocztowyPolskiTitle">
                        <xsl:choose>
                            <xsl:when test="string($kodpocztowyZagraniczny) != '' or $kodpocztowyZagranicznyShowEmpty = 1 or $kodpocztowyZagranicznyShowEmpty = 'true'">
                                <xsl:value-of select="'Polski kod pocztowy'"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="'Kod pocztowy'"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($kodpocztowyPolski) != '' or $kodpocztowyPolskiShowEmpty = 1 or $kodpocztowyPolskiShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$numerdomuTop"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="width" select="366"/>
                            <xsl:with-param name="boxWidth" select="150"/>
    
                            <xsl:with-param name="title" select="$kodpocztowyPolskiTitle"/>
                            <xsl:with-param name="node" select="$kodpocztowyPolski"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="kodpocztowyZagranicznyLeft">
                        <xsl:choose>
                            <xsl:when test="string($kodpocztowyPolski) != '' or $kodpocztowyPolskiShowEmpty = 1 or $kodpocztowyPolskiShowEmpty = 'true'">
                                <xsl:value-of select="466"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="0"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($kodpocztowyZagraniczny) != '' or $kodpocztowyZagranicznyShowEmpty = 1 or $kodpocztowyZagranicznyShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$numerdomuTop"/>
                            <xsl:with-param name="left" select="$kodpocztowyZagranicznyLeft"/>
    
                            <xsl:with-param name="width" select="366"/>
    
                            <xsl:with-param name="labelWidth" select="156"/>
                            <xsl:with-param name="boxWidth" select="198"/>
    
                            <xsl:with-param name="title" select="'Zagraniczny kod pocztowy'"/>
                            <xsl:with-param name="node" select="$kodpocztowyZagraniczny"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="kodpocztowyTop">
                        <xsl:choose>
                            <xsl:when test="string($kodpocztowyPolski) != '' or $kodpocztowyPolskiShowEmpty = 1 or $kodpocztowyPolskiShowEmpty = 'true'">
                                <xsl:value-of select="$numerdomuTop + 40"/>
                            </xsl:when>
                            <xsl:when test="string($kodpocztowyZagraniczny) != '' or $kodpocztowyZagranicznyShowEmpty = 1 or $kodpocztowyZagranicznyShowEmpty = 'true'">
                                <xsl:value-of select="$numerdomuTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$numerdomuTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($miejscowosc) != '' or $miejscowoscShowEmpty = 1 or $miejscowoscShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$kodpocztowyTop"/>
                            <xsl:with-param name="title" select="'Miejscowość'"/>
                            <xsl:with-param name="node" select="$miejscowosc"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="miejscowoscTop">
                        <xsl:choose>
                            <xsl:when test="string($miejscowosc) != '' or $miejscowoscShowEmpty = 1 or $miejscowoscShowEmpty = 'true'">
                                <xsl:value-of select="$kodpocztowyTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$kodpocztowyTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($gminadzielnica) != '' or $gminadzielnicaShowEmpty = 1 or $gminadzielnicaShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$miejscowoscTop"/>
                            <xsl:with-param name="title" select="'Gmina/dzielnica'"/>
                            <xsl:with-param name="node" select="$gminadzielnica"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="gminadzielnicaTop">
                        <xsl:choose>
                            <xsl:when test="string($gminadzielnica) != '' or $gminadzielnicaShowEmpty = 1 or $gminadzielnicaShowEmpty = 'true'">
                                <xsl:value-of select="$miejscowoscTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$miejscowoscTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($powiat) != '' or $powiatShowEmpty = 1 or $powiatShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$gminadzielnicaTop"/>
                            <xsl:with-param name="title" select="'Powiat'"/>
                            <xsl:with-param name="node" select="$powiat"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="powiatTop">
                        <xsl:choose>
                            <xsl:when test="string($powiat) != '' or $powiatShowEmpty = 1 or $powiatShowEmpty = 'true'">
                                <xsl:value-of select="$gminadzielnicaTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$gminadzielnicaTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($wojewodztwo) != '' or $wojewodztwoShowEmpty = 1 or $wojewodztwoShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$powiatTop"/>
                            <xsl:with-param name="title" select="'Województwo'"/>
                            <xsl:with-param name="node" select="$wojewodztwo"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="wojewodztwoTop">
                        <xsl:choose>
                            <xsl:when test="string($wojewodztwo) != '' or $wojewodztwoShowEmpty = 1 or $wojewodztwoShowEmpty = 'true'">
                                <xsl:value-of select="$powiatTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$powiatTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($panstwo) != '' or $panstwoShowEmpty = 1 or $panstwoShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$wojewodztwoTop"/>
                            <xsl:with-param name="title" select="'Państwo zamieszkania'"/>
                            <xsl:with-param name="node" select="$panstwo"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="panstwoTop">
                        <xsl:choose>
                            <xsl:when test="string($panstwo) != '' or $panstwoShowEmpty = 1 or $panstwoShowEmpty = 'true'">
                                <xsl:value-of select="$wojewodztwoTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$wojewodztwoTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($datazamieszkaniazagranica) != '' or $datazamieszkaniazagranicaShowEmpty = 1 or $datazamieszkaniazagranicaShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-patternbox">
                            <xsl:with-param name="top" select="$panstwoTop"/>
                            <xsl:with-param name="title" select="'Data rozpoczęcia zamieszkania w państwie;UE/EFTA albo w Wielkiej Brytanii'"/>
                            <xsl:with-param name="pattern" select="'xLxLxxxx'"/>
                            <xsl:with-param name="format" select="'xsdate'"/>
    
                            <xsl:with-param name="node" select="$datazamieszkaniazagranica"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="datazamieszkaniazagranicaTop">
                        <xsl:choose>
                            <xsl:when test="string($datazamieszkaniazagranica) != '' or $datazamieszkaniazagranicaShowEmpty = 1 or $datazamieszkaniazagranicaShowEmpty = 'true'">
                                <xsl:value-of select="$panstwoTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$panstwoTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($numertelefonu) != '' or $numertelefonuShowEmpty = 1 or $numertelefonuShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$datazamieszkaniazagranicaTop"/>
                            <xsl:with-param name="title" select="'Numer telefonu'"/>
                            <xsl:with-param name="node" select="$numertelefonu"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="numertelefonuTop">
                        <xsl:choose>
                            <xsl:when test="string($numertelefonu) != '' or $numertelefonuShowEmpty = 1 or $numertelefonuShowEmpty = 'true'">
                                <xsl:value-of select="$datazamieszkaniazagranicaTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$datazamieszkaniazagranicaTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($adresemail) != '' or $adresemailShowEmpty = 1 or $adresemailShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$numertelefonuTop"/>
                            <xsl:with-param name="title" select="'Adres e-mail'"/>
                            <xsl:with-param name="node" select="$adresemail"/>
                        </xsl:call-template>
                    </xsl:if>
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <!-- Gotowe formularze - Dane osobowe uniwersalne -->
        <xsl:template name="zus-forms-universal-dane-firmowe">
            <xsl:param name="top"/>
            <xsl:param name="height" select="330"/>
            <xsl:param name="title" select="'Dane płatnika'"/>
            <xsl:param name="no-header" select="'false'"/>
    
            <xsl:param name="nip" select="''"/>
            <xsl:param name="nipShowEmpty" select="1"/>
    
            <xsl:param name="pesel" select="''"/>
            <xsl:param name="peselShowEmpty" select="1"/>
    
            <xsl:param name="rodzajdokumentu" select="''"/>
            <xsl:param name="seriadokumentu" select="''"/>
            <xsl:param name="rodzajiseriadokumentuShowEmpty" select="1"/>
    
            <xsl:param name="imie" select="''"/>
            <xsl:param name="imieShowEmpty" select="1"/>
    
            <xsl:param name="nazwisko" select="''"/>
            <xsl:param name="nazwiskoShowEmpty" select="1"/>
    
            <xsl:param name="numertelefonu" select="''"/>
            <xsl:param name="numertelefonuShowEmpty" select="1"/>
    
    
            <xsl:call-template name="zus-section">
                <xsl:with-param name="top" select="$top"/>
                <xsl:with-param name="height" select="$height"/>
                <xsl:with-param name="header" select="$title"/>
                <xsl:with-param name="no-header" select="$no-header"/>
                <xsl:with-param name="content">
    
                    <xsl:variable name="currentTop" select="0"/>
    
                    <xsl:if test="string($nip) != '' or $nipShowEmpty = 1 or $nipShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-patternbox">
                            <xsl:with-param name="top" select="0"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="title" select="'NIP'"/>
                            <xsl:with-param name="pattern" select="'xxxxxxxxxx'"/>
    
                            <xsl:with-param name="node" select="$nip"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="nipTop">
                        <xsl:choose>
                            <xsl:when test="string($nip) != '' or $nipShowEmpty = 1 or $nipShowEmpty = 'true'">
                                <xsl:value-of select="$currentTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$currentTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($pesel) != '' or $peselShowEmpty = 1 or $peselShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-patternbox">
                            <xsl:with-param name="top" select="$nipTop"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="title" select="'PESEL'"/>
                            <xsl:with-param name="pattern" select="'xxxxxxxxxxx'"/>
    
                            <xsl:with-param name="node" select="$pesel"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="peselTop">
                        <xsl:choose>
                            <xsl:when test="string($pesel) != '' or $peselShowEmpty = 1 or $peselShowEmpty = 'true'">
                                <xsl:value-of select="$nipTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$nipTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:variable name="rodzajIseriaString">
                        <xsl:choose>
                            <xsl:when test="string($rodzajdokumentu) = '1'">
                                <xsl:value-of select="concat('DOWÓD OSOBISTY', ' ', $seriadokumentu)"/>
                            </xsl:when>
                            <xsl:when test="string($rodzajdokumentu) = '2'">
                                <xsl:value-of select="concat('PASZPORT LUB INNY DOK.', ' ', $seriadokumentu)"/>
                            </xsl:when>
                            <xsl:when test="string($seriadokumentu) = ''">
                                <xsl:value-of select="''"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="concat('PASZPORT LUB INNY DOK.', ' ', $seriadokumentu)"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($rodzajdokumentu) != '' or string($seriadokumentu) != '' or $rodzajiseriadokumentuShowEmpty = 1 or $rodzajiseriadokumentuShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$peselTop"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="title" select="'Rodzaj, seria i numer dokumentu;potwierdzającego tożsamość'"/>
                            <xsl:with-param name="detail" select="'Podaj, jeśli nie masz nadanego numeru PESEL'"/>
                            <xsl:with-param name="node" select="$rodzajIseriaString"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="rodzajiseriadokumentuTop">
                        <xsl:choose>
                            <xsl:when test="string($rodzajdokumentu) != '' or $rodzajiseriadokumentuShowEmpty = 1 or $rodzajiseriadokumentuShowEmpty = 'true'">
                                <xsl:value-of select="$peselTop + 50"/>
                            </xsl:when>
                            <xsl:when test="string($seriadokumentu) != '' or $rodzajiseriadokumentuShowEmpty = 1 or $rodzajiseriadokumentuShowEmpty = 'true'">
                                <xsl:value-of select="$peselTop + 50"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$peselTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($imie) != '' or $imieShowEmpty = 1 or $imieShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$rodzajiseriadokumentuTop"/>
                            <xsl:with-param name="left" select="0"/>
    
                            <xsl:with-param name="title" select="'Imię'"/>
                            <xsl:with-param name="node" select="$imie"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="imieTop">
                        <xsl:choose>
                            <xsl:when test="string($imie) != '' or $imieShowEmpty = 1 or $imieShowEmpty = 'true'">
                                <xsl:value-of select="$rodzajiseriadokumentuTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$rodzajiseriadokumentuTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($nazwisko) != '' or $nazwiskoShowEmpty = 1 or $nazwiskoShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$imieTop"/>
                            <xsl:with-param name="title" select="'Nazwisko'"/>
                            <xsl:with-param name="node" select="$nazwisko"/>
                        </xsl:call-template>
                    </xsl:if>
    
                    <xsl:variable name="nazwiskoTop">
                        <xsl:choose>
                            <xsl:when test="string($nazwisko) != '' or $nazwiskoShowEmpty = 1 or $nazwiskoShowEmpty = 'true'">
                                <xsl:value-of select="$imieTop + 40"/>
                            </xsl:when>
                            <xsl:otherwise>
                                <xsl:value-of select="$imieTop"/>
                            </xsl:otherwise>
                        </xsl:choose>
                    </xsl:variable>
    
                    <xsl:if test="string($numertelefonu) != '' or $numertelefonuShowEmpty = 1 or $numertelefonuShowEmpty = 'true'">
                        <xsl:call-template name="zus-forms-element-textfield">
                            <xsl:with-param name="top" select="$nazwiskoTop"/>
                            <xsl:with-param name="title" select="'Numer telefonu'"/>
                            <xsl:with-param name="node" select="$numertelefonu"/>
                            <xsl:with-param name="detail" select="'Jeśli podasz nam tę informację, ułatwi nam to kontakt w Twojej sprawie. To pole jest dobrowolne.'"/>
                        </xsl:call-template>
                    </xsl:if>
                </xsl:with-param>
            </xsl:call-template>
        </xsl:template>
    
        <!-- Formatery danych -->
        <xsl:template name="zus-format-xsdate-tostring">
            <xsl:param name="date"/>
    
            <xsl:choose>
                <xsl:when test="string($date) != ''">
                    <xsl:value-of select="concat(                     substring($date, 9, 2), ' / ',                     substring($date, 6, 2), ' / ',                     substring($date, 1, 4)                 )"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="''"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:template>
    
        <xsl:template name="zus-format-xsdate">
            <xsl:param name="date"/>
    
            <xsl:choose>
                <xsl:when test="string($date) != ''">
                    <xsl:value-of select="concat(                     substring($date, 9, 2),                     substring($date, 6, 2),                     substring($date, 1, 4)                 )"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="''"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:template>
    
        <xsl:template name="zus-format-concat">
            <xsl:param name="nodes" select="/.."/>
            <xsl:param name="delimiter" select="','"/>
            <xsl:param name="result" select="''"/>
    
            <xsl:choose>
                <xsl:when test="count($nodes) &gt; 0">
                    <xsl:variable name="newResult">
                        <xsl:value-of select="$result"/>
                        <xsl:value-of select="$nodes[1]"/>
                        <xsl:if test="count($nodes) &gt; 1"><xsl:value-of select="$delimiter"/></xsl:if>
                    </xsl:variable>
                    <xsl:call-template name="zus-format-concat">
                        <xsl:with-param name="nodes" select="$nodes[position() &gt; 1]"/>
                        <xsl:with-param name="delimiter" select="$delimiter"/>
                        <xsl:with-param name="result" select="$newResult"/>
                    </xsl:call-template>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="$result"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:template>
    
        <xsl:template name="zus-data-extract-param">
            <xsl:param name="params"/>
            <xsl:param name="key"/>
            <xsl:param name="default" select="''"/> <!-- Default value parameter -->
    
            <xsl:variable name="param-pattern" select="concat($key, '=')"/>
            <xsl:variable name="start" select="contains($params, $param-pattern)"/>
    
            <xsl:choose>
                <xsl:when test="$start">
                    <!-- Extract the substring after the key -->
                    <xsl:variable name="after-key" select="substring-after($params, $param-pattern)"/>
                    <!-- Get the value up to the next pipe (|) separator or end of string -->
                    <xsl:choose>
                        <xsl:when test="contains($after-key, '|')">
                            <xsl:value-of select="substring-before($after-key, '|')"/>
                        </xsl:when>
                        <xsl:otherwise>
                            <!-- If no | separator, use the remaining string as the value -->
                            <xsl:value-of select="$after-key"/>
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:when>
                <xsl:otherwise>
                    <!-- Return default if key is not found -->
                    <xsl:value-of select="$default"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:template>
        <!-- #endregion -->
    
    </xsl:stylesheet>