/* Login Page Styles - Professional & Consistent Design */

:root {
    /* Green Color Scheme - Kaymn Brand */
    --primary-green: #22c55e;
    --primary-green-light: #34d399;
    --primary-green-dark: #16a34a;
    --primary-green-darker: #15803d;
    
    /* Gradients */
    --green-gradient: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    --green-gradient-light: linear-gradient(135deg, #34d399 0%, #22c55e 100%);
    --green-gradient-subtle: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    
    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Typography */
    --font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Spacing */
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-5: 1.25rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --spacing-10: 2.5rem;
    --spacing-12: 3rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-green: 0 10px 15px -3px rgb(34 197 94 / 0.2), 0 4px 6px -4px rgb(34 197 94 / 0.1);
    
    /* Border Radius */
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

/* Login Wrapper */
.login-wrapper {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
}

/* Left Side - Branding */
.login-branding {
    background: var(--green-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-8);
    position: relative;
    overflow: hidden;
}

.login-branding::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.branding-content {
    max-width: 500px;
    width: 100%;
    z-index: 1;
    position: relative;
}

.brand-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: var(--spacing-12);
    text-decoration: none;
    color: inherit;
}

.brand-logo-icon {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-2xl);
    color: var(--white);
    font-size: 3rem;
    margin-bottom: var(--spacing-6);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-normal);
}

.brand-logo:hover .brand-logo-icon {
    transform: scale(1.05) rotate(5deg);
}

.brand-logo-text {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.brand-name {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--white);
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.brand-tagline {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    font-weight: 400;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-6);
}

.brand-feature {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-4);
    padding: var(--spacing-5);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all var(--transition-normal);
}

.brand-feature:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-4px);
}

.feature-icon-wrapper {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-xl);
    color: var(--white);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.feature-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: var(--spacing-1);
}

.feature-content p {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.6;
}

/* Right Side - Login Form */
.login-form-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-8);
    background: var(--white);
}

.login-form-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-8);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-200);
}

.login-card-header {
    text-align: center;
    margin-bottom: var(--spacing-8);
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--spacing-2);
}

.login-subtitle {
    font-size: 1rem;
    color: var(--gray-600);
    margin: 0;
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-6);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2);
}

.form-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-700);
}

.form-label i {
    color: var(--primary-green);
    font-size: 0.875rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--spacing-4);
    color: var(--gray-400);
    font-size: 1rem;
    z-index: 1;
    pointer-events: none;
    transition: color var(--transition-normal);
}

.form-input {
    width: 100%;
    padding: var(--spacing-4) var(--spacing-12) var(--spacing-4) var(--spacing-4);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-family: var(--font-family);
    color: var(--gray-900);
    background: var(--white);
    transition: all var(--transition-normal);
    outline: none;
    text-align: right;
}

/* Add extra padding when toggle password button exists */
.input-wrapper:has(.input-toggle-password) .form-input {
    padding-right: calc(var(--spacing-12) + 44px);
}

.form-input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.form-input:focus + .input-icon {
    color: var(--primary-green);
}

/* Ensure placeholder doesn't overlap with icon */
.form-input::placeholder {
    color: var(--gray-400);
    opacity: 1;
    text-align: right;
}

.input-toggle-password {
    position: absolute;
    right: var(--spacing-4);
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    z-index: 3;
    flex-shrink: 0;
}

.input-toggle-password i {
    font-size: 1rem;
    display: block;
    line-height: 1;
}

.input-toggle-password:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.input-toggle-password:active {
    transform: translateY(-50%) scale(0.95);
}

.form-error {
    font-size: 0.8125rem;
    color: #ef4444;
    min-height: 1.25rem;
    display: block;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-3);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--green-gradient);
    border-color: var(--primary-green);
}

.checkbox-wrapper input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 700;
}

.checkbox-label {
    font-size: 0.9375rem;
    color: var(--gray-700);
    cursor: pointer;
}

.forgot-password-link {
    font-size: 0.9375rem;
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-normal);
}

.forgot-password-link:hover {
    color: var(--primary-green-dark);
    text-decoration: underline;
}

/* Submit Button */
.login-submit-btn {
    width: 100%;
    padding: var(--spacing-4) var(--spacing-6);
    background: var(--green-gradient);
    border: none;
    border-radius: var(--radius-lg);
    color: var(--white);
    font-size: 1.0625rem;
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.login-submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.login-submit-btn:hover::before {
    opacity: 1;
}

.login-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.login-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Divider */
.form-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: var(--spacing-4) 0;
    position: relative;
}

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

.form-divider span {
    padding: 0 var(--spacing-4);
    font-size: 0.875rem;
    color: var(--gray-500);
    background: var(--white);
}

/* Social Login */
.social-login {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
}

.social-btn,
a.social-btn {
    width: 100%;
    padding: var(--spacing-3) var(--spacing-4);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-lg);
    background: var(--white);
    color: var(--gray-700);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-3);
    text-decoration: none;
}

.social-btn:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.social-btn i {
    font-size: 1.125rem;
}

/* Enhanced Google Button */
.google-btn {
    background: #ffffff;
    border: 1.5px solid #dadce0;
    color: #3c4043;
    position: relative;
    overflow: hidden;
}

.google-btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.google-icon {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.google-btn:hover {
    border-color: #4285f4;
    background: #f8f9fa;
    color: #1a73e8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.15);
}

.google-btn:hover .google-icon {
    transform: scale(1.1);
}

.google-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(66, 133, 244, 0.2);
}

.google-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(66, 133, 244, 0.1), transparent);
    transition: left 0.5s ease;
}

.google-btn:hover::before {
    left: 100%;
}

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

/* Signup Section */
.signup-section {
    margin-top: var(--spacing-6);
    padding-top: var(--spacing-6);
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.signup-text {
    font-size: 0.9375rem;
    color: var(--gray-600);
    margin: 0;
}

.signup-link {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-normal);
}

.signup-link:hover {
    color: var(--primary-green-dark);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .login-wrapper {
        grid-template-columns: 1fr;
    }
    
    .login-branding {
        display: none;
    }
    
    .login-form-section {
        background: var(--gray-50);
    }
}

@media (max-width: 768px) {
    .login-form-section {
        padding: var(--spacing-4);
    }
    
    .login-card {
        padding: var(--spacing-6);
    }
    
    .login-title {
        font-size: 1.75rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: var(--spacing-5);
    }
    
    .login-title {
        font-size: 1.5rem;
    }
}

/* Error State */
.form-input.error {
    border-color: #ef4444;
}

.form-input.error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* Success State */
.form-input.success {
    border-color: var(--primary-green);
}

.form-input.success:focus {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

/* Loading State */
.login-submit-btn.loading .btn-text {
    opacity: 0;
}

.login-submit-btn.loading .btn-loader {
    display: flex !important;
}
