/**
 * SACCO Pro - Brandon Design System 1
 * Authentication Styles
 * 
 * @version 1.0.0
 * @author Ochieng Brandon (Sysnav Technologies)
 * @updated March 2026
 */

/* ============================================================================
   DESIGN TOKENS - Brandon Design System 1
   ============================================================================ */

:root {
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Segoe UI', system-ui, sans-serif;
    
    /* Primary Colors (Blue) */
    --color-primary-50: #eff6ff;
    --color-primary-100: #dbeafe;
    --color-primary-200: #bfdbfe;
    --color-primary-300: #93c5fd;
    --color-primary-400: #60a5fa;
    --color-primary-500: #3b82f6;
    --color-primary-600: #2563eb;
    --color-primary-700: #1d4ed8;
    --color-primary-800: #1e40af;
    --color-primary-900: #1e3a8a;
    --color-primary-950: #172554;
    
    /* Accent Colors (Purple) */
    --color-accent-50: #f5f3ff;
    --color-accent-100: #ede9fe;
    --color-accent-200: #ddd6fe;
    --color-accent-300: #c4b5fd;
    --color-accent-400: #a78bfa;
    --color-accent-500: #8b5cf6;
    --color-accent-600: #7c3aed;
    --color-accent-700: #6d28d9;
    
    /* Semantic Colors */
    --color-success-50: #ecfdf5;
    --color-success-100: #d1fae5;
    --color-success-500: #10b981;
    --color-success-600: #059669;
    --color-success-700: #047857;
    
    --color-warning-50: #fffbeb;
    --color-warning-100: #fef3c7;
    --color-warning-500: #f59e0b;
    --color-warning-600: #d97706;
    
    --color-danger-50: #fef2f2;
    --color-danger-100: #fee2e2;
    --color-danger-500: #ef4444;
    --color-danger-600: #dc2626;
    
    /* Neutral Colors */
    --color-background: #f8fafc;
    --color-surface: #ffffff;
    --color-text-primary: #1d1d1f;
    --color-text-secondary: #6e6e73;
    --color-border: #c4c7c5;
    --color-sidebar-bg: #f0f4f9;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ============================================================================
   BASE STYLES
   ============================================================================ */

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

body {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.5;
    letter-spacing: -0.006em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--color-background);
    min-height: 100vh;
    display: flex;
}

/* ============================================================================
   AUTH LAYOUT - Split Screen Design
   ============================================================================ */

.auth-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Left Panel - Branding (Desktop Only) */
.auth-left-panel {
    width: 50%;
    background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-900) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    position: relative;
    overflow: hidden;
}

.auth-left-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-left-panel::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-branding {
    position: relative;
    z-index: 1;
    color: white;
}

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

.auth-logo-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    backdrop-filter: blur(10px);
}

.auth-logo-text {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.auth-tagline {
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    opacity: 0.95;
}

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

.auth-feature-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
    font-size: 0.9375rem;
    font-weight: 500;
    width: fit-content;
    transition: all 0.2s ease;
}

.auth-feature-pill:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.auth-feature-pill i {
    font-size: 1.125rem;
}

/* Right Panel - Form Container */
.auth-right-panel {
    width: 50%;
    background: var(--color-surface);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    position: relative;
}

.auth-form-container {
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
}

.auth-form-header {
    margin-bottom: 2.5rem;
}

.auth-form-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

.auth-form-subtitle {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
}

/* ============================================================================
   FORM ELEMENTS
   ============================================================================ */

.auth-form-group {
    margin-bottom: 1.5rem;
}

.auth-form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.625rem;
    letter-spacing: -0.006em;
}

.auth-form-label i {
    color: var(--color-primary-500);
    font-size: 1rem;
}

.auth-form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    color: var(--color-text-primary);
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    letter-spacing: -0.006em;
}

.auth-form-input::placeholder {
    color: var(--color-text-secondary);
}

.auth-form-input:focus {
    outline: none;
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px var(--color-primary-100);
}

.auth-form-input.is-invalid {
    border-color: var(--color-danger-500);
}

.auth-form-input.is-invalid:focus {
    box-shadow: 0 0 0 3px var(--color-danger-100);
}

.auth-form-error {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--color-danger-600);
    font-weight: 500;
}

.auth-form-error i {
    font-size: 0.875rem;
}

/* Remember Me */
.auth-form-check {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.5rem;
}

.auth-form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    accent-color: var(--color-primary-600);
}

.auth-form-check-label {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--font-sans);
    color: white;
    background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-600) 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: -0.006em;
    position: relative;
    overflow: hidden;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

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

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

.auth-submit-btn .btn-icon {
    margin-right: 0.5rem;
}

.auth-submit-btn .btn-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================================================
   ALERTS
   ============================================================================ */

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.auth-alert-danger {
    background: var(--color-danger-50);
    color: #991b1b;
    border-color: var(--color-danger-100);
}

.auth-alert i {
    font-size: 1.125rem;
    margin-top: 1px;
    flex-shrink: 0;
}

.auth-alert-content {
    flex: 1;
}

.auth-alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.auth-alert-message {
    opacity: 0.9;
}

.auth-alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    color: inherit;
}

.auth-alert-close:hover {
    opacity: 1;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.auth-footer {
    margin-top: 2.5rem;
    text-align: center;
}

.auth-footer-text {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.375rem;
}

.auth-footer-sysnav {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

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

.auth-footer-sysnav .sysnav-link:hover {
    color: var(--color-primary-700);
    text-decoration: underline;
}

/* ============================================================================
   DIVIDER
   ============================================================================ */

.auth-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-border), transparent);
    margin: 2rem 0;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

/* Tablet & Below - Hide Left Panel */
@media (max-width: 1024px) {
    .auth-left-panel {
        display: none;
    }
    
    .auth-right-panel {
        width: 100%;
        padding: 3rem;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .auth-right-panel {
        padding: 1.5rem;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
    }
    
    .auth-form-container {
        width: 100%;
        max-width: 100%;
    }
    
    .auth-form-title {
        font-size: 1.5rem;
    }
    
    .auth-form-header {
        text-align: center;
    }
    
    .auth-logo {
        justify-content: center;
    }
    
    .auth-form-input {
        font-size: 1rem;
        padding: 0.875rem 1rem;
    }
    
    .auth-submit-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .auth-footer {
        text-align: center;
    }
}

/* Small phones */
@media (max-width: 400px) {
    .auth-right-panel {
        padding: 1.5rem 1rem;
    }
    
    .auth-form-title {
        font-size: 1.375rem;
    }
    
    .auth-form-subtitle {
        font-size: 0.8125rem;
    }
    
    .auth-form-group {
        margin-bottom: 1.25rem;
    }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.text-primary {
    color: var(--color-primary-600);
}

.text-secondary {
    color: var(--color-text-secondary);
}

.text-danger {
    color: var(--color-danger-600);
}

.font-semibold {
    font-weight: 600;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}
