/* NSTorgServer\wwwroot\css\login.css */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
    /* Анимированные круги на фоне */
    body::before,
    body::after {
        content: '';
        position: absolute;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        animation: float 20s infinite ease-in-out;
    }

    body::before {
        width: 500px;
        height: 500px;
        top: -200px;
        left: -200px;
    }

    body::after {
        width: 400px;
        height: 400px;
        bottom: -150px;
        right: -150px;
        animation-delay: -10s;
    }

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.1);
    }

    66% {
        transform: translate(-30px, 30px) scale(0.9);
    }
}
/* Стеклянная карточка (glassmorphism) */
.login-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    margin: 20px;
    padding: 3rem 2.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.2);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Логотип (прозрачный PNG, без подложки в любой теме) */
.login-logo {
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo-img {
    width: 100%;
    height: auto;
    display: block;
}
.login-title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    text-align: center;
    color: #6c757d;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}
/* Поля ввода с иконками */
.input-group-custom {
    position: relative;
    margin-bottom: 1.25rem;
}

    .input-group-custom .input-icon {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: #667eea;
        font-size: 1.1rem;
        z-index: 2;
        transition: color 0.2s;
    }

    .input-group-custom .form-control {
        padding: 0.85rem 1rem 0.85rem 2.8rem;
        border: 2px solid #e9ecef;
        border-radius: 0.75rem;
        font-size: 1rem;
        background: #f8f9fa;
        transition: all 0.2s;
    }

        .input-group-custom .form-control:focus {
            background: white;
            border-color: #667eea;
            box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
            outline: none;
        }

            .input-group-custom .form-control:focus + .input-icon,
            .input-group-custom .form-control:focus ~ .input-icon {
                color: #764ba2;
            }
/* Кнопка переключения пароля */
.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    z-index: 2;
    transition: color 0.2s;
}

    .toggle-password:hover {
        color: #667eea;
    }
/* Галочка "Запомнить меня" */
.form-check-custom {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

    .form-check-custom .form-check-input {
        width: 1.2em;
        height: 1.2em;
        margin-right: 0.5rem;
        cursor: pointer;
    }

        .form-check-custom .form-check-input:checked {
            background-color: #667eea;
            border-color: #667eea;
        }

    .form-check-custom label {
        margin: 0;
        color: #495057;
        cursor: pointer;
        user-select: none;
    }
/* Главная кнопка входа */
.btn-login {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

    .btn-login:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
    }

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

    .btn-login:disabled {
        opacity: 0.7;
        cursor: not-allowed;
    }

    .btn-login::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.3);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }

    .btn-login:hover::before {
        width: 300px;
        height: 300px;
    }

    .btn-login span {
        position: relative;
        z-index: 1;
    }
/* Блок ошибки */
.alert-login {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    border: 1px solid #fecaca;
    border-left: 4px solid #dc3545;
    color: #991b1b;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

.alert-login i {
    font-size: 1.3rem;
    color: #dc3545;
}
/* Футер карточки */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
    color: #6c757d;
    font-size: 0.85rem;
}

    .login-footer strong {
        color: #495057;
    }
/* Адаптивность */
@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
        margin: 10px;
    }
    .login-title {
        font-size: 1.5rem;
    }
}
/* Спиннер для кнопки */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
    vertical-align: middle;
}
/* ==================== DARK MODE ДЛЯ СТРАНИЦЫ ВХОДА ==================== */
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    }

    html:not([data-theme="light"]) .login-card {
        background: rgba(30, 33, 37, 0.95);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    }
    /* Логотип с прозрачным фоном: в тёмной теме без подложки.
   Если PNG тёмный и теряется на тёмной карточке — раскомментируйте
   блок ниже, он инвертирует цвета и делает логотип белым. */
    html:not([data-theme="light"]) .login-logo-img {
        background: transparent;
        padding: 0;
        box-shadow: none;
        /* filter: brightness(0) invert(1); */
        /* opacity: 0.92; */
    }
    html:not([data-theme="light"]) .login-title {
        color: #e9ecef;
    }

    html:not([data-theme="light"]) .login-subtitle {
        color: #868e96;
    }
    html:not([data-theme="light"]) .input-group-custom .form-control {
        background: #2d3139;
        border-color: #343a40;
        color: #e9ecef;
    }

        html:not([data-theme="light"]) .input-group-custom .form-control:focus {
            background: #343a40;
            border-color: #4dabf7;
            color: #e9ecef;
        }

        html:not([data-theme="light"]) .input-group-custom .form-control::placeholder {
            color: #6c757d;
        }

    html:not([data-theme="light"]) .input-group-custom .input-icon {
        color: #4dabf7;
    }

    html:not([data-theme="light"]) .form-check-custom label {
        color: #adb5bd;
    }

    html:not([data-theme="light"]) .form-check-custom .form-check-input {
        background-color: #2d3139;
        border-color: #495057;
    }

        html:not([data-theme="light"]) .form-check-custom .form-check-input:checked {
            background-color: #4dabf7;
            border-color: #4dabf7;
        }

    html:not([data-theme="light"]) .toggle-password {
        color: #adb5bd;
    }

        html:not([data-theme="light"]) .toggle-password:hover {
            color: #4dabf7;
        }

    html:not([data-theme="light"]) .alert-login {
        background: linear-gradient(135deg, #2a1a1a 0%, #2d1515 100%);
        border-color: #5a2020;
        border-left-color: #ff6b6b;
        color: #ffa8a8;
    }

        html:not([data-theme="light"]) .alert-login i {
            color: #ff6b6b;
        }

    html:not([data-theme="light"]) .login-footer {
        border-top-color: #343a40;
        color: #868e96;
    }

        html:not([data-theme="light"]) .login-footer strong {
            color: #adb5bd;
        }
}
