/*
 * Styles only for the login page. Card colors, borders and radius follow
 * the existing CRM blocks. The shared static/css/style.css is not modified.
 */

.login-page {
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    background: var(--bg-page, #f3f6fd);
    color: var(--text-color, #131411);

    /* МЕСТО ДЛЯ ФОНОВОЙ КАРТИНКИ СТРАНИЦЫ.
       1. Положите изображение в static/img/login/background.jpg.
       2. Удалите комментарии у примера ниже.
       Фоновая картинка растянется на всю страницу без изменения разметки.

    background-image: url("../img/login/background.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    */
}

.login-page__content {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

/* The login card stays centered; the illustration slots are positioned around it. */
.login-stage {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
    padding: 30px;
    background: var(--block-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e5ea);
    border-radius: var(--radius, 12px);
    box-shadow: 0 2px 8px rgba(24, 39, 75, 0.04);
}

/* Image insertion slots: replace the placeholder span with the img example in the template. */
.login-illustration {
    position: absolute;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.login-illustration__placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    padding: 10px;
    color: var(--text-muted, #737985);
    background: rgba(255, 255, 255, 0.58);
    border: 1px dashed var(--border-color, #cbd2df);
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.35;
    text-align: center;
}

.login-illustration img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Slot above the form */
.login-illustration--top {
    width: 200px;
    left: 50%;
    bottom: calc(100% + 0px);
    transform: translateX(-50%);
}

/* Slot to the left of the form */
.login-illustration--left {
    width: 200px;
    height: 250px;
    top: 50%;
    right: calc(100% + 0px);
    transform: translateY(-50%);
}

/* Slot to the right of the form */
.login-illustration--right {
    width: 200px;
    height: 250px;
    top: 50%;
    left: calc(100% + 0px);
    transform: translateY(-50%);
}

.mz-illustration--left {
    width: 400px;
    height: 250px;
    top: -80%;
    left: calc(50% - 200px);
    /*transform: translateY(-50%);*/
}

.login-card__header {
    margin-bottom: 26px;
    text-align: center;
}

.login-card__header h1 {
    margin: 0 0 8px;
    color: var(--text-color, #131411);
    font-size: 25px;
    font-weight: 600;
    line-height: 1.25;
}

.login-card__header p {
    margin: 0;
    color: var(--text-muted, #737985);
    font-size: 14px;
    line-height: 1.5;
}

.login-error {
    margin-bottom: 18px;
    padding: 11px 12px;
    color: #a82828;
    background: #fff1f1;
    border: 1px solid #f2caca;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-form__field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.login-form__field label {
    color: var(--text-color, #131411);
    font-size: 13px;
    font-weight: 600;
}

.login-form__field input[type="text"],
.login-form__field input[type="password"],
.login-form__field input[type="email"] {
    display: block;
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    padding: 10px 12px;
    color: var(--text-color, #131411);
    background: var(--block-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e5ea);
    border-radius: 8px;
    outline: none;
    font: inherit;
    font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-form__field input[type="text"]:focus,
.login-form__field input[type="password"]:focus,
.login-form__field input[type="email"]:focus {
    border-color: #4d7cff;
    box-shadow: 0 0 0 3px rgba(77, 124, 255, 0.12);
}

.login-submit {
    width: 100%;
    min-height: 44px;
    margin-top: 4px;
    padding: 11px 16px;
    color: #ffffff;
    background: #947af4;
    border: 1px solid #4d7cff;
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.login-submit:hover {
    background: #5500b1;
    border-color: #3d6ce8;
}

.login-submit:active {
    transform: translateY(1px);
}

.login-submit:focus-visible {
    outline: 3px solid rgba(77, 124, 255, 0.28);
    outline-offset: 2px;
}

/* On smaller screens hide the side images so they don't overlap the card. */
@media (max-width: 760px) {
    .login-illustration--left,
    .login-illustration--right {
        display: none;
    }

    .login-illustration--top {
        width: 120px;
        height: 80px;
        bottom: calc(100% + 12px);
    }
}

@media (max-width: 480px) {
    .login-page__content {
        padding: 16px;
    }

    .login-card {
        padding: 24px 20px;
    }

    .login-card__header h1 {
        font-size: 23px;
    }
}
