/* ==================================================================
   MODERN AUTH STYLES - Clean two-section design with dark theme
   ================================================================== */

/* Reset and Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Variables */
:root {
    /* Primary colors */
    --auth-primary: #4F46E5;
    --auth-primary-hover: #4338CA;
    --auth-secondary: #7C3AED;
    --auth-gradient-start: #4F46E5;
    --auth-gradient-end: #7C3AED;
    
    /* Dark theme colors */
    --auth-dark-bg: #0F172A;
    --auth-dark-card: #1E293B;
    --auth-dark-border: #334155;
    --auth-dark-input: #1E293B;
    --auth-dark-text: #F1F5F9;
    --auth-dark-text-muted: #94A3B8;
    
    /* Light colors for left section */
    --auth-light-text: #FFFFFF;
    
    /* System colors */
    --auth-success: #10B981;
    --auth-error: #EF4444;
    --auth-warning: #F59E0B;
    
    /* Typography */
    --auth-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Kufi Arabic', sans-serif;
    
    /* Transitions */
    --auth-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Body */
body.auth-page {
    font-family: var(--auth-font-family);
    background: var(--auth-dark-bg);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Main Container */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Left Section - Branding */
.auth-brand-section {
    flex: 0 0 45%;
    background: linear-gradient(135deg, var(--auth-gradient-start), var(--auth-gradient-end));
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Decorative Background Pattern */
.auth-brand-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: rotate(45deg);
    pointer-events: none;
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    color: var(--auth-light-text);
    max-width: 500px;
    margin: 0 auto;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.auth-logo img {
    height: 3rem;
    width: auto;
}

.auth-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
}

.auth-brand-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.auth-brand-subtitle {
    font-size: 1.125rem;
    line-height: 1.6;
    opacity: 0.95;
    margin-bottom: 3rem;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-feature-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-feature-text {
    font-size: 1rem;
    line-height: 1.5;
}

/* Center Divider */
.auth-divider-section {
    position: absolute;
    left: 45%;
    top: 0;
    bottom: 0;
    width: 100px;
    z-index: 10;
    pointer-events: none;
}

.auth-divider-svg {
    width: 100%;
    height: 100%;
}

.auth-divider-path {
    fill: var(--auth-dark-bg);
}

/* Right Section - Form */
.auth-form-section {
    flex: 1;
    background: var(--auth-dark-bg);
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 450px;
}

/* Form Card */
.auth-form-card {
    background: var(--auth-dark-card);
    border: 1px solid var(--auth-dark-border);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.auth-form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-form-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--auth-dark-text);
    margin-bottom: 0.5rem;
}

.auth-form-subtitle {
    font-size: 0.875rem;
    color: var(--auth-dark-text-muted);
}

/* Form Elements */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-dark-text);
}

.auth-input-group {
    position: relative;
}

.auth-input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-left: 2.75rem;
    background: var(--auth-dark-input);
    border: 1px solid var(--auth-dark-border);
    border-radius: 0.75rem;
    color: var(--auth-dark-text);
    font-size: 0.875rem;
    transition: var(--auth-transition);
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-primary);
    background: var(--auth-dark-bg);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.auth-input::placeholder {
    color: var(--auth-dark-text-muted);
}

.auth-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-dark-text-muted);
    font-size: 1rem;
    pointer-events: none;
}

/* Password Toggle */
.auth-password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--auth-dark-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--auth-transition);
}

.auth-password-toggle:hover {
    color: var(--auth-dark-text);
}

/* Remember & Forgot */
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    background: var(--auth-dark-input);
    border: 1px solid var(--auth-dark-border);
    border-radius: 0.25rem;
    cursor: pointer;
}

.auth-checkbox:checked {
    background: var(--auth-primary);
    border-color: var(--auth-primary);
}

.auth-checkbox-label {
    font-size: 0.875rem;
    color: var(--auth-dark-text);
    cursor: pointer;
}

.auth-link {
    font-size: 0.875rem;
    color: var(--auth-primary);
    text-decoration: none;
    transition: var(--auth-transition);
}

.auth-link:hover {
    color: var(--auth-primary-hover);
}

/* Submit Button */
.auth-submit {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--auth-gradient-start), var(--auth-gradient-end));
    border: none;
    border-radius: 0.75rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--auth-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.4);
}

.auth-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Social Login */
.auth-divider-line {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

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

.auth-divider-text {
    font-size: 0.75rem;
    color: var(--auth-dark-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-social-buttons {
    display: flex;
    gap: 1rem;
}

.auth-social-btn {
    flex: 1;
    padding: 0.75rem;
    background: var(--auth-dark-input);
    border: 1px solid var(--auth-dark-border);
    border-radius: 0.75rem;
    color: var(--auth-dark-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    transition: var(--auth-transition);
}

.auth-social-btn:hover {
    background: var(--auth-dark-bg);
    border-color: var(--auth-primary);
}

/* Footer Links */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
}

.auth-footer-text {
    font-size: 0.875rem;
    color: var(--auth-dark-text-muted);
}

.auth-footer-link {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--auth-transition);
}

.auth-footer-link:hover {
    color: var(--auth-primary-hover);
}

/* Language Selector */
.auth-language {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.auth-language-dropdown {
    position: relative;
}

.auth-language-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--auth-dark-input);
    border: 1px solid var(--auth-dark-border);
    border-radius: 0.5rem;
    color: var(--auth-dark-text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--auth-transition);
}

.auth-language-btn:hover {
    background: var(--auth-dark-bg);
    border-color: var(--auth-primary);
}

.auth-language-menu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.5rem;
    background: var(--auth-dark-card);
    border: 1px solid var(--auth-dark-border);
    border-radius: 0.75rem;
    padding: 0.5rem;
    min-width: 200px;
    display: none;
    box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.3);
}

.auth-language-menu.show {
    display: block;
}

.auth-language-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    color: var(--auth-dark-text);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: var(--auth-transition);
}

.auth-language-item:hover {
    background: var(--auth-dark-input);
}

.auth-language-item.active {
    background: var(--auth-primary);
    color: white;
}

/* Alerts */
.auth-alert {
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #86EFAC;
}

.auth-alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
}

.auth-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #FCD34D;
}

/* RTL Support */
[dir="rtl"] {
    /* Typography */
    font-family: 'Noto Kufi Arabic', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    direction: rtl;
}

[dir="rtl"] .auth-wrapper {
    flex-direction: row-reverse;
}

[dir="rtl"] .auth-brand-section {
    text-align: right;
}

[dir="rtl"] .auth-logo {
    flex-direction: row-reverse;
}

[dir="rtl"] .auth-input-group {
    direction: rtl;
}

[dir="rtl"] .auth-input {
    text-align: right;
    padding-left: 1rem;
    padding-right: 2.75rem;
    direction: rtl;
}

[dir="rtl"] .auth-input-icon {
    left: auto;
    right: 1rem;
}

[dir="rtl"] .auth-password-toggle {
    right: auto;
    left: 1rem;
}

[dir="rtl"] .auth-divider-section {
    left: auto;
    right: 45%;
    transform: scaleX(-1);
}

[dir="rtl"] .auth-divider-path {
    transform: scaleX(-1);
}

[dir="rtl"] .auth-feature-item {
    flex-direction: row-reverse;
    text-align: right;
}

[dir="rtl"] .auth-form-header {
    text-align: right;
}

[dir="rtl"] .auth-label {
    text-align: right;
}

[dir="rtl"] .auth-options {
    flex-direction: row-reverse;
}

[dir="rtl"] .auth-checkbox-group {
    flex-direction: row-reverse;
}

[dir="rtl"] .auth-checkbox-label {
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] .auth-submit {
    flex-direction: row-reverse;
}

[dir="rtl"] .auth-submit i {
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] .auth-alert {
    flex-direction: row-reverse;
    text-align: right;
}

[dir="rtl"] .auth-info-box {
    flex-direction: row-reverse;
}

[dir="rtl"] .auth-info-content {
    text-align: right;
}

[dir="rtl"] .auth-footer {
    text-align: right;
}

[dir="rtl"] .auth-language-dropdown {
    direction: ltr;
}

[dir="rtl"] .auth-language-btn {
    flex-direction: row-reverse;
}

[dir="rtl"] .auth-language-menu {
    left: auto;
    right: 0;
    text-align: right;
}

[dir="rtl"] .auth-language-item {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

[dir="rtl"] .auth-social-btn {
    flex-direction: row-reverse;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .auth-wrapper {
        flex-direction: column;
    }
    
    [dir="rtl"] .auth-wrapper {
        flex-direction: column;
    }
    
    .auth-brand-section {
        flex: none;
        min-height: auto;
        padding: 2rem;
        text-align: center;
    }
    
    [dir="rtl"] .auth-brand-section {
        text-align: center;
    }
    
    .auth-brand-content {
        max-width: 100%;
    }
    
    .auth-brand-title {
        font-size: 2rem;
    }
    
    .auth-features {
        display: none;
    }
    
    .auth-divider-section {
        display: none;
    }
    
    .auth-form-section {
        padding: 2rem;
        min-height: auto;
        flex: 1;
    }
    
    .auth-form-card {
        padding: 2rem;
        max-width: 100%;
    }
    
    .auth-language-menu {
        bottom: auto;
        top: 100%;
        margin-bottom: 0;
        margin-top: 0.5rem;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
        max-height: 300px;
        overflow-y: auto;
    }
}

@media (max-width: 640px) {
    .auth-brand-section {
        padding: 1.5rem;
    }
    
    .auth-logo {
        justify-content: center;
        margin-bottom: 2rem;
    }
    
    .auth-logo-text {
        font-size: 1.25rem;
    }
    
    .auth-form-section {
        padding: 1rem;
    }
    
    .auth-form-card {
        padding: 1.5rem;
        border-radius: 1rem;
    }
    
    .auth-form-title {
        font-size: 1.5rem;
    }
    
    .auth-brand-title {
        font-size: 1.5rem;
    }
    
    .auth-brand-subtitle {
        font-size: 0.875rem;
    }
    
    .auth-social-buttons {
        flex-direction: column;
    }
    
    .auth-social-btn {
        width: 100%;
        justify-content: center;
    }
    
    .auth-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .auth-submit {
        width: 100%;
        justify-content: center;
        padding: 0.875rem;
    }
    
    .auth-language-dropdown {
        position: relative;
    }
    
    .auth-language-menu {
        width: 100%;
        left: 0;
        right: 0;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .auth-form-card {
        padding: 1.25rem;
    }
    
    .auth-form-title {
        font-size: 1.25rem;
    }
    
    .auth-form-subtitle {
        font-size: 0.875rem;
    }
    
    .auth-field {
        margin-bottom: 1rem;
    }
    
    .auth-label {
        font-size: 0.875rem;
    }
}

/* Loading State */
.auth-loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: auth-spin 0.75s linear infinite;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Fade In Animation */
@keyframes auth-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form-card {
    animation: auth-fade-in 0.6s ease-out;
}