/* Стили для страницы входа и регистрации */

/* Красивый градиентный фон */
#auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 1;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Анимированные частицы на фоне */
#auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: particleFloat 20s ease-in-out infinite;
    pointer-events: none;
}

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

.auth-box {
    background: var(--surface-color);
    padding: 50px 40px;
    border-radius: 24px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 80px rgba(124, 58, 237, 0.15);
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.6s ease;
}

/* Светящаяся граница */
.auth-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    border-radius: 24px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
    animation: borderGlow 3s linear infinite;
    background-size: 200% 200%;
}

.auth-box:hover::before {
    opacity: 0.5;
}

@keyframes borderGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.app-title {
    text-align: center;
    font-size: 56px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    animation: titleGlow 2s ease-in-out infinite;
    text-shadow: 0 0 40px var(--primary-glow);
}

@keyframes titleGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 35px;
    font-size: 16px;
    animation: fadeIn 0.8s ease;
}

/* Разделитель "или" */
.divider {
    text-align: center;
    margin: 25px 0;
    color: var(--text-secondary);
    position: relative;
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

/* Кнопка Google */
.btn-google {
    width: 100%;
    padding: 12px;
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-google::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-google:hover::before {
    width: 400px;
    height: 400px;
}

.btn-google:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px var(--primary-glow);
    transform: translateY(-2px);
}

.btn-google svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.btn-google span {
    position: relative;
    z-index: 1;
}

/* Футер с ссылкой на регистрацию */
.auth-footer {
    text-align: center;
    margin-top: 25px;
    color: var(--text-secondary);
    font-size: 14px;
    animation: fadeIn 1s ease;
}

/* Кнопка "Назад" */
.back-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 8px;
}

.back-btn:hover {
    background: rgba(124, 58, 237, 0.1);
    transform: translateX(-5px);
}

/* Подсказка под полем юзернейма */
.username-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: -4px;
    margin-bottom: 12px;
    margin-left: 4px;
}

/* Адаптивность для мобильных */
@media (max-width: 480px) {
    .auth-box {
        padding: 40px 25px;
    }
    
    .app-title {
        font-size: 42px;
    }
}

/* Анимация появления формы */
form {
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 2FA Code Input */
.code-input-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 25px 0;
}

.code-digit {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.code-digit:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 20px var(--primary-glow);
    background: var(--surface-color);
}

.code-digit.error {
    border-color: var(--error-color);
    box-shadow: 0 0 20px var(--error-glow);
    animation: shake 0.4s ease;
}

.resend-code-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.resend-code-btn:hover {
    background: rgba(124, 58, 237, 0.1);
}

.resend-code-btn:disabled {
    color: var(--text-secondary);
    cursor: not-allowed;
}

.code-timer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 10px;
}
