/*
    ═══════════════════════════════════════════════════════════════
    Admin Login Page - Enhanced Stylesheet
    ═══════════════════════════════════════════════════════════════
    
    Professional, Modern Design
    WCAG 2.2 AAA Compliant
    Matches Evolve AI Institute Design System
    
    @version 3.0.0
*/

/* ═══ CSS CUSTOM PROPERTIES ═══ */
:root {
    /* Brand Colors - Matching Main Site */
    --brand-primary: #2563eb;
    --brand-primary-dark: #1d4ed8;
    --brand-primary-light: #60a5fa;
    --brand-secondary: #0891b2;
    --brand-accent: #f59e0b;
    
    /* Semantic Colors - WCAG AAA */
    --brand-success: #16a34a;
    --brand-danger: #dc2626;
    
    /* Neutral Colors */
    --gray-50: #f8f9fa;
    --gray-100: #e9ecef;
    --gray-200: #dee2e6;
    --gray-300: #ced4da;
    --gray-400: #adb5bd;
    --gray-500: #6c757d;
    --gray-600: #495057;
    --gray-700: #343a40;
    --gray-800: #212529;
    --gray-900: #0d0f12;
    
    /* Typography */
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* 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);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══ GLOBAL STYLES ═══ */
body {
    font-family: var(--font-family-base);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--gray-800);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══ SKIP LINK ═══ */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--brand-primary);
    color: white;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 0.375rem 0;
    z-index: 1070;
    transition: top var(--transition-base);
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--gray-900);
    outline-offset: 3px;
}

/* ═══ ADMIN HEADER ═══ */
.admin-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 50%, #0891b2 100%);
    color: white;
    box-shadow: var(--shadow-md);
    position: relative;
}

.admin-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.08)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.admin-header .container {
    position: relative;
    z-index: 1;
}

.admin-header i {
    color: white;
}

.admin-header span {
    color: white;
}

.admin-header .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transition: all var(--transition-fast);
}

.admin-header .btn-outline-light:hover {
    background-color: white;
    color: var(--brand-primary-dark);
    border-color: white;
}

/* ═══ LOGIN SECTION ═══ */
.login-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.login-icon-wrapper i {
    font-size: 2.5rem;
    color: white;
}

/* ═══ LOGIN CARD ═══ */
.login-card {
    border-radius: 1rem;
    overflow: hidden;
    transition: all var(--transition-base);
}

.login-card:hover {
    transform: translateY(-2px);
}

.login-card .card-body {
    background-color: white;
}

/* ═══ FORM ELEMENTS ═══ */
.form-label {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-control,
.form-select {
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    padding: 0.625rem 0.875rem;
    transition: all var(--transition-fast);
    font-size: 0.9375rem;
    background-color: white;
}

.form-control:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.15);
    outline: none;
}

.form-control::placeholder {
    color: var(--gray-400);
    opacity: 0.7;
}

.input-group-text {
    border: 1px solid var(--gray-300);
    transition: all var(--transition-fast);
}

.input-group:focus-within .input-group-text {
    border-color: var(--brand-primary);
}

.form-text {
    color: var(--gray-600);
    font-size: 0.8125rem;
    margin-top: 0.375rem;
}

/* ═══ BUTTONS ═══ */
.btn {
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    transition: all var(--transition-fast);
    border-width: 2px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    border-color: var(--brand-primary);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-primary-dark) 0%, var(--brand-primary) 100%);
    border-color: var(--brand-primary-dark);
    color: white;
}

.btn-primary:focus-visible {
    outline: 3px solid var(--brand-primary);
    outline-offset: 3px;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* ═══ ALERTS ═══ */
.alert {
    border-radius: 0.5rem;
    border: 1px solid transparent;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.alert-danger {
    background-color: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.2);
    color: #580c0c;
}

.alert-danger .alert-heading {
    color: #580c0c;
}

.alert-success {
    background-color: rgba(22, 163, 74, 0.1);
    border-color: rgba(22, 163, 74, 0.2);
    color: #064e21;
}

.alert i {
    flex-shrink: 0;
}

.alert ul {
    margin-bottom: 0;
}

.alert-dismissible .btn-close {
    padding: 0.75rem;
}

/* ═══ ADMIN FOOTER ═══ */
.admin-footer {
    background-color: white;
    border-top: 1px solid var(--gray-200);
    margin-top: auto;
}

.admin-footer p {
    margin-bottom: 0;
}

/* ═══ ACCESSIBILITY ═══ */
*:focus-visible {
    outline: 3px solid var(--brand-primary);
    outline-offset: 3px;
    border-radius: 0.25rem;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--brand-primary);
    outline-offset: 3px;
}

/* ═══ RESPONSIVE DESIGN ═══ */
@media (max-width: 767.98px) {
    .login-icon-wrapper {
        width: 60px;
        height: 60px;
    }
    
    .login-icon-wrapper i {
        font-size: 2rem;
    }
    
    .login-card {
        box-shadow: var(--shadow-md);
    }
    
    .admin-footer .row > div {
        text-align: center !important;
        margin-bottom: 0.5rem;
    }
    
    .admin-footer .row > div:last-child {
        margin-bottom: 0;
    }
}

@media (min-width: 768px) {
    .login-card {
        transform: scale(1);
        transition: transform var(--transition-base), box-shadow var(--transition-base);
    }
    
    .login-card:hover {
        transform: scale(1.01);
        box-shadow: var(--shadow-xl);
    }
}

/* ═══ LOADING STATES ═══ */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    left: 50%;
    margin-left: -0.5rem;
    margin-top: -0.5rem;
    border: 2px solid transparent;
    border-radius: 50%;
    border-top-color: currentColor;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { 
        transform: rotate(360deg); 
    }
}

/* ═══ ANIMATIONS ═══ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card,
.login-icon-wrapper {
    animation: fadeIn 0.3s ease-out;
}

/* ═══ REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .login-card,
    .login-icon-wrapper {
        animation: none;
    }
}

/* ═══ PRINT STYLES ═══ */
@media print {
    body {
        background: white;
    }
    
    .admin-header,
    .admin-footer,
    .btn,
    .alert {
        display: none !important;
    }
    
    .login-card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}
