/**
 * ============================================
 * AGM360 - Auth Pages CSS v1.0
 * صفحات المصادقة - Linear Style
 * ============================================
 */

/* ============================================ */
/* 🎨 1. Auth Layout                            */
/* ============================================ */
.auth-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg-canvas);
}

/* ═══ Left Side (Brand) ═══ */
.auth-brand {
    background: linear-gradient(135deg, #0A0A0F 0%, #16161A 50%, #1C1C20 100%);
    padding: var(--space-8);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .auth-brand {
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 50%, #E2E8F0 100%);
}

.auth-brand::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -30%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(94, 106, 210, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: float 12s ease-in-out infinite;
}

.auth-brand::after {
    content: '';
    position: absolute;
    bottom: -40%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.1); }
}

/* ═══ Brand Header ═══ */
.auth-brand-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: inherit;
}

.auth-brand-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--brand-primary), var(--color-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: var(--font-bold);
    box-shadow: 0 8px 24px rgba(94, 106, 210, 0.4);
    flex-shrink: 0;
}

.auth-brand-name {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* ═══ Brand Content ═══ */
.auth-brand-content {
    position: relative;
    z-index: 1;
    max-width: 480px;
}

.auth-brand-title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: var(--font-bold);
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    letter-spacing: -0.03em;
}

.auth-brand-title span {
    background: linear-gradient(135deg, var(--brand-primary), var(--color-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-brand-description {
    font-size: var(--text-md);
    line-height: var(--leading-relaxed);
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

/* ═══ Features ═══ */
.auth-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-base);
    color: var(--text-secondary);
}

.auth-feature-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: rgba(94, 106, 210, 0.15);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

/* ═══ Brand Footer ═══ */
.auth-brand-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    flex-wrap: wrap;
}

.auth-brand-footer span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ═══ Right Side (Form) ═══ */
.auth-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) var(--space-6);
    background: var(--bg-canvas);
}

.auth-form-container {
    width: 100%;
    max-width: 400px;
}

.auth-form-header {
    margin-bottom: var(--space-6);
}

.auth-form-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-2);
}

.auth-form-subtitle {
    font-size: var(--text-base);
    color: var(--text-tertiary);
    line-height: var(--leading-normal);
}

/* ═══ Form Elements ═══ */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.auth-form .form-group {
    margin-bottom: 0;
}

.auth-form .form-input {
    height: 42px;
    padding: 0 var(--space-4);
    font-size: var(--text-md);
}

.auth-form .form-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-light);
}

.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

/* ═══ Password Input with Toggle ═══ */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-input {
    padding-left: 44px;
}

.password-toggle {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all var(--ease-base);
}

.password-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ═══ Checkbox Row ═══ */
.auth-checkbox-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    font-size: var(--text-base);
    color: var(--text-secondary);
    user-select: none;
}

.auth-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-primary);
    cursor: pointer;
}

.auth-link {
    font-size: var(--text-base);
    color: var(--brand-primary);
    text-decoration: none;
    transition: color var(--ease-base);
}

.auth-link:hover {
    color: var(--brand-primary-hover);
}

/* ═══ Submit Button ═══ */
.auth-submit {
    height: 44px;
    width: 100%;
    padding: 0 var(--space-5);
    background: var(--brand-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-arabic);
    font-size: var(--text-md);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--ease-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    position: relative;
    overflow: hidden;
}

.auth-submit:hover:not(:disabled) {
    background: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(94, 106, 210, 0.3);
}

.auth-submit:active:not(:disabled) {
    transform: translateY(0);
}

.auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-submit .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ═══ Divider ═══ */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    margin: var(--space-2) 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* ═══ Footer Link ═══ */
.auth-footer {
    text-align: center;
    margin-top: var(--space-5);
    font-size: var(--text-base);
    color: var(--text-tertiary);
}

.auth-footer a {
    color: var(--brand-primary);
    font-weight: var(--font-medium);
    text-decoration: none;
    transition: color var(--ease-base);
}

.auth-footer a:hover {
    color: var(--brand-primary-hover);
}

/* ═══ Error/Alert ═══ */
.auth-alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    line-height: var(--leading-normal);
}

.auth-alert i {
    font-size: 15px;
    flex-shrink: 0;
    margin-top: 2px;
}

.auth-alert.error {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border: 1px solid rgba(229, 72, 77, 0.2);
}

.auth-alert.success {
    background: var(--color-success-light);
    color: var(--color-success);
    border: 1px solid rgba(38, 162, 105, 0.2);
}

.auth-alert.info {
    background: var(--color-info-light);
    color: var(--color-info);
    border: 1px solid rgba(14, 165, 233, 0.2);
}

/* ═══ Field Error ═══ */
.form-input.error {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px var(--color-danger-light);
}

.form-error {
    font-size: var(--text-sm);
    color: var(--color-danger);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

/* ═══ Password Strength ═══ */
.password-strength {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.password-strength-bar {
    flex: 1;
    height: 3px;
    background: var(--border-subtle);
    border-radius: var(--radius-full);
    transition: background var(--ease-base);
}

.password-strength-bar.active {
    background: var(--color-success);
}

.password-strength-bar.weak {
    background: var(--color-danger);
}

.password-strength-bar.medium {
    background: var(--color-warning);
}

/* ═══ Responsive ═══ */
@media (max-width: 992px) {
    .auth-layout {
        grid-template-columns: 1fr;
    }
    
    .auth-brand {
        display: none;
    }
    
    .auth-form-side {
        min-height: 100vh;
        padding: var(--space-6) var(--space-4);
    }
}

@media (max-width: 480px) {
    .auth-form-row {
        grid-template-columns: 1fr;
    }
    
    .auth-form-title {
        font-size: var(--text-xl);
    }
}