/**
 * Modal Login Pro — charcoal perdengimas
 *
 * MLP niekada neredaguojamas. Jo mlp-frontend.min.css tamsiajai temai
 * turi savo charcoal reikšmes, įrašytas hex'ais, o ne kintamaisiais —
 * todėl vien :root pakeitimas jų nepasiekia. Čia pakartotos tik tos
 * MLP taisyklės, kurios piešia charcoal, su V4 reikšmėmis.
 *
 * Selektoriai nurašyti iš MLP pažodžiui, todėl specifiškumas sutampa;
 * laimima eiliškumu. MLP savo stilių registruoja per wp_enqueue_scripts
 * prioritetu 10, tema — 102, tad temos lapas visada eina vėliau.
 * `!important` pakartotas lygiai ten, kur jis yra MLP pusėje.
 *
 * Dengiami ABU vartai: ir @media (prefers-color-scheme: dark), ir
 * klasėmis žymimas body.dark-mode / .mlp-dark-mode. Antrųjų yra trys
 * taisyklės, ne dvi, kaip buvo užrašyta audite.
 *
 * Pasikeitus MLP stiliams, patikra:
 *   grep -oiE "#(36454F|2A363E|1E2A32)" mlp-frontend.min.css | wc -l
 * Šis failas parašytas prie 55 hex + 4 rgb() radinių (42 taisyklės,
 * 59 deklaracijos). Skaičiui pasikeitus — peržiūrėti.
 */

@media (prefers-color-scheme: dark) {
    .mlp-modal .mlp-modal-content .mlp-form .form-row input:-webkit-autofill,
    .mlp-modal .mlp-modal-content .mlp-form .form-row input:-webkit-autofill:hover,
    .mlp-modal .mlp-modal-content .mlp-form .form-row input:-webkit-autofill:focus,
    .mlp-modal .mlp-modal-content .mlp-form .form-row input:-webkit-autofill:active,
    body .mlp-modal .mlp-modal-content .mlp-form .form-row input:-webkit-autofill:hover,
    .mlp-form .form-row input:-webkit-autofill:hover:not(:focus),
    .password-input-wrapper input:-webkit-autofill,
    .password-input-wrapper input:-webkit-autofill:hover,
    .password-input-wrapper input:-webkit-autofill:focus,
    .password-input-wrapper input:-webkit-autofill:active,
    .mlp-form .form-row.password-field input:-webkit-autofill:hover {
        -webkit-box-shadow: 0 0 0 1000px var(--w-charcoal-dark) inset !important;
        box-shadow: 0 0 0 1000px var(--w-charcoal-dark) inset !important;
        background-color: var(--w-charcoal-dark) !important;
    }

    .mlp-modal .mlp-modal-content .mlp-form .form-row input:-webkit-autofill:focus,
    body .mlp-modal .mlp-modal-content .mlp-form .form-row input:-webkit-autofill:focus,
    .mlp-modal .mlp-modal-content .mlp-form .form-row input:-webkit-autofill:focus:hover,
    .password-input-wrapper input:-webkit-autofill:focus,
    .mlp-form .form-row.password-field input:-webkit-autofill:focus {
        -webkit-box-shadow: 0 0 0 1000px var(--w-charcoal-dark) inset, 0 0 0 3px rgba(184, 149, 106, 0.2) !important;
        box-shadow: 0 0 0 1000px var(--w-charcoal-dark) inset, 0 0 0 3px rgba(184, 149, 106, 0.2) !important;
        background-color: var(--w-charcoal-dark) !important;
    }

    .mlp-modal-content,
    .mlp-tab:hover:not(.active),
    .social-divider span,
    .mlp-success-content,
    .mlp-error-content,
    .mlp-overlay-content,
    .mlp-success-modal-content {
        background-color: var(--w-charcoal);
    }

    .mlp-tabs,
    .mlp-form .form-row input,
    #mlp-remember,
    #mlp-terms-privacy-consent,
    #mlp-gdpr-consent {
        background-color: var(--w-charcoal-dark);
    }

    .mlp-form .form-row input:hover:not(:focus),
    .mlp-form .form-row input:placeholder-shown:hover:not(:focus),
    .mlp-form .form-row input:not(:placeholder-shown),
    .mlp-form .form-row input:not(:placeholder-shown):hover,
    .mlp-form .form-row input:focus,
    .mlp-form .form-row input:focus:hover,
    .mlp-form .form-row.has-error input,
    .password-input-wrapper input,
    .mlp-modal .social-button,
    .mlp-modal .social-buttons a,
    .mlp-modal a.social-button,
    .social-button,
    [data-mlp-oauth],
    .mlp-modal .social-buttons a[class*="facebook"],
    .mlp-modal .social-buttons a[class*="google"] {
        background-color: var(--w-charcoal-dark) !important;
    }

    .mlp-form .form-row label:not(.remember-label) {
        background: var(--w-charcoal) !important;
        background-color: var(--w-charcoal) !important;
    }

    .mlp-form .form-row label:not(.remember-label)::before {
        background: var(--w-charcoal);
    }

    .mlp-form .form-row:hover label:not(.remember-label),
    .mlp-form .form-row input:focus + label:not(.remember-label),
    .mlp-form .form-row input:focus ~ label:not(.remember-label),
    .mlp-form .form-row.password-field input:focus ~ label:not(.remember-label),
    .mlp-form .form-row:has(input:focus) label:not(.remember-label),
    .mlp-form .form-row.has-error label:not(.remember-label),
    .mlp-form .form-row.has-error.password-field label:not(.remember-label),
    .mlp-form .form-row.has-error .password-input-wrapper label:not(.remember-label),
    .mlp-form .form-row.has-error:hover label:not(.remember-label),
    .mlp-form .form-row.has-error input:focus + label:not(.remember-label),
    .mlp-form .form-row.has-error input:focus ~ label:not(.remember-label),
    .mlp-oauth-cancel-btn:hover {
        background: var(--w-charcoal) !important;
    }

    .mlp-modal .social-button:hover:not(:disabled):not(.mlp-oauth-loading),
    .mlp-modal .social-buttons a:hover:not(:disabled):not(.mlp-oauth-loading),
    .social-button:hover:not(:disabled):not(.mlp-oauth-loading),
    [data-mlp-oauth]:hover:not(:disabled):not(.mlp-oauth-loading) {
        background-color: var(--w-charcoal) !important;
    }

    .mlp-oauth-cancel-btn {
        background: var(--w-charcoal-dark) !important;
    }

    .mlp-lostpw-content .mlp-form-info {
        background: var(--w-charcoal-dark);
    }

    .mlp-modal .mlp-password-hints {
        background: rgba(var(--w-charcoal-dark-rgb), 0.95) !important;
    }

    .mlp-modal .mlp-consent-toggles {
        background: rgba(var(--w-charcoal-dark-rgb), 0.8) !important;
    }

}

@media (prefers-color-scheme: dark) {
    @media screen and (max-width: 375px) {
        .mlp-form .form-row label:not(.remember-label) {
            background: var(--w-charcoal) !important;
        }

    }
}

@media (prefers-color-scheme: dark) {
    @media screen and (max-width: 480px) {
        .mlp-form .form-row label:not(.remember-label) {
            background: var(--w-charcoal) !important;
        }

        .mlp-form .form-row label:not(.remember-label)::before {
            background: var(--w-charcoal);
        }

    }
}

body.dark-mode .mlp-form .form-row label:not(.remember-label),
.mlp-dark-mode .mlp-form .form-row label:not(.remember-label) {
    background: var(--w-charcoal) !important;
}

body.dark-mode .mlp-form .form-row label:not(.remember-label)::before,
.mlp-dark-mode .mlp-form .form-row label:not(.remember-label)::before {
    background: var(--w-charcoal);
}

body.dark-mode .mlp-modal .mlp-password-hints,
.mlp-dark-mode .mlp-modal .mlp-password-hints {
    background: rgba(var(--w-charcoal-dark-rgb), 0.95) !important;
}
