/* -------------------------------------- */
/* СТРАНИЦА АВТОРИЗАЦИИ – СТЕКЛЯННЫЙ ЭФФЕКТ, ВОЛНООБРАЗНАЯ АНИМАЦИЯ */
/* -------------------------------------- */

/* Контейнер на весь экран */
.auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    overflow: hidden;
    z-index: 0;
}

/* Анимированный градиентный фон – эффект волны */
.auth-gradient-bg {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460, #1a1a2e, #16213e);
    background-size: 400% 400%;
    animation: waveGradient 25s ease-in-out infinite;
    z-index: -1;
}

@keyframes waveGradient {
    0%   { background-position: 0% 0%; }
    10%  { background-position: 20% 30%; }
    20%  { background-position: 40% 10%; }
    30%  { background-position: 60% 50%; }
    40%  { background-position: 80% 30%; }
    50%  { background-position: 100% 0%; }
    60%  { background-position: 80% 70%; }
    70%  { background-position: 60% 100%; }
    80%  { background-position: 40% 70%; }
    90%  { background-position: 20% 100%; }
    100% { background-position: 0% 0%; }
}

/* Светлая тема – другой градиент с мягкими тонами */
body.light-theme .auth-gradient-bg {
    background: linear-gradient(135deg, #e0e5ec, #f0f4f8, #d9e2ec, #e0e5ec, #f0f4f8);
    background-size: 400% 400%;
}

/* Карточка авторизации – стеклянный эффект */
.auth-card {
    position: relative;
    width: 420px;
    max-width: 92%;
    padding: 40px 36px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    color: var(--text);
    transition: all 0.3s ease;
    z-index: 1;
}

body.light-theme .auth-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

/* Заголовок */
.auth-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 28px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-theme .auth-title {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Поля ввода */
.auth-input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    color: var(--text);
    font-size: 16px;
    transition: all 0.25s ease;
    margin-bottom: 16px;
    outline: none;
}

.auth-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(76, 154, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.auth-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.auth-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body.light-theme .auth-input {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
    color: #1e2a3a;
}

body.light-theme .auth-input:focus {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(42, 108, 187, 0.15);
}

/* Кнопки */
.auth-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.auth-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 16px rgba(76, 154, 255, 0.3);
}

.auth-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(76, 154, 255, 0.4);
}

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

.auth-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.auth-btn-link {
    background: transparent;
    color: var(--primary);
    font-size: 14px;
    text-decoration: underline;
    padding: 8px;
    margin-top: -4px;
}

.auth-btn-link:hover {
    color: var(--primary-light);
}

.auth-btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 30px;
}

.auth-btn-outline:hover {
    background: var(--primary);
    color: white;
}

body.light-theme .auth-btn-secondary {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: #1e2a3a;
}

body.light-theme .auth-btn-secondary:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.08);
}

body.light-theme .auth-btn-outline {
    color: var(--primary);
    border-color: var(--primary);
}

body.light-theme .auth-btn-outline:hover {
    color: white;
    background: var(--primary);
}

/* Ошибка */
.auth-error {
    background: rgba(244, 67, 54, 0.12);
    border-left: 4px solid var(--danger);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    color: var(--danger);
    font-size: 14px;
}

body.light-theme .auth-error {
    background: rgba(244, 67, 54, 0.06);
}

/* Кнопка переключения темы */
.auth-theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 22px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 10;
}

.auth-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.05);
}

body.light-theme .auth-theme-toggle {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .auth-theme-toggle:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* Плашка "В разработке" */
.auth-dev-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 193, 7, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #ffc107;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 10;
    user-select: none;
}

body.light-theme .auth-dev-badge {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.4);
    color: #b8860b;
}

/* Кнопка демо-входа */
.auth-btn-demo {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    width: 100%;
    margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(238, 90, 36, 0.3);
}

.auth-btn-demo:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(238, 90, 36, 0.4);
}

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

/* Разделитель "или" */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider::before {
    margin-right: 16px;
}
.auth-divider::after {
    margin-left: 16px;
}

/* Модалка с данными демо-аккаунта */
.auth-demo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-demo-modal {
    background: var(--bg-surface);
    padding: 32px 36px;
    border-radius: 28px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
}

.auth-demo-modal h3 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.auth-demo-modal p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

.auth-demo-credentials {
    background: var(--bg-elevated);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
}

.auth-demo-credentials div {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 15px;
}

.auth-demo-credentials .label {
    color: var(--text-secondary);
}

.auth-demo-credentials .value {
    font-weight: 600;
    color: var(--text);
    font-family: monospace;
}

.auth-demo-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.auth-demo-actions button {
    padding: 10px 24px;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-demo-actions .btn-primary {
    background: var(--primary);
    color: white;
}

.auth-demo-actions .btn-primary:hover {
    background: var(--primary-dark);
}

.auth-demo-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border: 1px solid var(--border);
}

.auth-demo-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

body.light-theme .auth-demo-modal {
    background: #ffffff;
    border-color: rgba(0,0,0,0.1);
}

body.light-theme .auth-demo-actions .btn-secondary {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .auth-demo-actions .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* Адаптация для мобильных */
@media (max-width: 480px) {
    .auth-card {
        padding: 28px 20px;
        border-radius: 28px;
    }
    .auth-title {
        font-size: 24px;
    }
    .auth-input {
        padding: 12px 14px;
        font-size: 15px;
    }
    .auth-btn {
        padding: 12px;
        font-size: 15px;
    }
    .auth-theme-toggle {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .auth-dev-badge {
        top: 12px;
        left: 12px;
        font-size: 10px;
        padding: 4px 12px;
    }
    .auth-demo-modal {
        padding: 24px 20px;
    }
}

/* Уважение prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .auth-gradient-bg {
        animation: none;
    }
    .auth-btn {
        transition: none;
    }
    .auth-btn-primary:hover:not(:disabled) {
        transform: none;
    }
    .auth-btn-secondary:hover:not(:disabled) {
        transform: none;
    }
}