/* SoftSins Authentication Modal Styles */

/* Modal Overlay */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 24, 16, 0.8);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.auth-modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    position: relative;
}

.auth-modal-overlay.active .auth-modal {
    transform: translateY(0) scale(1);
}

/* Modal Header */
.auth-modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 30px;
    text-align: center;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    position: relative;
}

.auth-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-modal-close:hover {
    background: rgba(255,255,255,0.1);
    color: var(--white);
}

.auth-modal-logo {
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: var(--white);
}

.auth-modal-subtitle {
    opacity: 0.9;
    font-size: var(--text-sm);
    margin: 0;
    color: var(--white);
}

/* Modal Content */
.auth-modal-content {
    padding: 40px 30px 30px;
}

.auth-form-toggle {
    display: flex;
    background: var(--gray-lighter);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: 30px;
}

.auth-toggle-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-toggle-btn.active {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Form Styles */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form-group {
    margin-bottom: 20px;
}

.auth-form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 8px;
}

.auth-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-lighter);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-family: var(--font-secondary);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.auth-form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 90, 131, 0.1);
}

.auth-form-input.error {
    border-color: #E53E3E;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.auth-form-error {
    color: #E53E3E;
    font-size: var(--text-xs);
    margin-top: 5px;
    display: none;
}

.auth-form-error.show {
    display: block;
}

/* Password Toggle */
.auth-password-group {
    position: relative;
}

.auth-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: var(--text-sm);
    padding: 5px;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    border: none;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 20px;
}

.auth-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(139, 90, 131, 0.3);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-submit-btn.loading {
    position: relative;
    color: transparent;
}

.auth-submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: var(--gray);
    font-size: var(--text-sm);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-lighter);
}

.auth-divider span {
    margin: 0 15px;
}

/* Magic Link */
.auth-magic-link {
    width: 100%;
    background: var(--off-white);
    border: 2px solid var(--gray-lighter);
    color: var(--dark);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 15px;
}

.auth-magic-link:hover {
    background: var(--gray-lighter);
    border-color: var(--primary-color);
}

/* Links */
.auth-form-link {
    text-align: center;
    margin-top: 20px;
}

.auth-form-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
}

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

/* Success/Error Messages */
.auth-message {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: var(--text-sm);
    display: none;
}

.auth-message.show {
    display: block;
}

.auth-message.success {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.auth-message.error {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-modal {
        margin: 10px;
        max-width: none;
        width: calc(100% - 20px);
    }
    
    .auth-modal-header {
        padding: 25px 20px;
    }
    
    .auth-modal-content {
        padding: 30px 20px 20px;
    }
    
    .auth-modal-logo {
        font-size: 1.75rem;
    }
}