*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden;
    /* Тот же цвет, что под градиентом — меньше «вспышки» при полной перезагрузке страницы */
    background-color: #eef2fb;
}

body {
    margin: 0;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background-color: #eef2fb;
}

#kc-header,
#kc-header-wrapper,
#kc-locale {
    display: none !important;
}

/* Patternfly: синяя полоска сверху — border-top у .login-pf-page; шапка — .login-pf-page-header */
.login-pf-page-header,
#kc-header.login-pf-page-header {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    overflow: hidden !important;
}

/* Без column у flex-wrapper алерт (pf-c-alert) и форма стоят в ряд — «криво слева» */
#kc-content {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#kc-form {
    float: none;
    max-width: none;
    width: 100%;
}

#kc-form-wrapper {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

#kc-form-options,
#kc-info {
    display: none;
}

/* В разметке Keycloak: .login-pf-page > .card-pf > #kc-content-wrapper — без flex на .card-pf
   обёртка по высоте = контент, карточка визуально «прилипает» к верху. */
.login-pf-page .card-pf {
    margin: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 0;
    width: 100%;
}

.login-pf-page {
    padding: 0;
    min-height: 100%;
    height: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    border-top: none !important;
    box-shadow: none !important;
    background-color: #eef2fb;
    background-image: url("../img/back-bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#kc-content-wrapper {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Глобальные алерты вне карточки (другие страницы темы, не login.ftl с inlineMessageInForm) */
#kc-content .pf-c-alert,
#kc-content-wrapper .pf-c-alert,
#kc-content .alert-error,
#kc-content-wrapper .alert-error {
    width: 100%;
    max-width: 442px;
    margin: 0;
    box-sizing: border-box;
    text-align: left;
}

#kc-content .pf-c-alert .pf-c-alert__title,
#kc-content-wrapper .pf-c-alert .pf-c-alert__title {
    font-size: 14px;
    line-height: 1.4;
}

#kc-content .pf-c-alert .pf-c-alert__description,
#kc-content-wrapper .pf-c-alert .pf-c-alert__description {
    font-size: 13px;
    line-height: 1.4;
}

/* Алерт на странице логина: внутри .dnm-login-card под логотипом */
.dnm-login-card .dnm-login-alert {
    align-self: stretch;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    text-align: left;
}

.dnm-login-card .dnm-login-alert .kc-feedback-text {
    font-size: 13px;
    line-height: 1.45;
}

#kc-form-login {
    width: 100%;
}

.dnm-login-card {
    margin: auto;
    width: 442px;
    padding: 32px;
    border-radius: 24px;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.dnm-field-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 12px;
}

.dnm-input {
    display: block;
    width: 358px;
    height: 36px;
    border-radius: 8px;
    background-color: #ffffff;
    border: solid 1px #cccfde;
    font-size: 16px;
    line-height: 20px;
    font-weight: 400;
    padding: 8px 12px 8px 12px;
    outline: none;
}

.dnm-input::placeholder {
    color: #8a92a5;
}

.dnm-input:focus {
    border-color: #5a7de7;
    box-shadow: 0 0 0 2px rgba(90, 125, 231, 0.18);
}

.dnm-login-button {
    display: flex;
    justify-self: center;
    align-items: center;
    justify-content: center;
    width: 358px;
    height: 36px;
    border-radius: 8px;
    border-style: none;
    background-color: #476bf0;
    font-size: 16px;
    line-height: 20px;
    font-weight: 400;
    color: #ffffff;
    cursor: pointer;
    margin-top: 24px;
}

.dnm-login-button:hover {
    background-color: #3356d7;
}

.dnm-login-button:active {
    background-color: #2042c2;
}

.dnm-login-error {
    max-width: 358px;
    display: block;
    font-size: 16px;
    font-weight: 400;
    line-height: 20px;
    color: #e55c5c;
    text-align: center;
    margin-top: 8px;
}
