/* =========================================
   AUTH.CSS — Стили для страниц авторизации
   ========================================= */

.auth-page {
    background: #0a0a0a;
    min-height: 100vh;
    position: relative;
}

/* Фоновая сетка */
.auth-page::before {
    content: "";
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    height: calc(100% - 80px);
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* Главный контейнер — центрирование */
.auth-main {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    position: relative;
}

/* Декоративные элементы */
.auth-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: visible;
}

.decoration-circle {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
    filter: blur(40px);
    top: -100px;
    right: -100px;
    animation: float 8s ease-in-out infinite;
}

.decoration-circle-2 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.08) 0%, transparent 70%);
    top: auto;
    bottom: -80px;
    right: auto;
    left: -80px;
    animation-delay: -4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

/* Карточка */
.auth-card {
    background: rgba(17, 24, 39, 0.7);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 1.5rem;
    padding: 2.5rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03), 
                0 20px 50px -10px rgba(0, 0, 0, 0.5), 
                0 0 40px rgba(59, 130, 246, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
}

.auth-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 
                0 25px 60px -10px rgba(0, 0, 0, 0.6), 
                0 0 60px rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
}

/* Иконка */
.auth-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(124, 58, 237, 0.2));
    border-radius: 1rem;
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.auth-title {
    color: white;
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: #9ca3af;
    font-size: 0.95rem;
    text-align: center;
    margin: 0 0 2rem;
}

/* Ошибки */
.error-list {
    margin-bottom: 1.5rem;
}

.error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 0.75rem;
    color: #fca5a5;
    font-size: 0.875rem;
}

/* Форма */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    min-width: 0;
}

.consent-row {
    margin-top: 0.1rem;
    padding: 0.875rem 1rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.03);
    box-sizing: border-box;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.45;
    user-select: none;
    cursor: pointer;
}

.consent-checkbox {
    margin-top: 0.15rem;
    width: 17px;
    height: 17px;
    accent-color: #3b82f6;
    flex: 0 0 auto;
}

.consent-label span {
    display: block;
    min-width: 0;
}

.consent-text {
    display: block;
}

.consent-link {
    color: #60a5fa;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: rgba(96, 165, 250, 0.7);
    font-weight: 600;
}

.consent-link:hover {
    color: #bfdbfe;
    text-decoration-color: rgba(191, 219, 254, 0.95);
}

.consent-row:has(.consent-checkbox:focus-visible) {
    border-color: rgba(59, 130, 246, 0.7);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
}

.input-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #d1d5db;
    padding-left: 0.25rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.input-wrapper svg {
    position: absolute;
    left: 1rem;
    color: #6b7280;
    transition: color 0.3s ease;
    pointer-events: none;
}

.input-wrapper:focus-within svg {
    color: #3b82f6;
}

.auth-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.875rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

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

.auth-input::placeholder {
    color: #6b7280;
}

/* Кнопка */
.btn-neon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    margin-top: 0.5rem;
    border-radius: 0.875rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    width: 100%;
}

.btn-neon:hover {
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
}

.btn-neon svg {
    transition: transform 0.3s ease;
}

.btn-neon:hover svg {
    transform: translateX(4px);
}

/* Разделитель */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    gap: 1rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Ссылка */
.auth-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    padding: 0.75rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.auth-link span {
    color: #9ca3af;
}

.auth-link strong {
    color: #3b82f6;
    font-weight: 600;
}

.auth-link:hover {
    background: rgba(59, 130, 246, 0.05);
}

.auth-link:hover strong {
    color: #60a5fa;
}

.auth-link-forgot {
    margin-top: 0.75rem;
}

/* Светлая тема: формы авторизации */
html[data-theme="light"] .auth-card {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.16);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .auth-title,
html[data-theme="light"] .input-label {
    color: #111827;
}

html[data-theme="light"] .auth-subtitle,
html[data-theme="light"] .auth-link span,
html[data-theme="light"] .auth-divider span,
html[data-theme="light"] .consent-label {
    color: #4b5563;
}

html[data-theme="light"] .auth-input {
    background: #ffffff;
    color: #111827;
    border-color: rgba(15, 23, 42, 0.2);
}

html[data-theme="light"] .consent-row {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.18);
}

html[data-theme="light"] .btn-neon {
    background: #ffffff;
    color: #111827;
    border: 1px solid rgba(15, 23, 42, 0.2);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .btn-neon:hover {
    background: #f8fafc;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

/* =========================================
   АДАПТИВНОСТЬ
   ========================================= */

@media (max-width: 640px) {
    .auth-main {
        padding: 1rem;
        min-height: calc(100vh - 70px);
    }
    
    .auth-card {
        padding: 1.75rem;
        border-radius: 1.25rem;
    }
    
    .auth-decoration {
        display: none;
    }
    
    .auth-icon {
        width: 56px;
        height: 56px;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .auth-subtitle {
        font-size: 0.875rem;
    }
    
    .auth-input {
        padding: 0.75rem 1rem 0.75rem 2.5rem;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    .input-wrapper svg {
        left: 0.875rem;
        width: 16px;
        height: 16px;
    }
    
    .btn-neon {
        padding: 0.875rem 1.25rem;
    }
    
    .error-message {
        font-size: 0.8rem;
        padding: 0.625rem 0.875rem;
    }
}

@media (max-width: 380px) {
    .auth-card {
        padding: 1.5rem;
    }
    
    .auth-title {
        font-size: 1.375rem;
    }
}