/* Modal System Styles */

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Modal Container */
.modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    width: 90%;
    height: auto;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Modal Brand Header */
.modal-brand-header {
    background: linear-gradient(135deg, #003b5a 0%, #0076c7 100%);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px 12px 0 0;
    position: relative;
}

.modal-logo {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
}

.modal-logo-text {
    font-size: 24px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

/* Modal Header */
.modal-header {
    padding: 16px 24px 0;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

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

.modal-close svg {
    width: 14px;
    height: 14px;
    color: white;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
    padding-right: 40px;
}

.modal-subtitle {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

/* Modal Body */
.modal-body {
    padding: 16px 24px;
    flex: 1;
    overflow-y: hidden;
}

/* Login Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-input {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input.error {
    border-color: #ef4444;
}

.form-error {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
}

/* Password Input Group */
.password-input-group {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #666;
}

.password-toggle:hover {
    color: #333;
}

/* Remember Me & Forgot Password */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-group label {
    font-size: 13px;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.forgot-password {
    font-size: 13px;
    color: #003b5a;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: #0076c7;
}

/* Submit Button */
.btn-submit {
    padding: 11px 24px;
    background: #003b5a;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.btn-submit:hover {
    background: #0076c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 59, 90, 0.2);
}

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

.btn-submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

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

.btn-submit.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.6s linear infinite;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    gap: 12px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.divider-text {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Social Login Buttons */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.social-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.social-btn img,
.social-btn svg {
    width: 20px;
    height: 20px;
}

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

.social-btn.google:hover {
    background: rgba(66, 133, 244, 0.05);
}

.social-btn.facebook {
    border-color: #1877f2;
    color: #1877f2;
}

.social-btn.facebook:hover {
    background: rgba(24, 119, 242, 0.05);
}

.social-btn.linkedin {
    border-color: #0077b5;
    color: #0077b5;
}

.social-btn.linkedin:hover {
    background: rgba(0, 119, 181, 0.05);
}

.social-btn.apple {
    border-color: #000;
    color: #000;
}

.social-btn.apple:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* User Type Toggle */
.user-type-toggle {
    display: flex;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 12px;
}

.user-type-btn {
    flex: 1;
    padding: 8px 14px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-type-btn.active {
    background: white;
    color: #003b5a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Modal Footer */
.modal-footer {
    padding: 12px 24px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    background: #fafafa;
    flex-shrink: 0;
}

.modal-footer-text {
    font-size: 13px;
    color: #6b7280;
}

.modal-footer-link {
    color: #003b5a;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.modal-footer-link:hover {
    color: #0076c7;
}

/* Alert Messages */
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

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

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

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

/* Responsive Design */
@media (max-width: 480px) {
    .modal-container {
        width: 95%;
        max-width: none;
        margin: 16px;
        max-height: 90vh;
    }
    
    .modal-brand-header {
        padding: 16px 20px;
    }
    
    .modal-logo-text {
        font-size: 20px;
    }
    
    .modal-header {
        padding: 12px 20px 0;
    }
    
    .modal-body {
        padding: 12px 20px;
    }
    
    .modal-title {
        font-size: 18px;
    }
    
    .user-type-toggle {
        flex-direction: row;
        gap: 4px;
    }
    
    .user-type-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .form-input {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .btn-submit {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .modal-container {
        background: #1f2937;
        color: #f3f4f6;
    }
    
    .modal-title {
        color: #f3f4f6;
    }
    
    .modal-subtitle {
        color: #9ca3af;
    }
    
    .form-label {
        color: #d1d5db;
    }
    
    .form-input {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }
    
    .form-input:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    }
    
    .modal-close {
        background: #374151;
        color: #9ca3af;
    }
    
    .modal-close:hover {
        background: #4b5563;
    }
    
    .divider::before,
    .divider::after {
        background: #374151;
    }
    
    .social-btn {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }
    
    .social-btn:hover {
        background: #4b5563;
    }
    
    .user-type-toggle {
        background: #374151;
    }
    
    .user-type-btn.active {
        background: #4b5563;
    }
    
    .modal-footer {
        border-top-color: #374151;
    }
}