﻿/* ==========================================================================
   СТИЛИ ДЛЯ АВТОРИЗАЦИИ И РЕГИСТРАЦИИ
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6c5ce7;
    --primary-light: #8b7cf0;
    --primary-dark: #4a3bb5;
    --secondary-color: #00d2ff;
    --success-color: #00b894;
    --danger-color: #d63031;
    --dark-bg: #0a0c14;
    --surface-bg: #121620;
    --surface-light: #1e2430;
    --text-primary: #ffffff;
    --text-secondary: #d1d5e0;
    --text-muted: #9aa1b5;
    --border-color: rgba(255, 255, 255, 0.12);
    --border-light: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-1: linear-gradient(135deg, #6c5ce7 0%, #00d2ff 100%);
    --gradient-2: linear-gradient(135deg, #00b894 0%, #00d2ff 100%);
}

body.auth-page {
    font-family: 'Inter', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

/* ==========================================================================
   ФОНОВЫЕ ЭЛЕМЕНТЫ
   ========================================================================== */

.auth-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
}

.bg-shape-1 {
    width: 600px;
    height: 600px;
    background: var(--primary-color);
    top: -200px;
    right: -200px;
    animation: float 20s infinite;
}

.bg-shape-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary-color);
    bottom: -200px;
    left: -200px;
    animation: float 25s infinite reverse;
}

.bg-shape-3 {
    width: 400px;
    height: 400px;
    background: var(--success-color);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float 15s infinite;
}

.bg-shape-4 {
    width: 800px;
    height: 800px;
    background: var(--primary-dark);
    top: 50%;
    right: -200px;
    animation: float 22s infinite reverse;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(40px, -40px) scale(1.1);
    }

    66% {
        transform: translate(-30px, 30px) scale(0.95);
    }
}

/* ==========================================================================
   КАРТОЧКА АВТОРИЗАЦИИ
   ========================================================================== */

.auth-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 10;
    animation: fadeInUp 0.6s ease;
}

.auth-card {
    background: rgba(18, 22, 32, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 32px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

    .auth-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: var(--gradient-1);
    }

.auth-card-large {
    max-width: 560px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Шапка карточки */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.logo-icon {
    font-size: 2.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    background: linear-gradient(135deg, #fff 0%, #d1d5e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ==========================================================================
   ФОРМЫ
   ========================================================================== */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.input-icon {
    color: var(--primary-light);
}

.form-input {
    width: 100%;
    padding: 0.875rem 1.2rem;
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

    .form-input:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
    }

    .form-input::placeholder {
        color: var(--text-muted);
    }

/* Поле с паролем */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

    .password-input-wrapper .form-input {
        padding-right: 3rem;
    }

.password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

    .password-toggle:hover {
        color: var(--text-primary);
    }

/* Индикатор сложности пароля */
.password-strength {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    transition: var(--transition);
}

/* Чекбокс */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    position: relative;
    transition: var(--transition);
}

.checkbox-input:checked + .checkbox-custom {
    background: var(--gradient-1);
    border-color: transparent;
}

    .checkbox-input:checked + .checkbox-custom::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(45deg);
        width: 5px;
        height: 10px;
        border: solid white;
        border-width: 0 2px 2px 0;
    }

.checkbox-text {
    font-size: 0.95rem;
}

/* Ссылки */
.forgot-link {
    color: var(--primary-light);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
}

    .forgot-link:hover {
        color: var(--primary-color);
        text-decoration: underline;
    }

.terms-link {
    color: var(--primary-light);
    text-decoration: none;
}

    .terms-link:hover {
        text-decoration: underline;
    }

/* Кнопка отправки */
.auth-button {
    position: relative;
    padding: 1rem;
    background: var(--gradient-1);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
    margin-top: 1rem;
}

    .auth-button::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }

    .auth-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(108, 92, 231, 0.4);
    }

        .auth-button:hover::before {
            width: 300px;
            height: 300px;
        }

    .auth-button.loading .button-text {
        opacity: 0;
    }

    .auth-button.loading .button-loader {
        display: block;
    }

.button-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s infinite linear;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Валидация */
.validation-summary {
    padding: 1rem;
    background: rgba(214, 48, 49, 0.1);
    border: 1px solid rgba(214, 48, 49, 0.3);
    border-radius: 12px;
    color: var(--danger-color);
    font-size: 0.95rem;
}

.validation-error {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Подвал карточки */
.auth-footer {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.auth-switch {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.switch-link {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

    .switch-link:hover {
        color: var(--primary-color);
        text-decoration: underline;
    }

/* ==========================================================================
   АДАПТИВНОСТЬ
   ========================================================================== */

@media (max-width: 768px) {
    .auth-wrapper {
        padding: 1rem;
    }

    .auth-card {
        padding: 2rem;
    }

    .auth-title {
        font-size: 1.75rem;
    }

    .form-row-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .auth-button {
        padding: 0.875rem;
    }
}
