/* Основной контейнер страницы логина */
.login-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f7f7;
    background-attachment: fixed;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Фоновый узор */
.login-page-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: backgroundMove 20s linear infinite;
    pointer-events: none;
}

@keyframes backgroundMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Контейнер формы */
.login-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
}

/* Карточка логина */
.login-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    padding: 50px 40px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e0e0e0;
}

.login-card.fade-in-active {
    transform: translateY(0);
    opacity: 1;
}

/* Заголовок */
.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    color: #2e2e2e;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.login-subtitle {
    color: #888888;
    font-size: 18px;
    margin-bottom: 0;
    font-weight: 500;
}

/* Форма */
.login-form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #4a4a4a;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Поля ввода с иконками */
.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaaaaa;
    font-size: 18px;
    z-index: 2;
    pointer-events: none;
    transition: all 0.3s ease;
}

.form-control-modern {
    padding: 14px 45px 14px 45px;
    border: 2px solid #d8d8d8;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #f7f7f7;
    color: #2e2e2e;
}

.form-control-modern::placeholder {
    color: #c0c0c0;
}

.form-control-modern:focus {
    border-color: #888888;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(136, 136, 136, 0.12);
    outline: none;
}

.form-control-modern:focus ~ .input-icon {
    color: #555555;
    transform: translateY(-50%) scale(1.1);
}

/* Кнопка показа/скрытия пароля */
.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #aaaaaa;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.3s ease;
    z-index: 2;
}

.toggle-password:hover {
    color: #555555;
    transform: translateY(-50%) scale(1.1);
}

.toggle-password:focus {
    outline: none;
}

/* Чекбокс "Запомнить меня" */
.form-check-modern {
    display: flex;
    align-items: center;
    padding-left: 0;
}

.form-check-modern .form-check-input {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid #d8d8d8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-check-modern .form-check-input:checked {
    background-color: #555555;
    border-color: #555555;
}

.form-check-modern .form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(136, 136, 136, 0.12);
}

.form-check-modern .form-check-label {
    color: #4a4a4a;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

/* Кнопка входа */
.btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #909090 0%, #707070 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.18);
    background: linear-gradient(135deg, #a0a0a0 0%, #808080 100%);
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:active {
    transform: translateY(0);
}

.btn-icon {
    transition: transform 0.3s ease;
}

.btn-login:hover .btn-icon {
    transform: translateX(5px);
}

/* Футер */
.login-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Анимированное сообщение об ошибке */
.alert-animated {
    animation: shakeError 0.5s ease;
    border-radius: 12px;
    border: none;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.2);
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Адаптивность для мобильных - УВЕЛИЧЕННЫЕ размеры для удобства чтения */
@media (max-width: 768px) {
    .login-page-wrapper {
        padding: 15px;
        min-height: 100vh;
    }

    .login-container {
        max-width: 100%;
    }

    .login-card {
        padding: 30px 25px;
        border-radius: 15px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }

    .login-header {
        margin-bottom: 30px;
    }

    .login-title {
        font-size: 28px;
        margin-bottom: 10px;
    }

    .login-subtitle {
        font-size: 18px;
    }

    .form-group {
        margin-bottom: 22px;
    }

    .form-label {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .form-control-modern {
        padding: 14px 45px 14px 45px;
        font-size: 18px;
        border-radius: 12px;
        height: auto;
        min-height: 50px;
    }

    .input-icon {
        font-size: 20px;
        left: 15px;
    }

    .toggle-password {
        right: 12px;
        font-size: 20px;
        padding: 8px 10px;
    }

    .form-check-modern .form-check-input {
        width: 22px;
        height: 22px;
    }

    .form-check-modern .form-check-label {
        font-size: 16px;
    }

    .btn-confirm {
        padding: 16px;
        font-size: 18px;
        margin-top: 20px;
        border-radius: 12px;
        min-height: 55px;
    }

    .alert-animated {
        padding: 14px 18px;
        font-size: 16px;
        border-radius: 12px;
    }
}

@media (max-width: 576px) {
    .login-page-wrapper {
        padding: 12px;
    }

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

    .login-title {
        font-size: 26px;
    }

    .login-subtitle {
        font-size: 16px;
    }
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
    .login-page-wrapper {
        background: #1a1a1a;
    }

    .login-card {
        background: #2a2a2a;
        border-color: #3a3a3a;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
        color: #e0e0e0;
    }

    .login-title {
        color: #e0e0e0;
    }

    .login-subtitle {
        color: #888888;
    }

    .form-label {
        color: #c8c8c8;
    }

    .form-control-modern {
        background-color: #333333;
        border-color: #4a4a4a;
        color: #e0e0e0;
    }

    .form-control-modern::placeholder {
        color: #666666;
    }

    .form-control-modern:focus {
        background-color: #3a3a3a;
        border-color: #888888;
    }

    .input-icon {
        color: #666666;
    }

    .form-check-modern .form-check-input:checked {
        background-color: #888888;
        border-color: #888888;
    }

    .form-check-modern .form-check-label {
        color: #c8c8c8;
    }

    .toggle-password {
        color: #888888;
    }

    .toggle-password:hover {
        color: #cccccc;
    }

    .login-footer {
        border-top-color: #3a3a3a;
    }
}
