/* Login Page Styles */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Tajawal', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    direction: rtl;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Elements */
.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #0a0d37 0%, #1a1d47 50%, #2a2d57 100%);
}

.background-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    animation: float 8s ease-in-out infinite;
}

.shape-1 {
    width: 200px;
    height: 200px;
    top: 10%;
    right: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 15%;
    animation-delay: 3s;
}

.shape-3 {
    width: 100px;
    height: 100px;
    top: 60%;
    right: 30%;
    animation-delay: 6s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.background-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 2px, transparent 2px),
                      radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 2px, transparent 2px);
    background-size: 50px 50px;
    animation: patternMove 20s linear infinite;
}

@keyframes patternMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Main Container */
.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
}

/* Left Side - Branding */
.login-branding {
    background: linear-gradient(135deg, #0a0d37 0%, #1a1d47 100%);
    color: white;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-branding::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="brandingPattern" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23brandingPattern)"/></svg>');
    z-index: 1;
}

.branding-content {
    position: relative;
    z-index: 2;
}

.logo-section {
    text-align: center;
    margin-bottom: 50px;
}

.main-logo {
    height: 60px;
    width: auto;
    margin-bottom: 30px;
    filter: brightness(0) invert(1);
}

.logo-section h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-section p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
}

/* Features Preview */
.features-preview {
    margin-bottom: 40px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.feature-text h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: white;
}

.feature-text p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

/* Stats Mini */
.stats-mini {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.stat-mini {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 1;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Right Side - Login Form */
.login-form-section {
    padding: 60px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.form-container {
    width: 100%;
    max-width: 400px;
}

/* Form Header */
.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #0a0d37;
    margin-bottom: 10px;
}

.form-header p {
    color: #5d5f75;
    font-size: 1rem;
    line-height: 1.5;
}

/* Form Styles */
.login-form {
    width: 100%;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.input-wrapper:hover {
    border-color: #dee2e6;
}

.input-wrapper.focused {
    border-color: #28a745;
    background: white;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.input-wrapper.error {
    border-color: #dc3545;
    background: #fff5f5;
}

.input-icon {
    padding: 0 15px;
    color: #6c757d;
    display: flex;
    align-items: center;
}

.form-input {
    flex: 1;
    padding: 15px 15px 15px 0;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: #333;
    outline: none;
    font-family: inherit;
}

.form-input::placeholder {
    color: #adb5bd;
}

.password-toggle {
    background: none;
    border: none;
    padding: 15px;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.password-toggle:hover {
    color: #28a745;
}

.error-message {
    display: block;
    color: #dc3545;
    font-size: 0.8rem;
    margin-top: 5px;
    font-weight: 500;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #28a745;
}

.remember-me label {
    font-size: 0.9rem;
    color: #5d5f75;
    margin: 0;
    cursor: pointer;
}

.forgot-password {
    color: #28a745;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.forgot-password:hover {
    color: #20c997;
    text-decoration: underline;
}

/* reCAPTCHA */
.recaptcha-wrapper {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.g-recaptcha {
    transform: scale(0.9);
    transform-origin: center;
}

/* Login Button */
.login-button {
    width: 100%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    margin-bottom: 25px;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.3);
}

.login-button:active {
    transform: translateY(0);
}

.login-button.loading .button-text {
    opacity: 0;
}

.login-button.loading .button-icon {
    opacity: 0;
}

.button-loader {
    position: absolute;
    display: none;
}

.login-button.loading .button-loader {
    display: block;
}

.loader-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.button-icon {
    transition: all 0.3s ease;
}

/* Sign Up Link */
.signup-link {
    text-align: center;
    margin-bottom: 30px;
}

.signup-link p {
    color: #5d5f75;
    font-size: 0.95rem;
}

.signup-link a {
    color: #28a745;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.signup-link a:hover {
    color: #20c997;
    text-decoration: underline;
}

/* Social Login */
.social-login {
    margin-top: 30px;
}

.divider {
    position: relative;
    text-align: center;
    margin-bottom: 25px;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e9ecef;
}

.divider span {
    background: white;
    padding: 0 20px;
    color: #6c757d;
    font-size: 0.9rem;
    position: relative;
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
}

.social-btn:hover {
    border-color: #dee2e6;
    background: #f8f9fa;
    transform: translateY(-1px);
}

.google-btn:hover {
    border-color: #4285F4;
    background: rgba(66, 133, 244, 0.05);
}

/* Footer */
.login-footer {
    background: white;
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #5d5f75;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #28a745;
}

.footer-copyright {
    color: #6c757d;
    font-size: 0.8rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top: 4px solid #28a745;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(2) {
    animation-delay: 0.1s;
    border-top-color: #20c997;
}

.spinner-ring:nth-child(3) {
    animation-delay: 0.2s;
    border-top-color: #17a2b8;
}

.loading-overlay p {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 500px;
    }
    
    .login-branding {
        display: none;
    }
    
    .login-form-section {
        padding: 40px 30px;
    }
}

@media (max-width: 768px) {
    .login-form-section {
        padding: 30px 20px;
    }
    
    .form-container {
        max-width: 100%;
    }
    
    .form-header h2 {
        font-size: 1.8rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
    
    .g-recaptcha {
        transform: scale(0.8);
    }
}

@media (max-width: 480px) {
    .login-form-section {
        padding: 20px 15px;
    }
    
    .form-header h2 {
        font-size: 1.6rem;
    }
    
    .input-wrapper {
        border-radius: 8px;
    }
    
    .login-button {
        border-radius: 8px;
        padding: 12px 25px;
    }
    
    .g-recaptcha {
        transform: scale(0.7);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .login-container {
        background: white;
        border: 2px solid #000;
    }
    
    .input-wrapper {
        border-color: #000;
    }
    
    .login-button {
        background: #000;
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .shape,
    .background-pattern,
    .loader-spinner,
    .spinner-ring {
        animation: none;
    }
    
    .login-button,
    .input-wrapper,
    .feature-item {
        transition: none;
    }
}

/* Print Styles */
@media print {
    .login-background,
    .loading-overlay,
    .social-login {
        display: none;
    }
    
    .login-container {
        background: white;
        box-shadow: none;
    }
    
    .login-branding {
        background: white;
        color: black;
    }
}

/* Focus Styles for Accessibility */
.form-input:focus,
.login-button:focus,
.social-btn:focus,
.password-toggle:focus {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
}

/* Selection Styles */
::selection {
    background: rgba(40, 167, 69, 0.2);
    color: #0a0d37;
}