/* KME B2B Login - Style formularza i modala */

/* Wrapper glowny */
.kme-b2b-wrapper {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

/* Ramka formularza */
.kme-b2b-box {
    background: #ffffff;
    border: 1px solid #e8e8e9;
    border-radius: 4px;
    padding: 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Tytul formularza */
.kme-b2b-title {
    font-family: Yantramanav, sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: #001659;
    margin: 0 0 30px 0;
    text-align: center;
}

/* Komunikat bledu */
.kme-b2b-error {
    background: #fff3f3;
    border: 1px solid #ffbbbb;
    border-radius: 3px;
    color: #cc0000;
    font-family: Yantramanav, sans-serif;
    font-size: 14px;
    margin-bottom: 20px;
    padding: 10px 15px;
}

/* Pojedyncze pole formularza */
.kme-b2b-field {
    margin-bottom: 20px;
}

/* Etykieta pola */
.kme-b2b-field label {
    display: block;
    font-family: Yantramanav, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    margin-bottom: 6px;
}

/* Pole tekstowe i haslo */
.kme-b2b-field input[type="text"],
.kme-b2b-field input[type="password"],
.kme-b2b-field input[type="email"] {
    width: 100%;
    height: 44px;
    border: 1px solid #e8e8e9;
    border-radius: 3px;
    font-family: Yantramanav, sans-serif;
    font-size: 15px;
    color: #333333;
    padding: 0 14px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.kme-b2b-field input[type="text"]:focus,
.kme-b2b-field input[type="password"]:focus,
.kme-b2b-field input[type="email"]:focus {
    border-color: #001659;
    outline: none;
}

/* Checkbox zapamietaj mnie */
.kme-b2b-remember label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.kme-b2b-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Przycisk logowania */
.kme-b2b-submit {
    width: 100%;
    height: 48px;
    background: #ffbb00;
    border: none;
    border-radius: 3px;
    font-family: Yantramanav, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #001659;
    cursor: pointer;
    transition: background 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kme-b2b-submit:hover {
    background: #e6a800;
}

/* Panel zalogowanego uzytkownika */
.kme-b2b-user-panel {
    background: #f8f9fa;
    border: 1px solid #e8e8e9;
    border-radius: 4px;
    padding: 24px 30px;
    font-family: Yantramanav, sans-serif;
}

.kme-b2b-welcome {
    font-size: 18px;
    color: #001659;
    margin: 0 0 10px 0;
}

.kme-b2b-client-id {
    font-size: 15px;
    color: #555555;
    margin: 0 0 20px 0;
}

/* Link wylogowania */
.kme-b2b-logout {
    display: inline-block;
    font-family: Yantramanav, sans-serif;
    font-size: 14px;
    color: #001659;
    text-decoration: underline;
    cursor: pointer;
}

.kme-b2b-logout:hover {
    color: #ffbb00;
}

/* ================================================
   MODAL
   ================================================ */

/* Kontener modala - domyslnie ukryty */
.kme-b2b-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

/* Modal widoczny po dodaniu klasy przez JS */
.kme-b2b-modal.kme-b2b-modal--open {
    display: flex;
}

/* Ciemne tlo modala */
.kme-b2b-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

/* Biala ramka modala */
.kme-b2b-modal__box {
    position: relative;
    background: #ffffff;
    border-radius: 4px;
    padding: 40px;
    width: 100%;
    max-width: 480px;
    margin: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

/* Przycisk zamkniecia X */
.kme-b2b-modal__close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
}

.kme-b2b-modal__close:hover {
    color: #001659;
}

/* Blokada scrolla gdy modal jest otwarty */
body.kme-b2b-no-scroll {
    overflow: hidden;
}

/* Responsywnosc - mobile */
@media only screen and (max-width: 480px) {
    .kme-b2b-box,
    .kme-b2b-modal__box {
        padding: 24px 20px;
    }
    .kme-b2b-title {
        font-size: 22px;
    }
}

/* Pasek powitalny zalogowanego uzytkownika */
.kme-b2b-welcome-bar {
    display: none;
    align-items: center;
    gap: 8px;
    font-family: Yantramanav, sans-serif;
    font-size: 13px;
    color: #001659;
    margin-right: 12px;
    line-height: 1;
}

.kme-b2b-welcome-bar__text {
    color: #001659;
    font-size: 13px;
    font-family: Yantramanav, sans-serif;
    line-height: 1;
    vertical-align: middle;
}

.kme-b2b-welcome-bar__logout {
    color: #001659;
    text-decoration: underline;
    font-size: 13px;
    font-family: Yantramanav, sans-serif;
    line-height: 1;
    vertical-align: middle;
    transition: color 0.2s ease;
}

.kme-b2b-welcome-bar__logout:hover {
    color: #ffbb00;
}

/* Dropdown profilu zalogowanego uzytkownika */
.kme-b2b-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 69px;
    z-index: 99999;
    min-width: 200px;
}

.kme-b2b-dropdown--open {
    display: block;
}

.kme-b2b-dropdown__box {
    background: #ffffff;
    border: 1px solid #e8e8e9;
    border-radius: 4px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.kme-b2b-dropdown__welcome {
    font-family: Yantramanav, sans-serif;
    font-size: 14px;
    color: #001659;
    font-weight: 600;
    margin: 0 0 12px 0;
    text-align: left;
}

.kme-b2b-dropdown__logout {
    display: block;
    width: 100%;
    height: 36px;
    background: #ffbb00;
    border: none;
    border-radius: 3px;
    font-family: Yantramanav, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #001659;
    text-align: center;
    line-height: 36px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s ease;
    box-sizing: border-box;
}

.kme-b2b-dropdown__logout:hover {
    background: #e6a800;
    color: #001659;
}

.kme-b2b-dropdown__box {
    outline: none;
}

.kme-b2b-dropdown a:focus,
.kme-b2b-dropdown a:active,
.kme-b2b-dropdown button:focus,
.kme-b2b-dropdown button:active {
    outline: none;
    box-shadow: none;
}

/* ================================================
   MODAL KONTAKTOWY - FORMULARZ WSPOLPRACY
   ================================================ */

/* Szerszy modal dla formularza wspolpracy */
.kme-b2b-modal__box--wide {
    max-width: 760px;
}

/* Siatka dwukolumnowa formularza */
.kme-b2b-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
    margin-bottom: 24px;
}

/* Pole select w formularzu kontaktowym */
.kme-b2b-contact-form select {
    width: 100%;
    height: 44px;
    border: 1px solid #e8e8e9;
    border-radius: 3px;
    font-family: Yantramanav, sans-serif;
    font-size: 15px;
    color: #333333;
    padding: 0 14px;
    box-sizing: border-box;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.kme-b2b-contact-form select:focus {
    border-color: #001659;
    outline: none;
}

/* Pole input w formularzu kontaktowym */
.kme-b2b-contact-form input[type="text"],
.kme-b2b-contact-form input[type="email"],
.kme-b2b-contact-form input[type="number"] {
    width: 100%;
    height: 44px;
    border: 1px solid #e8e8e9;
    border-radius: 3px;
    font-family: Yantramanav, sans-serif;
    font-size: 15px;
    color: #333333;
    padding: 0 14px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.kme-b2b-contact-form input[type="text"]:focus,
.kme-b2b-contact-form input[type="email"]:focus,
.kme-b2b-contact-form input[type="number"]:focus {
    border-color: #001659;
    outline: none;
}

/* Przyciski na dole formularza */
.kme-b2b-contact-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.kme-b2b-contact-actions .kme-b2b-submit {
    width: auto;
    padding: 0 40px;
}

/* Link powrotu do logowania */
.kme-b2b-back-link {
    font-family: Yantramanav, sans-serif;
    font-size: 14px;
    color: #001659;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.kme-b2b-back-link:hover {
    color: #ffbb00;
}

/* Komunikat sukcesu */
.kme-b2b-success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    border-radius: 3px;
    color: #276749;
    font-family: Yantramanav, sans-serif;
    font-size: 14px;
    margin-bottom: 20px;
    padding: 10px 15px;
}

/* Responsywnosc - mobile */
@media only screen and (max-width: 600px) {
    .kme-b2b-contact-grid {
        grid-template-columns: 1fr;
    }
    .kme-b2b-modal__box--wide {
        padding: 24px 20px;
    }
}

/* Link do formularza wspolpracy pod formularzem logowania */
.kme-b2b-contact-link {
    text-align: center;
    font-family: Yantramanav, sans-serif;
    font-size: 14px;
    color: #555555;
    margin-top: 16px;
}

.kme-b2b-contact-link a {
    color: #001659;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.kme-b2b-contact-link a:hover {
    color: #ffbb00;
}

/* Pole telefonu z kodem kraju */
.kme-b2b-phone-wrapper {
    display: flex;
    gap: 0;
    width: 100%;
}

.kme-b2b-phone-code {
    width: 64px;
    flex-shrink: 0;
    height: 44px;
    border: 1px solid #e8e8e9;
    border-right: none;
    border-radius: 3px 0 0 3px;
    font-family: Yantramanav, sans-serif;
    font-size: 15px;
    color: #333333;
    padding: 0 8px;
    box-sizing: border-box;
    background: #f5f5f5;
    text-align: center;
}

.kme-b2b-phone-number {
    flex: 1;
    height: 44px;
    border: 1px solid #e8e8e9;
    border-radius: 0 3px 3px 0;
    font-family: Yantramanav, sans-serif;
    font-size: 15px;
    color: #333333;
    padding: 0 14px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.kme-b2b-phone-number:focus {
    border-color: #001659;
    outline: none;
}

/* Nadpisanie konfliktow dla pola telefonu */
.kme-b2b-contact-form .kme-b2b-phone-code {
    width: 64px !important;
    border-right: none !important;
    border-radius: 3px 0 0 3px !important;
    background: #f5f5f5 !important;
    text-align: center !important;
    flex-shrink: 0 !important;
}

.kme-b2b-contact-form .kme-b2b-phone-number {
    width: auto !important;
    flex: 1 !important;
    border-radius: 0 3px 3px 0 !important;
}

/* Zmniejszenie odstepow w siatce formularza */
.kme-b2b-contact-grid .kme-b2b-field {
    margin-bottom: 0;
}

/* ================================================
   NAGLOWEK MODALA KONTAKTOWEGO Z PRZELACZNIKIEM JEZYKA
   ================================================ */

/* Naglowek modala - flex z tytułem po lewej i jezykiem po prawej */
.kme-b2b-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-right: 40px;
}

/* Tytul w naglowku - bez dolnego marginesu */
.kme-b2b-modal__header .kme-b2b-title {
    margin: 0;
    text-align: left;
    flex: 1;
}

/* Przelacznik jezyka */
.kme-b2b-lang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Etykieta "Jezyk:" */
.kme-b2b-lang-switcher label {
    font-family: Yantramanav, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #555555;
    white-space: nowrap;
    margin: 0;
}

/* Select jezyka - mniejszy niz standardowy */
.kme-b2b-lang-switcher select {
    height: 34px;
    width: auto;
    min-width: 110px;
    border: 1px solid #e8e8e9;
    border-radius: 3px;
    font-family: Yantramanav, sans-serif;
    font-size: 13px;
    color: #333333;
    padding: 0 28px 0 10px;
    box-sizing: border-box;
    background: #f8f8f8;
    cursor: pointer;
    transition: border-color 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23333' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.kme-b2b-lang-switcher select:focus {
    border-color: #001659;
    outline: none;
}

/* Separator wizualny miedzy przelacznikiem a trescia formularza */
.kme-b2b-modal__header::after {
    display: none;
}

.kme-b2b-contact-form {
    border-top: 1px solid #e8e8e9;
    padding-top: 24px;
}

/* Nadpisanie stylu Select2 dla pola kraju */
.select2-container .select2-selection--single {
    height: 44px !important;
    border: 1px solid #e8e8e9 !important;
    border-radius: 3px !important;
    font-family: Yantramanav, sans-serif !important;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    line-height: 44px !important;
    font-family: Yantramanav, sans-serif !important;
    font-size: 15px !important;
    color: #333333 !important;
    padding-left: 14px !important;
}

.select2-container .select2-selection--single .select2-selection__arrow {
    height: 44px !important;
    top: 0 !important;
    right: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.select2-container .select2-selection--single .select2-selection__arrow b {
    margin-top: 0 !important;
    top: auto !important;
    border-color: #333333 transparent transparent transparent !important;
}

.select2-container--open .select2-selection--single {
    border-color: #001659 !important;
}

.select2-dropdown {
    border: 1px solid #001659 !important;
    border-radius: 3px !important;
    font-family: Yantramanav, sans-serif !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #e8e8e9 !important;
    border-radius: 3px !important;
    font-family: Yantramanav, sans-serif !important;
    font-size: 14px !important;
    padding: 6px 10px !important;
}

.select2-results__option {
    font-family: Yantramanav, sans-serif !important;
    font-size: 14px !important;
    padding: 8px 14px !important;
}

.select2-results__option--highlighted {
    background-color: #001659 !important;
    color: #ffffff !important;
}

/* Linia oddzielajaca naglowek od pol w formularzu logowania */
.kme-b2b-login-form {
    border-top: 1px solid #e8e8e9;
    padding-top: 24px;
}

/* Podswietlenie pol z bledem walidacji */
.kme-b2b-field--error input,
.kme-b2b-field--error select,
.kme-b2b-field--error .select2-selection {
    border-color: #e53e3e !important;
    background-color: #ffffff !important;
}

.kme-b2b-field--error label {
    color: #e53e3e;
}