/* ================================
   ОБЩИЕ СТИЛИ ДЛЯ АУТЕНТИФИКАЦИИ
   ================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.auth-page {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Анимированный фон */
body.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(102, 126, 234, 0.1) 0%, transparent 40%);
    animation: backgroundFloat 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes backgroundFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(50px, 50px) rotate(5deg);
    }
}

/* Плавающие частицы */
body.auth-page::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 60% 70%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 33% 80%, rgba(255, 255, 255, 0.3), transparent);
    background-size: 200% 200%;
    animation: particleFloat 30s linear infinite;
    pointer-events: none;
}

@keyframes particleFloat {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 100%;
    }
}

/* ================================
   КОНТЕЙНЕР ФОРМЫ
   ================================ */
.auth-container {
    background: rgba(30, 30, 70, 0.85);
    backdrop-filter: blur(20px);
    padding: 50px 45px;
    border-radius: 30px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(102, 126, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}





/* ================================
   ЗАГОЛОВОК
   ================================ */
.auth-container h1 {
    margin-bottom: 35px;
    font-size: 2.8rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientText 4s ease infinite;
    letter-spacing: -1px;
}

@keyframes gradientText {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ================================
   ФОРМА
   ================================ */
form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ================================
   ИНПУТЫ
   ================================ */
input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0ff;
    font-size: 1.05rem;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
}

input:focus {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.1),
        0 5px 15px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

input::placeholder {
    color: rgba(224, 224, 255, 0.5);
    font-size: 0.95rem;
}

input:hover {
    border-color: rgba(102, 126, 234, 0.4);
    background: rgba(255, 255, 255, 0.07);
}

/* ================================
   КНОПКА ОТПРАВКИ
   ================================ */
button[type="submit"] {
    width: 100%;
    padding: 17px;
    margin-top: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #764ba2, #f093fb);
    transition: left 0.4s ease;
}

button[type="submit"]:hover::before {
    left: 0;
}

button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.5);
}

button[type="submit"]:active {
    transform: translateY(-1px);
}

button[type="submit"] span {
    position: relative;
    z-index: 1;
}

/* ================================
   СООБЩЕНИЯ ОБ ОШИБКАХ
   ================================ */
.error {
    background: rgba(255, 59, 92, 0.15);
    border: 2px solid rgba(255, 59, 92, 0.5);
    color: #ff6b6b;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    animation: shake 0.5s ease;
    backdrop-filter: blur(5px);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ================================
   НИЖНЯЯ ССЫЛКА
   ================================ */
.auth-container > p {
    text-align: center;
    margin-top: 25px;
    color: rgba(224, 224, 255, 0.7);
    font-size: 1rem;
}

.auth-container > p a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    padding-bottom: 2px;
}

.auth-container > p a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.auth-container > p a:hover::after {
    width: 100%;
}

.auth-container > p a:hover {
    color: #764ba2;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* ================================
   АДАПТИВНОСТЬ
   ================================ */
@media (max-width: 768px) {
    body.auth-page {
        padding: 15px;
    }

    .auth-container {
        padding: 40px 30px;
        border-radius: 25px;
    }

    .auth-container h1 {
        font-size: 2.2rem;
        margin-bottom: 30px;
    }

    input {
        padding: 14px 18px;
        font-size: 1rem;
    }

    button[type="submit"] {
        padding: 15px;
        font-size: 1.05rem;
    }

    .error {
        font-size: 0.9rem;
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 35px 25px;
        border-radius: 20px;
    }

    .auth-container h1 {
        font-size: 1.9rem;
        margin-bottom: 25px;
    }

    input {
        padding: 13px 16px;
        font-size: 0.95rem;
        border-radius: 12px;
    }

    button[type="submit"] {
        padding: 14px;
        font-size: 1rem;
        border-radius: 12px;
    }

    .auth-container > p {
        font-size: 0.9rem;
    }
}

/* ================================
   ДОПОЛНИТЕЛЬНЫЕ ЭФФЕКТЫ
   ================================ */

/* Иконки в инпутах (опционально) */
.input-group {
    position: relative;
}

.input-group input {
    padding-left: 50px;
}

.input-group::before {
    content: '📧';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    pointer-events: none;
    opacity: 0.6;
    z-index: 1;
}

.input-group.password::before {
    content: '🔒';
}

/* Индикатор загрузки на кнопке */
button[type="submit"].loading {
    pointer-events: none;
    opacity: 0.7;
}

button[type="submit"].loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Эффект печати для заголовка */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

.auth-container h1.typing {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 2s steps(40, end);
}