/* Модальные окна авторизации */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 17, 23, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.auth-modal {
    background: linear-gradient(135deg, #1e2128, #1a1d24);
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    border: 1px solid #2d3748;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    position: relative;
}

.auth-modal.active {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.auth-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #dc2626, #b91c1c);
}

.auth-modal-header {
    padding: 30px 30px 20px;
    text-align: center;
    position: relative;
}

@media (max-width: 768px) {
    .auth-modal-header {
        padding: 25px 20px 15px;
    }
}

.auth-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid #2d3748;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.auth-modal-close:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.3);
    transform: rotate(90deg);
}

.auth-modal-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3);
}

.auth-modal-title {
    color: #f8fafc;
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 700;
}

@media (max-width: 480px) {
    .auth-modal-title {
        font-size: 24px;
    }
}

.auth-modal-subtitle {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 10px;
}

.auth-modal-content {
    padding: 0 30px 30px;
    max-height: 70vh;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .auth-modal-content {
        padding: 0 20px 25px;
    }
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form .form-label {
    display: block;
    margin-bottom: 8px;
    color: #f8fafc;
    font-size: 14px;
    font-weight: 500;
}

.auth-form .form-input {
    width: 100%;
    padding: 14px 16px;
    background: #242732;
    border: 1px solid #2d3748;
    border-radius: 10px;
    color: #f8fafc;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.auth-form .form-input:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    background: #1e2128;
}

.auth-form .form-input::placeholder {
    color: #64748b;
}

.auth-form .form-select {
    width: 100%;
    padding: 14px 16px;
    background: #242732;
    border: 1px solid #2d3748;
    border-radius: 10px;
    color: #f8fafc;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

.auth-form .form-select:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.auth-form .password-input {
    position: relative;
}

.auth-form .password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    transition: all 0.3s ease;
}

.auth-form .password-toggle:hover {
    color: #dc2626;
}

.auth-form .btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.auth-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.3);
}

.auth-form .btn-primary:active {
    transform: translateY(0);
}

.auth-form .form-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #2d3748;
    color: #94a3b8;
    font-size: 14px;
}

.auth-form .form-footer a {
    color: #dc2626;
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
    transition: all 0.3s ease;
}

.auth-form .form-footer a:hover {
    color: #b91c1c;
    text-decoration: underline;
}

/* Переключатель форм */
.auth-switch {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #2d3748;
}

.auth-switch p {
    color: #94a3b8;
    font-size: 14px;
}

.auth-switch-btn {
    background: none;
    border: none;
    color: #dc2626;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 5px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.auth-switch-btn:hover {
    background: rgba(220, 38, 38, 0.1);
    text-decoration: underline;
}

/* Анимация смены форм */
.auth-form {
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Валидация форм */
.auth-form .form-input.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.auth-form .error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.auth-form .form-input.success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

/* Социальная авторизация */
.auth-social {
    margin-top: 20px;
}

.auth-social-title {
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 15px;
    position: relative;
}

.auth-social-title::before,
.auth-social-title::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: #2d3748;
}

.auth-social-title::before {
    left: 0;
}

.auth-social-title::after {
    right: 0;
}

.auth-social-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (max-width: 768px) {
    .auth-social-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .auth-social-buttons {
        grid-template-columns: 1fr;
    }
}

.auth-social-btn {
    padding: 12px;
    background: #242732;
    border: 1px solid #2d3748;
    border-radius: 10px;
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.auth-social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.auth-social-btn.discord:hover {
    background: #5865F2;
    border-color: #5865F2;
}

.auth-social-btn.telegram:hover {
    background: #26A5E4;
    border-color: #26A5E4;
}

.auth-social-btn.vk:hover {
    background: #4C75A3;
    border-color: #4C75A3;
}

/* Загрузка */
.auth-form .btn-primary.loading {
    position: relative;
    color: transparent;
}

.auth-form .btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Успешная авторизация */
.auth-success {
    text-align: center;
    padding: 40px 20px;
}

.auth-success i {
    font-size: 64px;
    color: #10b981;
    margin-bottom: 20px;
}

.auth-success h3 {
    color: #f8fafc;
    margin-bottom: 10px;
}

.auth-success p {
    color: #94a3b8;
}

/* Адаптивность модалки */
@media (max-width: 768px) {
    .auth-modal {
        width: 95%;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .auth-modal {
        border-radius: 15px;
        max-height: 90vh;
    }
}