/* =============================================
   login.css
   ============================================= */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --login-primary:       #4f46e5;
    --login-primary-hover: #4338ca;
    --login-primary-light: #eef2ff;
    --login-success:       #10b981;
    --login-error:         #ef4444;
    --login-error-light:   #fef2f2;
    --login-text-dark:     #1e293b;
    --login-text-gray:     #64748b;
    --login-border:        #e2e8f0;
    --login-white:         #ffffff;
    --login-bg:            #f8fafc;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--login-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =============================================
   Основной контейнер
   ============================================= */
.login-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* =============================================
   Левая часть
   ============================================= */
.login-left {
    flex: 1;
    background: #225def;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
    animation: loginRotate 20s linear infinite;
}

@keyframes loginRotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.login-left__content {
    position: relative;
    z-index: 1;
    color: var(--login-white);
    max-width: 400px;
}

/* =============================================
   Логотип (изолирован от admin.css)
   ============================================= */
.login-left .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.login-left .logo-icon {
    font-size: 36px;
    background: rgba(255,255,255,0.2);
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-left .logo-text {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
}

.login-left__content h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
}

.login-left__content p {
    font-size: 16px;
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 48px;
}

/* Список возможностей */
.features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.1);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 15px;
    backdrop-filter: blur(10px);
}

.feature-icon {
    font-size: 20px;
}

/* =============================================
   Правая часть
   ============================================= */
.login-right {
    width: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--login-white);
}

.login-form-container {
    width: 100%;
    max-width: 380px;
}

/* Заголовок формы */
.login-header {
    margin-bottom: 36px;
}

.login-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--login-text-dark);
    margin-bottom: 8px;
}

.login-header p {
    font-size: 15px;
    color: var(--login-text-gray);
}

/* =============================================
   Форма (изолирована от admin.css)
   ============================================= */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0;
}

.login-form .form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--login-text-dark);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

.input-wrapper input {
    width: 100%;
    padding: 13px 14px 13px 44px;
    border: 2px solid var(--login-border);
    border-radius: 12px;
    font-size: 15px;
    color: var(--login-text-dark);
    background: var(--login-bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--login-primary);
    background: var(--login-white);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.input-wrapper input::placeholder {
    color: #94a3b8;
}

/* Кнопка показать/скрыть пароль */
.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toggle-password:hover {
    opacity: 1;
}

/* =============================================
   Сообщение об ошибке
   ============================================= */
.error-message {
    display: none;
    background: var(--login-error-light);
    border: 1px solid #fecaca;
    color: var(--login-error);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
}

.error-message.show {
    display: block;
    animation: loginShake 0.3s ease;
}

@keyframes loginShake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-6px); }
    75%       { transform: translateX(6px); }
}

/* =============================================
   Кнопка входа
   ============================================= */
.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--login-primary);
    color: var(--login-white);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-login:hover {
    background: var(--login-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.35);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* =============================================
   Лоадер внутри кнопки
   ============================================= */
.btn-loader {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: loginSpin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes loginSpin {
    to { transform: rotate(360deg); }
}

/* =============================================
   Футер формы
   ============================================= */
.login-footer {
    margin-top: 32px;
    text-align: center;
    color: var(--login-text-gray);
    font-size: 13px;
}

/* =============================================
   Адаптив
   ============================================= */
@media (max-width: 768px) {
    .login-left  { display: none; }
    .login-right { width: 100%; padding: 24px; }
}
/* =============================================
   ФИКС: убираем фиолетовый, ставим брендовый синий
   ============================================= */

/* Сплошной синий фон левой части */
.login-left {
    background: #225def !important;
}

/* Убираем возможные градиенты на обёртке/боди */
.login-wrapper,
body {
    background: #f8fafc !important;
}

/* Логотип-эмодзи нормального размера */
.logo-icon {
    font-size: 32px;
    line-height: 1;
}

/* Если вдруг остался img — ограничиваем размер */
.logo-img {
    width: 36px !important;
    height: 36px !important;
    object-fit: contain;
}

/* Кнопка "Войти" — синяя */
.btn-login {
    background: #225def !important;
}
.btn-login:hover {
    background: #1b4fd1 !important;
}

/* Спиннер — чистый круг */
.btn-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: loginSpin 0.7s linear infinite;
}
.btn-login.is-loading .btn-text { display: none; }
.btn-login.is-loading .btn-loader { display: block; }

@keyframes loginSpin {
    to { transform: rotate(360deg); }
}