/* Enhanced Auth Forms Styles */

/* Modal Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Enhanced Modal Styles */
.modal {
    animation: modalFadeIn 0.3s ease-out;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 480px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
    margin: 20px auto;
    transform: none;
}

/* Modal Header */
.modal-content > button.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-content > button.modal-close:hover {
    background: var(--bg-tertiary);
    transform: rotate(90deg);
}

/* Modal Title */
.modal-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    padding: 2rem 2rem 0;
}

/* User Type Selector */
.user-type-selector {
    display: flex;
    gap: 1rem;
    margin: 0 2rem 2rem;
    padding: 0.25rem;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.user-type-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-type-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Auth Form */
.auth-form {
    padding: 0 2rem 2rem;
}

/* Form Groups with Floating Labels */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
    transition: all 0.3s ease;
    background: white;
    padding: 0 0.5rem;
}

.form-input {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(6, 88, 204, 0.1);
}

.form-input:focus + label,
.form-input:not(:placeholder-shown) + label {
    top: -0.75rem;
    font-size: 0.875rem;
    color: var(--primary);
}

/* Password Input with Toggle */
.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
}

.password-toggle:hover {
    color: var(--primary);
}

/* Forgot Password Link */
.forgot-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Enhanced Checkbox */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    cursor: pointer;
    margin-top: 2px;
}

.form-checkbox input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.form-checkbox label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.form-checkbox label a {
    color: var(--primary);
    text-decoration: none;
}

.form-checkbox label a:hover {
    text-decoration: underline;
}

/* Submit Button */
.form-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, #0550b3 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(6, 88, 204, 0.3);
}

.form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 88, 204, 0.4);
}

.form-btn:active {
    transform: translateY(0);
}

/* Form Divider */
.form-divider {
    text-align: center;
    margin: 2rem 0;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-divider::before,
.form-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 30px);
    height: 1px;
    background: var(--border-light);
}

.form-divider::before {
    left: 0;
}

.form-divider::after {
    right: 0;
}

/* Social Auth Buttons */
.social-auth {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    background: white;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.social-btn.google {
    border-color: #ea4335;
    color: #ea4335;
}

.social-btn.google:hover {
    background: #ea4335;
    color: white;
}

.social-btn.vk {
    border-color: #0077ff;
    color: #0077ff;
}

.social-btn.vk:hover {
    background: #0077ff;
    color: white;
}

.social-btn i {
    font-size: 1.25rem;
}

/* Form Footer */
.form-footer {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Loading State */
.form-btn.loading {
    position: relative;
    color: transparent;
}

.form-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Success Animation */
@keyframes successPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

.form-input.success {
    border-color: #4CAF50;
    animation: successPulse 1s;
}

/* Error State */
.form-input.error {
    border-color: #f44336;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.error-message {
    font-size: 0.875rem;
    color: #f44336;
    margin-top: 0.5rem;
}

/* Responsive Design */
@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 10px;
    }
    
    .modal-title {
        font-size: 1.5rem;
        padding: 1.5rem 1.5rem 0;
    }
    
    .auth-form {
        padding: 0 1.5rem 1.5rem;
    }
    
    .user-type-selector {
        margin: 0 1.5rem 1.5rem;
    }
    
    .social-auth {
        flex-direction: column;
    }
    
    .form-btn {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
}