:root {
    --primary-color: #003566;
    --secondary-color: #3b82f6;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --text-color: #1e293b;
    --text-light: #64748b;
    --border-radius: 16px;
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.15);
}

/* Modern Login Page Background */
body.modern-login-page {
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 50%, #f8fafc 100%);
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body.modern-login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 53, 102, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(0, 53, 102, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.modern-banner{
    margin-bottom: 0 !important;
}

/* Modern Login Container */
.modern-login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    min-height: 60vh !important;
}

.modern-login-wrapper {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
}

.modern-login-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Title - Scoped to login wrapper */
.modern-login-wrapper .modern-login-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Switch Container - Scoped to login wrapper */
.modern-login-wrapper .modern-switch-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.modern-login-wrapper .modern-switch-button {
    color: var(--secondary-color);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
}

.modern-login-wrapper .modern-switch-button:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Form Wrapper - Scoped to login wrapper */
.modern-login-wrapper .modern-form-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Form Group - Scoped to login wrapper */
.modern-login-wrapper .modern-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modern-login-wrapper .modern-form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.modern-login-wrapper .modern-form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--card-background);
    color: var(--text-color);
    font-family: inherit;
}

.modern-login-wrapper .modern-form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 53, 102, 0.1);
}

.modern-login-wrapper .modern-form-input::placeholder {
    color: var(--text-light);
    opacity: 0.6;
}

/* Submit Button - Scoped to login wrapper */
.modern-login-wrapper .modern-submit-button {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 53, 102, 0.2);
    margin-top: 0.5rem;
}

.modern-login-wrapper .modern-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px -2px rgba(0, 53, 102, 0.3);
}

.modern-login-wrapper .modern-submit-button:active {
    transform: translateY(0);
}

.modern-login-wrapper .modern-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Error Message - Scoped to login wrapper */
.modern-login-wrapper .modern-error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    border-left: 3px solid #ef4444;
    display: none;
}

.modern-login-wrapper .modern-error-message.show {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

/* Divider - Scoped to login wrapper */
.modern-login-wrapper .modern-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-size: 0.875rem;
}

.modern-login-wrapper .modern-divider::before,
.modern-login-wrapper .modern-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* Toggle Button - Scoped to login wrapper */
.modern-login-wrapper .modern-toggle-button {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: transparent;
    color: var(--text-color);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 1rem;
}

.modern-login-wrapper .modern-toggle-button:hover {
    border-color: var(--primary-color);
    background: rgba(0, 53, 102, 0.05);
    color: var(--primary-color);
}

/* Form Part (Login/SignUp) - Scoped to login page only */
.modern-login-wrapper .modern-form-part {
    display: flex;
    flex-direction: column;
    transition: opacity 0.5s ease, transform 0.5s ease;
    opacity: 0;
    visibility: hidden;
    position: absolute;
    left: 0;
    right: 0;
    transform: translateY(20px);
}

.modern-login-wrapper .modern-form-part.active {
    opacity: 1;
    visibility: visible;
    position: relative;
    transform: translateY(0);
}

/* Loading State */
.modern-login-wrapper.loading {
    pointer-events: none;
    opacity: 0.8;
}

.modern-login-wrapper.loading .modern-submit-button {
    position: relative;
    color: transparent;
}

.modern-login-wrapper.loading .modern-submit-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Compatibility with old classes - Renamed to avoid conflicts */
.modern-login-hide {
    transition: opacity 0.5s ease, visibility 0.5s ease;
    opacity: 1;
    visibility: visible;
    display: block;
}

.modern-login-hide:not(.active) {
    opacity: 0;
    visibility: hidden;
    display: none;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.modern-login-change-margin {
    transition: margin 0.5s ease, opacity 0.5s ease;
}

/* Ensure banner stays below header */
body.modern-login-page .modern-banner {
    z-index: 1;
}

/* Modern SweetAlert2 Styles */
.modern-swal-popup {
    border-radius: 16px !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    padding: 2rem !important;
}

.modern-swal-title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin-bottom: 1rem !important;
}

.modern-swal-content {
    font-size: 1rem !important;
    color: #64748b !important;
    line-height: 1.6 !important;
}

.modern-swal-button {
    background: linear-gradient(135deg, #003566, #3b82f6) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 0.75rem 2rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 53, 102, 0.2) !important;
    margin-top: 1rem !important;
}

.modern-swal-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 12px -2px rgba(0, 53, 102, 0.3) !important;
}

.modern-swal-button-error {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2) !important;
}

.modern-swal-button-error:hover {
    box-shadow: 0 8px 12px -2px rgba(239, 68, 68, 0.3) !important;
}

/* SweetAlert2 Icon Styling */
.swal2-icon.swal2-success {
    border-color: #10b981 !important;
    color: #10b981 !important;
}

.swal2-icon.swal2-success [class^=swal2-success-line] {
    background-color: #10b981 !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.swal2-icon.swal2-error {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}

.swal2-icon.swal2-error [class^=swal2-x-mark-line] {
    background-color: #ef4444 !important;
}

/* Fix spacing in form wrapper - Scoped to login wrapper */
.modern-login-wrapper .modern-form-wrapper {
    gap: 1.5rem;
}

/* Responsive */
@media (max-width: 640px) {
    .modern-login-container {
        padding: 1.5rem 1rem;
    }
    
    .modern-login-wrapper {
        padding: 2rem 1.5rem;
    }
    
    .modern-login-wrapper .modern-login-title {
        font-size: 1.75rem;
    }
    
    .modern-login-wrapper .modern-form-input {
        padding: 0.75rem 0.875rem;
        font-size: 0.95rem;
    }
    
    .modern-login-wrapper .modern-submit-button {
        padding: 0.875rem 1.25rem;
    }
    
    .modern-swal-popup {
        padding: 1.5rem !important;
    }
    
    .modern-swal-title {
        font-size: 1.25rem !important;
    }
}

