/* Стили для страниц авторизации (login.php и register.php) */
/* Полное соответствие брендбуку */

/* Фон страницы - ТЁМНЫЙ #0a0a0a с градиентами */
body.auth-page {
    min-height: 100vh;
    background: #0a0a0a;
    background-image:
        radial-gradient(at 20% 30%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 80% 70%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(59, 130, 246, 0.03) 0px, transparent 50%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-x: hidden;
    overflow-y: auto;
}

/* SVG точечный паттерн - 2% прозрачность */
body.auth-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(59, 130, 246, 0.02) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: 0;
}

/* Основной контейнер формы */
.auth-container {
    background: linear-gradient(135deg, #171717 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid #262626;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 1px rgba(59, 130, 246, 0.2);
    padding: 2.5rem;
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
    margin: auto;
    animation: fadeIn 0.5s ease, scaleIn 0.5s ease;
}

.auth-container.register-page {
    max-width: 520px;
}

/* Двухколоночный layout для регистрации */
.auth-container.register-layout {
    max-width: 1000px;
    display: flex;
    gap: 2.5rem;
    align-items: stretch;
}

@media (max-width: 768px) {
    .auth-container.register-layout {
        flex-direction: column;
        max-width: 520px;
        gap: 1.5rem;
    }
}

@media (max-width: 640px) {
    .auth-container {
        padding: 2rem 1.5rem;
    }
}

@media (min-width: 768px) {
    .auth-container {
        padding: 3rem;
    }
}

/* Декоративный градиентный эффект */
.auth-container::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 16px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-container:hover::after {
    opacity: 1;
}

/* Логотип и заголовок */
.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

@media (max-width: 640px) {
    .auth-logo {
        margin-bottom: 1.5rem;
    }
}

.auth-logo-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
    filter: drop-shadow(0 4px 20px rgba(59, 130, 246, 0.5));
    animation: scaleIn 0.6s ease;
}

@media (max-width: 640px) {
    .auth-logo-icon {
        font-size: 3rem;
        margin-bottom: 0.75rem;
    }
}

.auth-container h1 {
    font-size: 2.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.75rem;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

@media (max-width: 640px) {
    .auth-container h1 {
        font-size: 1.75rem;
    }
}

.auth-subtitle {
    color: #a3a3a3;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    line-height: 1.5;
    font-weight: 400;
}

@media (max-width: 640px) {
    .auth-subtitle {
        font-size: 0.8125rem;
        margin-bottom: 1.5rem;
    }
}

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

.auth-form-group label {
    display: block;
    color: #fafafa;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.auth-form-group .required {
    color: #ef4444;
}

.auth-form-group input[type="text"],
.auth-form-group input[type="password"],
.auth-form-group input[type="email"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #262626;
    border-radius: 8px;
    font-size: 1rem;
    background: #171717;
    color: #fafafa;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    font-weight: 400;
}

.auth-form-group input::placeholder {
    color: #a3a3a3;
    opacity: 0.7;
}

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

/* Кнопки */
.btn-auth {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
}

.btn-auth::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(59, 130, 246, 0.9), rgba(139, 92, 246, 0.9));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-auth:hover::before {
    opacity: 1;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.4);
}

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

.btn-auth .emoji,
.btn-auth span {
    position: relative;
    z-index: 1;
}

/* Алерты */
.auth-alert {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    animation: fadeIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

@media (max-width: 640px) {
    .auth-alert {
        padding: 0.875rem 1rem;
        font-size: 0.8125rem;
        margin-bottom: 1.25rem;
    }
}

.auth-alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

/* Информационный блок */
.auth-info-box {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: #a3a3a3;
    line-height: 1.6;
    animation: fadeIn 0.5s ease 0.2s backwards;
}

@media (max-width: 640px) {
    .auth-info-box {
        padding: 0.875rem 1rem;
        font-size: 0.8125rem;
        margin-bottom: 1.25rem;
    }
}

.auth-info-box strong {
    color: #fafafa;
    font-weight: 600;
}

/* Подсказки под полями */
.auth-help-text {
    color: #a3a3a3;
    font-size: 0.75rem;
    margin-top: 0.375rem;
    line-height: 1.4;
    font-weight: 400;
}

/* Футер с ссылками */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    color: #a3a3a3;
    font-size: 0.875rem;
    line-height: 1.8;
}

.auth-footer a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.auth-footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
}

.auth-footer a:hover {
    color: #8b5cf6;
}

.auth-footer a:hover::after {
    width: 100%;
}

.auth-footer small {
    color: #a3a3a3;
    margin-top: 0.5rem;
    display: block;
    opacity: 0.8;
    font-size: 0.8125rem;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Поддержка эмодзи */
.emoji {
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

/* Ссылка "Вернуться на главную" */
.auth-back-link {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 10;
}

.auth-back-link a {
    color: #a3a3a3;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(23, 23, 23, 0.8);
    border: 1px solid #262626;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.auth-back-link a:hover {
    color: #3b82f6;
    border-color: #3b82f6;
    transform: translateX(-4px);
}

@media (max-width: 640px) {
    .auth-back-link {
        top: 1rem;
        left: 1rem;
    }

    .auth-back-link a {
        font-size: 0.8125rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Вторичная ссылка (восстановление пароля) */
.auth-link-secondary {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.75rem;
    transition: color 0.3s ease;
}

.auth-link-secondary:hover {
    color: #8b5cf6;
}

/* Ссылки в footer */
.auth-footer small a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.3s ease;
}

.auth-footer small a:hover {
    color: #8b5cf6;
}

/* Анимация загрузки для кнопки */
.btn-auth.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-auth.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    right: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Улучшенный фокус для accessibility */
.auth-form-group input:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Hover эффект контейнера */
.auth-container:hover {
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 0 0 1px rgba(59, 130, 246, 0.4);
}

/* Sidebar для регистрации */
.register-sidebar {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .register-sidebar {
        flex: 1 1 auto;
    }
}

.register-sidebar .auth-logo {
    margin-bottom: 0;
}

.register-sidebar .auth-info-box {
    margin-bottom: 0;
}

/* Контент формы регистрации */
.register-form-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.register-form-content form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.register-form-content .auth-footer {
    margin-top: 1.5rem;
}

/* Адаптивность для маленьких экранов */
@media (max-width: 400px) {
    .auth-container {
        padding: 1.5rem 1rem;
    }

    .auth-logo-icon {
        font-size: 2.5rem;
    }

    .auth-container h1 {
        font-size: 1.5rem;
    }

    .auth-form-group input {
        font-size: 0.9375rem;
    }

    .btn-auth {
        font-size: 0.9375rem;
        min-height: 54px;
    }
}
