/* ================================
   Enhanced Auth Modal Styles
   Glassmorphism Design
   ================================ */

/* Modal Overlay with Blur Effect */
#auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#auth-modal[style*="display: flex"] {
    opacity: 1;
    visibility: visible;
}

/* Modal Content - Glassmorphism Style */
.auth-modal {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 420px;
    width: 90%;
    padding: 40px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#auth-modal[style*="display: flex"] .auth-modal {
    transform: scale(1);
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.7);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: rotate(90deg);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

/* Modal Title and Subtitle */
.modal-title {
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
    text-align: center;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Form Groups */
.auth-form .form-group {
    position: relative;
}

/* Form Inputs - Glassmorphism Style */
.auth-form .form-input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-family: var(--font-sans);
    transition: all 0.3s ease;
    outline: none;
}

.auth-form .form-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.auth-form .form-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: #6366f1;
    box-shadow: 
        0 0 0 3px rgba(99, 102, 241, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Submit Button - Gradient Style */
.auth-form .btn-gradient {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    padding: 16px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(99, 102, 241, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.auth-form .btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.auth-form .btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.auth-form .btn-gradient:hover::before {
    left: 100%;
}

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

/* Auth Switch Link */
.auth-switch {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-top: 20px;
}

.auth-switch a {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-switch a:hover {
    color: #8b5cf6;
    text-decoration: underline;
}

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

.auth-form .btn-gradient.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Error Messages */
.auth-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 12px;
    color: #fca5a5;
    font-size: 14px;
    text-align: center;
    animation: shake 0.5s ease-in-out;
}

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

/* Success Message */
.auth-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 8px;
    padding: 12px;
    color: #86efac;
    font-size: 14px;
    text-align: center;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .auth-modal {
        margin: 20px;
        padding: 30px 24px;
    }
    
    .modal-title {
        font-size: 24px;
    }
    
    .modal-subtitle {
        font-size: 14px;
    }
    
    .auth-form .form-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Registration Form Additions */
.auth-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 480px) {
    .auth-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* Form Options Container */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -10px;
    margin-bottom: 10px;
}

/* Remember Me Checkbox */
.auth-remember {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-remember input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
    cursor: pointer;
}

.auth-remember label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    cursor: pointer;
}

/* Forgot Password Link */
.auth-forgot {
    text-align: right;
    margin-top: -10px;
}

.auth-forgot a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-forgot a:hover {
    color: #6366f1;
}