@font-face {
    font-family: 'PT Root UI';
    font-weight: 400;
    src: url('../fonts/PT-Root-UI-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'PT Root UI';
    font-weight: 300;
    src: url('../fonts/PT-Root-UI-Light.ttf') format('truetype');
}

@font-face {
    font-family: 'PT Root UI';
    font-weight: 500;
    src: url('../fonts/PT-Root-UI-Medium.ttf') format('truetype');
}

@font-face {
    font-family: 'PT Root UI';
    font-weight: 700;
    src: url('../fonts/PT-Root-UI-Bold.ttf') format('truetype');
}

#kc-locale {
    text-align: center;
    position: absolute;
    bottom: 22px;
    left: 0;
    right: 0;
}

#kc-locale .kc-dropdown {
    display: inline-block;
}

#kc-locale ul {
    display: none;
    position: absolute;
    background-color: #fff;
    list-style: none;
    bottom: 20px;
    min-width: 100px;
    padding: 2px 0;
    border: 1px solid #E6E9EC;
    border-radius: 5px;
}

#kc-locale .kc-dropdown:hover ul {
    display: block;
    margin: 0;
}

#kc-locale .kc-dropdown #kc-current-locale-link {
    font-size: 13px;
    line-height: 16px;
    text-align: right;
    letter-spacing: 0.02em;
    color: #8790A6;
}

#kc-locale ul li a {
    display: block;
    padding: 5px 14px;
    color: #000 !important;
    text-decoration: none;
    line-height: 20px;
}

#kc-locale ul li a:hover {
    color: #4d5258;
    background-color: #d4edfa;
}

#kc-locale-dropdown a {
    color: #4d5258;
    background: 0 0;
    padding: 0 15px 0 0;
    font-weight: 300;
}

#kc-locale-dropdown a:hover {
    text-decoration: none;
}

a#kc-current-locale-link {
    display: block;
    padding: 0 5px;
}

a#kc-current-locale-link::after {
    content: "\2c5";
    margin-left: 4px;
}

.login-pf body {
    background: #f8fafb;
    min-height: 100vh;
    font-family: 'PT Root UI', sans-serif !important;
}

.login-pf-page {
    position: relative;
    min-height: 100vh;
    padding-top: 36px;
    padding-bottom: 80px;
    background: #f8fafb;
}

.login-pf-page .login-pf-page-header {
    margin-bottom: 52px;
}

/* Скрываем стандартный заголовок Keycloak, чтобы не мешал */
.login-pf-page-header #kc-header-wrapper, 
#kc-header {
    display: none !important;
}

.login-pf .card-pf {
    width: 418px;
    margin-left: auto;
    margin-right: auto;
    padding: 40px 64px;
    background: #FFFFFF;
    border: 1px solid #E6E9EC;
    box-sizing: border-box;
    border-radius: 10px;
}

.login-pf-page .login-pf-header {
    margin-bottom: 0;
}

.login-pf-page .login-pf-header h1 {
    margin-top: 0;
    margin-bottom: 28px;
    text-align: center;
    font-weight: 600;
    font-size: 22px;
    line-height: 30px;
    color: #181A35;
}

.login-pf-page .form-field {
    position: relative;
    margin-bottom: 20px;
}

.login-pf-page .form-field .form-field-placeholder {
    position: absolute;
    top: 19px;
    left: 15px;
    padding: 0 5px;
    font-size: 17px;
    line-height: 16px;
    color: rgba(50, 56, 84, 0.4);
    background: white;
    transition: .3s;
    pointer-events: none;
}

.login-pf-page .form-field input:focus + .form-field-placeholder {
    top: -7px;
    font-size: 13px;
    color: #323854;
}

.login-pf-page .form-field input:not(:invalid) + .form-field-placeholder {
    top: -7px;
    font-size: 13px;
    color: #323854;
}

.login-pf-page .form-field input {
    height: 52px;
    padding: 18px 20px;
    border: 1px solid #E6E9EC;
    font-size: 17px;
    line-height: 16px;
    color: #323854;
    border-radius: 5px;
    box-shadow: none;
    font-family: 'PT Root UI', sans-serif !important;
}

.login-pf-page .form-field input::placeholder {
    font-style: normal;
    color: rgba(50, 56, 84, 0);
}

.login-pf-page .form-field.email-field input::placeholder {
    color: rgba(50, 56, 84, 0.4);
}

.login-pf-page .form-field.password-filed input {
    padding-right: 40px;
}

.login-pf-page .form-field.password-filed .show-password {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 15px;
    margin: auto;
    width: 18px;
    height: 18px;
    background: url("../img/hide-pass.svg") center center no-repeat;
    cursor: pointer;
}

.login-pf-page .form-field.password-filed .show-password.active {
    background-image: url("../img/show-pass.svg");
}

/* --- ИСПРАВЛЕННЫЙ БЛОК КНОПКИ --- */

.login-pf-page .btn-primary, 
#kc-login {
    width: 100% !important;
    height: 52px !important;
    margin-top: 24px !important;
    margin-bottom: 14px !important;
    border: none !important;
    box-shadow: none !important;
    background: #0071E3 !important; /* Насыщенный синий при активности */
    border-radius: 5px !important;
    font-weight: bold !important;
    font-size: 17px !important;
    line-height: 16px !important;
    color: #FFFFFF !important;
    text-transform: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Когда кнопка заблокирована (пустые поля) */
.login-pf-page .btn-primary[disabled], 
#kc-login:disabled {
    background: #CDE3F7 !important; /* Светло-голубой */
    color: #FFFFFF !important;
    opacity: 1 !important;
    cursor: not-allowed;
}

/* Скрываем лишние кнопки PatternFly, которые могут дублироваться в KC 26 */
.pf-c-button.pf-m-primary:not(#kc-login) {
    display: none !important;
}

/* --- КОНЕЦ БЛОКА КНОПКИ --- */

.login-pf-page .login-pf-settings .checkbox {
    margin: 0;
}

.login-pf-page .login-pf-settings .checkbox label {
    padding-left: 0;
}

.login-pf-page .login-pf-settings .checkbox input[type=checkbox] {
    position: absolute;
    z-index: -1;
    opacity: 0;
    display: block;
    width: 0;
    height: 0;
    margin: 0;
}

.login-pf-page .login-pf-settings .checkbox .checkbox-element {
    display: inline-block;
    vertical-align: middle;
    width: 20px;
    height: 20px;
    background: inherit;
    border-radius: 2px;
    border: 1px solid #E6E9EC;
    margin-right: 5px;
}

.login-pf-page .login-pf-settings .checkbox input[type=checkbox]:checked + .checkbox-element {
    background: url("../img/check.svg") center center no-repeat #0071E3;
    border: 1px solid #0071E3;
}

.login-pf-page .login-pf-settings .checkbox__text {
    display: inline-block;
    vertical-align: middle;
    font-size: 15px;
    line-height: 16px;
    letter-spacing: 0.02em;
    color: #323854;
}

.login-pf-page .login-pf-settings .forget-password-link {
    width: 100%;
    margin-top: 45px;
    text-align: center;
}

.login-pf-page .login-pf-settings .forget-password-link a {
    text-decoration: underline;
    font-size: 14px;
    line-height: 16px;
    letter-spacing: 0.02em;
    color: #0071E3;
}

.login-pf-page .invalid-verification-error {
    position: relative;
    display: none;
    margin-top: 28px;
    padding-left: 25px;
}

.login-pf-page .invalid-verification-error:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    display: inline-block;
    width: 18px;
    height: 16px;
    background: url("../img/alert.svg") center center no-repeat;
}

.login-pf-page .invalid-verification-error .invalid-verification-error_text {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 16px;
    letter-spacing: 0.02em;
    color: #323B54;
}

.login-pf-page .invalid-verification-error .invalid-verification-error_text span {
    font-weight: 500;
}

.login-pf-page .invalid-verification-error .invalid-verification-error_text .invalid-verification-error_phone {
    display: block;
}

.login-pf-page .invalid-verification-error .invalid-verification-error_text span,
.login-pf-page .invalid-verification-error .invalid-verification-error_text div {
    display: inline;
}

.login-pf-page .alert,
.login-pf-page .login-alert-error,
.login-pf-page .email-send-success {
    display: none;
}

.login-pf-page .email-send-success_title {
    margin-top: 0;
    margin-bottom: 28px;
    text-align: center;
    font-weight: 600;
    font-size: 22px;
    line-height: 30px;
    color: #181A35;
}

.login-pf-page .email-send-success_desc {
    text-align: center;
    margin-bottom: 28px;
    font-size: 16px;
    line-height: 24px;
    color: #323854;
}

.login-pf-page .email-send-success_btn {
    margin-top: 0;
    margin-bottom: 0;
}

.login-pf-page .login-alert-error {
    position: relative;
    width: 100%;
    margin-top: 20px;
    padding-left: 25px;
    margin-left: auto;
    margin-right: auto;
    font-size: 14px;
    line-height: 16px;
    letter-spacing: 0.02em;
    color: #323B54;
}

.login-pf-page .login-alert-error:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    display: inline-block;
    width: 18px;
    height: 16px;
    background: url("../img/alert.svg") center center no-repeat;
}

.login-pf-page .login-alert-error + #kc-form-buttons .btn-primary {
    margin-top: 10px;
}

#kc-reset-password-form {
    position: relative;
}

#kc-reset-password-form .btn-primary {
    margin-top: 0;
    margin-bottom: 0;
}

.login-pf-page .back-link {
    position: absolute;
    top: -130px;
    left: -70px;
}

.login-pf-page .back-link a {
    font-weight: 500;
    font-size: 15px;
    line-height: 16px;
    letter-spacing: 0.02em;
    color: #323854;
    text-decoration: none;
}

.login-pf-page .back-link a:before {
    content: '';
    display: inline-block;
    background: url(../img/arrow-left.svg) no-repeat left center;
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-top: -4px;
}

.login-pf-page .control-label {
    margin-bottom: 5px;
    font-size: 14px;
    line-height: 16px;
    font-weight: normal;
    color: #4E4E4E;
}

.login-pf-page .login-pf-signup {
    display: none;
}

.login-pf-page .form-show-password-button {
    position: absolute;
    top: 0;
    left: 0;
    width: 32px;
    height: 36px;
    cursor: pointer;
}
