/* =====================
   [FORMS] 45. FORMULARZE B2B - UNIWERSALNE
===================== */

/* ===== FORMULARZE PDF (DOKUMENTY) ===== */
html.form-view,
body.form-view {
    margin: 0;
    padding: 0;
    background: #ffffff;
    color: var(--text-900);
    font-family: 'Montserrat', Arial, sans-serif;
}

.form-document {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 24px;
    box-sizing: border-box;
    background: #fff;
}

.form-document__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    border-bottom: 2px solid var(--sand-300);
    padding-bottom: 16px;
}

.form-document__title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: var(--text-900);
    letter-spacing: 0.5px;
}

.form-document__actions {
    display: flex;
    gap: 12px;
}

.btn-print {
    padding: 10px 20px;
    border: 2px solid var(--accent);
    background: var(--accent);
    color: #fff;
    border-radius: 0px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Montserrat', Arial, sans-serif;
}

.btn-print:hover {
    background: var(--sand-700);
    border-color: var(--sand-700);
}

table.form-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
    margin-bottom: 24px;
}

table.form-table td,
table.form-table th {
    border: 1px solid #ccc;
    padding: 12px 14px;
    vertical-align: top;
    word-wrap: break-word;
    background: #fff;
}

th.form-section {
    background: var(--sand-100);
    border-color: var(--sand-300);
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-900);
    letter-spacing: 0.3px;
    padding: 14px 14px;
}

td.form-fill {
    color: var(--muted-600);
    font-weight: 600;
    background: #fafafa;
}

.form-cell--large {
    height: 80px;
}

.form-cell--medium {
    height: 54px;
}

.form-cell--small {
    height: 32px;
}

.form-bg-gray {
    background: var(--sand-50) !important;
}

th.form-section.form-bg-gray {
    background: var(--sand-100) !important;
}

.form-footer {
    margin-top: 30px;
    padding-top: 16px;
    border-top: 2px solid var(--sand-300);
    font-size: 11px;
    color: var(--muted-600);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-footer__text,
.form-footer__meta {
    margin: 0;
}

.form-footer__meta {
    text-align: right;
}

ul.form-doclist {
    margin: 8px 0 0 20px;
    padding: 0;
    list-style-type: disc;
}

ul.form-doclist li {
    margin: 4px 0;
    color: var(--text-900);
    font-size: 13px;
}

.form-page {
    background: #fff;
    margin-bottom: 0;
}

.form-page+.form-page {
    page-break-before: always;
    margin-top: 40px;
}

/* ===== FORMULARZE HTML (FRONT-END) ===== */
.b2b-registration-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px;
}

.form-section {
    margin-bottom: 32px;
}

.form-section__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-900);
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--sand-300);
    letter-spacing: 0.3px;
}

.form-group {
    margin-bottom: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-900);
    margin-bottom: 8px;
    font-size: 13px;
    letter-spacing: 0.2px;
}

.form-label .required {
    color: #dc3545;
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 0px;
    font-size: 13px;
    font-family: 'Montserrat', Arial, sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: var(--card-bg);
    color: var(--text-900);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(122, 95, 59, 0.1);
}

.form-control::placeholder {
    color: var(--muted-600);
    opacity: 0.7;
}

.form-divider {
    margin: 32px 0;
    border: none;
    border-top: 1px solid var(--sand-300);
}

.form-group--checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.form-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-900);
    user-select: none;
}

.form-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

.form-section--shipping {
    background: var(--sand-50);
    padding: 20px;
    border-left: 4px solid var(--accent);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 0px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', Arial, sans-serif;
    letter-spacing: 0.3px;
}

.btn-primary:hover {
    background: var(--sand-700);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(122, 95, 59, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-lg {
    width: 100%;
    padding: 14px 32px;
    font-size: 15px;
    margin-top: 24px;
}

/* ===== DRUK ===== */
@media print {

    html.form-view,
    body.form-view {
        background: #fff;
        padding: 0;
    }

    .form-document__actions {
        display: none !important;
    }

    .form-document {
        max-width: none;
        margin: 0;
        padding: 0;
        break-before: page;
        page-break-before: always;
    }

    .form-document:first-of-type {
        break-before: auto;
        page-break-before: auto;
    }

    .form-document:not(:last-of-type) {
        break-after: page;
        page-break-after: always;
    }

    .form-footer {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    table.form-table {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    @page {
        size: A4;
        margin: 15mm;
    }
}

/* ===== RESPONSYWNOŚĆ ===== */
@media (max-width: 768px) {
    .form-document {
        padding: 20px 16px;
    }

    .form-document__header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .form-document__title {
        font-size: 20px;
    }

    .form-document__actions {
        width: 100%;
    }

    .btn-print {
        flex: 1;
        padding: 12px 16px;
    }

    table.form-table {
        font-size: 12px;
    }

    table.form-table td,
    table.form-table th {
        padding: 10px 10px;
    }

    .form-footer {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .form-footer__meta {
        text-align: left;
    }

    .b2b-registration-form {
        padding: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-section__title {
        font-size: 16px;
    }

    .btn-lg {
        font-size: 14px;
        padding: 12px 24px;
    }
}

/* ===== B2B REGISTRATION FORM - NEW RESPONSIVE DESIGN ===== */

:root {
    --sand-50: #fafbf7;
    --sand-100: #f5f4ed;
    --sand-200: #ede9db;
    --sand-300: #ddd4c1;
    --sand-400: #c4b5a0;
    --sand-500: #b19d8a;
    --sand-600: #a08b76;
    --sand-700: #8a7562;
    --text-900: #1a1a1a;
    --text-700: #4a4a4a;
    --accent: #7a5f3b;
    --accent-light: #c4a37a;
    --muted-200: #f0ede9;
    --muted-300: #e5e0d9;
}

/* Form Container */
.b2b-form {
    width: 100%;
    margin: 2rem 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-900);
    padding: 0 1.5rem;
    box-sizing: border-box;
}

.b2b-form--registration {
    border-radius: 0px;
    padding: 2.5rem;
    box-shadow: 0 4px 6px rgba(122, 95, 59, 0.08);
}

/* Two Column Layout */
.b2b-form__sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.b2b-form__column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Fieldsets */
.b2b-form__fieldset {
    border: none;
    padding: 0;
    margin: 0;
    display: block;
}

.b2b-form__legend {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent);
    border-bottom: 2px solid var(--sand-300);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    display: block;
    width: 100%;
    letter-spacing: 0.3px;
}

/* Form Grid - 2 Columns */
.b2b-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.b2b-form__field {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.b2b-form__field--full {
    grid-column: 1 / -1;
}

/* Labels */
.b2b-form__label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-700);
    margin-bottom: 0.5rem;
    display: block;
    letter-spacing: 0.2px;
}

.b2b-required {
    color: var(--accent-light);
    margin-left: 0.25rem;
    font-weight: 600;
}

/* Input Fields */
.b2b-form__input {
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 0px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-900);
    background-color: var(--card-bg);
    transition: all 0.18s ease;
    box-sizing: border-box;
}

.b2b-form__input::placeholder {
    color: var(--sand-500);
    opacity: 0.7;
}

.b2b-form__input:focus {
    outline: none;
    border-color: var(--accent);
    background-color: rgba(250, 251, 247, 0.8);
    box-shadow: 0 0 0 3px rgba(122, 95, 59, 0.1);
}

.b2b-form__input:disabled {
    background-color: var(--muted-200);
    color: var(--sand-500);
    cursor: not-allowed;
}

.b2b-form__input[type=\"text\"],
.b2b-form__input[type=\"email\"],
.b2b-form__input[type=\"tel\"],
.b2b-form__input[type=\"number\"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Checkbox */
.b2b-form__checkbox {
    margin: 2rem 0;
    padding: 1.25rem;
    background-color: var(--sand-100);
    border-radius: 0px;
    border-left: 4px solid var(--accent);
}

.b2b-form__checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.75rem;
    font-weight: 500;
    color: var(--text-900);
}

.b2b-form__checkbox-input {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent);
    border: 2px solid var(--sand-300);
    border-radius: 0px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.b2b-form__checkbox-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill=\"white\" d=\"M13.5 2L6 9.5 2.5 6\"/></svg>');
    background-size: 70%;
    background-repeat: no-repeat;
    background-position: center;
}

.b2b-form__checkbox-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(122, 95, 59, 0.15);
}

/* Submit Button */
.b2b-form__submit {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--sand-700) 100%);
    color: #fff;
    border: none;
    border-radius: 0px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.18s ease;
    text-transform: uppercase;
    box-shadow: 0 3px 8px rgba(122, 95, 59, 0.14);
    margin-top: 0.5rem;
}

.b2b-form__submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(122, 95, 59, 0.35);
}

.b2b-form__submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(122, 95, 59, 0.2);
}

.b2b-form__submit:disabled {
    background: var(--sand-400);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Shipping Section Animation */
.b2b-form__fieldset--shipping {
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tablet - Responsive */
@media (max-width: 768px) {
    .b2b-form--registration {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }

    .b2b-form__sections {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .b2b-form__row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .b2b-form__legend {
        font-size: 1.1rem;
    }

    .b2b-form__label {
        font-size: 0.9rem;
    }

    .b2b-form__input {
        padding: 0.75rem 0.875rem;
        font-size: 16px;
    }

    .b2b-form__submit {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* Mobile - Small */
@media (max-width: 480px) {
    .b2b-form {
        margin: 1rem 0;
        padding: 0 1rem;
    }

    .b2b-form__sections {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .b2b-form--registration {
        padding: 1.25rem;
        border-radius: 0px;
        box-shadow: 0 2px 4px rgba(122, 95, 59, 0.05);
    }

    .b2b-form__legend {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .b2b-form__fieldset {
        margin-bottom: 1.5rem;
    }

    .b2b-form__checkbox {
        padding: 1rem;
        margin: 1rem 0;
    }

    .b2b-form__input {
        font-size: 16px;
    }
}
