/* CSS для экрана авторизации (Fixed Premium Light) */

:root {
    --auth-bg-page: #f8fafc;
    --auth-card-bg: #ffffff;
    --auth-accent: #2563eb;
    --auth-accent-hover: #1d4ed8;
    --auth-text-main: #1e293b; /* Глубокий темно-синий для лучшей читаемости */
    --auth-text-muted: #64748b;
    --auth-text-placeholder: #94a3b8;
    --auth-border: #e2e8f0;
    --auth-border-focus: #3b82f6;
    --auth-input-bg: #ffffff; /* Белый фон для инпутов, чтобы текст был виден */
    --auth-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--auth-bg-page);
    /* Добавляем легкую текстуру для глубины */
    background-image: radial-gradient(#e2e8f0 1.5px, transparent 1.5px);
    background-size: 32px 32px;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    color: var(--auth-text-main);
    padding: 24px;
    box-sizing: border-box;
}

.auth-card {
    background: var(--auth-card-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--auth-shadow);
    border-radius: 28px;
    padding: 3.5rem 2.8rem;
    width: 100%;
    max-width: 440px;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
}

.auth-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    margin-bottom: 1rem;
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.auth-subtitle {
    text-align: center;
    color: var(--auth-text-muted);
    font-size: 1rem;
    line-height: 1.5;
    margin: 0.5rem 0 2.5rem 0;
    font-weight: 500;
}

/* Вкладки */
.auth-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 16px;
    margin-bottom: 2.5rem;
}

.auth-tab {
    flex: 1;
    padding: 0.8rem;
    border: none;
    background: transparent;
    color: var(--auth-text-muted);
    cursor: pointer;
    font-weight: 700;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
}

.auth-tab.active {
    background: #ffffff;
    color: var(--auth-accent);
    box-shadow: 0 4px 10px -2px rgba(37, 99, 235, 0.15);
}

/* Формы */
.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    color: var(--auth-text-main);
    font-size: 0.95rem;
    font-weight: 700;
}

.form-group input {
    width: 100%;
    /* ФИКС: Тёмный текст на гарантированно белом фоне */
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    color: #1e293b !important; /* Тёмно-синий текст */
    padding: 1rem 1.25rem;
    border-radius: 14px;
    font-family: inherit;
    font-size: 1.1rem; /* Чуть крупнее для читаемости */
    font-weight: 500;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.form-group input::placeholder {
    color: #94a3b8 !important;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.15) !important;
    background: #ffffff !important;
}

.pwd-input-wrap {
    position: relative;
}

.pwd-input-wrap input {
    padding-right: 3.5rem;
}

.toggle-pwd {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.35rem;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 10px;
}

.toggle-pwd:hover {
    color: var(--auth-accent);
}

/* Кнопка */
.auth-btn {
    width: 100%;
    padding: 1.2rem;
    background: #2563eb !important;
    color: #ffffff !important; /* Обизательно белый текст */
    border: none;
    border-radius: 16px;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
    margin-top: 2.2rem;
}

.auth-btn:hover {
    background: #1d4ed8 !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -3px rgba(37, 99, 235, 0.4);
}

.auth-btn:disabled {
    background: #cbd5e1 !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
}

/* Ошибки */
.auth-error {
    background: #fff1f2 !important;
    color: #be123c !important;
    padding: 1.25rem;
    border-radius: 16px;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    border: 2px solid #ffe4e6 !important;
    font-weight: 700;
    line-height: 1.4;
    display: none; /* Скрыто по умолчанию в CSS, показывается через JS */
}

/* Ссылка */
.forgot-pwd-wrap {
    margin-top: 2.5rem;
    text-align: center;
}

.forgot-pwd-link {
    color: var(--auth-text-muted);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 12px;
}

.forgot-pwd-link:hover {
    color: var(--auth-accent);
}

.forgot-pwd-link i {
    color: #22c55e;
    font-size: 1.25rem;
}

/* Анимации */
.auth-form {
    display: none;
    animation: authIn 0.4s cubic-bezier(0, 0, 0.2, 1) forwards;
}

.auth-form.active {
    display: block;
}

@keyframes authIn {
    from { opacity: 0; transform: scale(0.97) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
