/* ==========================================================================
   Vehicle Management System - Login Page Styles
   Professional Blue Theme
   ========================================================================== */

/* CSS Variables (matching main theme) */
:root {
    --color-primary-700: #1e3a5f;
    --color-primary-600: #1e4976;
    --color-primary-500: #2563eb;
    --color-primary-400: #3b82f6;
    --color-primary-300: #60a5fa;
    --color-primary-200: #93c5fd;
    --color-primary-100: #dbeafe;
    --color-primary-50: #eff6ff;
    
    --color-neutral-800: #1f2937;
    --color-neutral-700: #374151;
    --color-neutral-600: #4b5563;
    --color-neutral-500: #6b7280;
    --color-neutral-400: #9ca3af;
    --color-neutral-300: #d1d5db;
    --color-neutral-200: #e5e7eb;
    --color-neutral-100: #f3f4f6;
    --color-neutral-50: #f9fafb;
    --color-white: #ffffff;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--color-primary-700) 0%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 1rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow: hidden;
}

/* Background Pattern */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(37, 99, 235, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Floating Elements Animation */
body::after {
    content: '';
    position: absolute;
    top: 10%;
    right: 10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

/* Main Container */
.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

.login-container {
    width: 100%;
}

/* Logo/Brand Section */
.brand-section {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-logo {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.brand-logo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.brand-title {
    color: var(--color-white);
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    letter-spacing: -0.025em;
}

.brand-subtitle {
    color: var(--color-primary-200);
    font-size: 1rem;
    font-weight: 400;
    margin: 0;
}

/* Card */
.card {
    background: var(--color-white);
    border: none;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl), 0 0 40px rgba(37, 99, 235, 0.1);
    overflow: hidden;
}

.card-body {
    padding: 2.5rem;
}

.card-title {
    color: var(--color-neutral-800);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.card-subtitle {
    color: var(--color-neutral-500);
    font-size: 0.9375rem;
    text-align: center;
    margin-bottom: 2rem;
}

/* Alert */
.alert {
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert i {
    font-size: 1.125rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--color-neutral-700);
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

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

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-neutral-400);
    font-size: 1.125rem;
    pointer-events: none;
    transition: color var(--transition-base);
    z-index: 10;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    font-size: 1rem;
    color: var(--color-neutral-800);
    background: var(--color-neutral-50);
    border: 2px solid var(--color-neutral-200);
    border-radius: var(--radius-lg);
    transition: var(--transition-base);
}

.form-control:hover {
    border-color: var(--color-neutral-300);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary-400);
    background: var(--color-white);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Ensure icon stays visible and changes color on focus */
.input-group:focus-within .input-icon {
    color: var(--color-primary-500);
    z-index: 10;
}

.form-control:focus + .input-icon,
.form-control:focus ~ .input-icon {
    color: var(--color-primary-500);
    z-index: 10;
}

.form-control::placeholder {
    color: var(--color-neutral-400);
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-neutral-400);
    cursor: pointer;
    padding: 0;
    font-size: 1.125rem;
    transition: color var(--transition-base);
}

.password-toggle:hover {
    color: var(--color-neutral-600);
}

/* Submit Button */
.btn-login {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-white);
    background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-600) 100%);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-base);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    margin-top: 0.5rem;
}

.btn-login:hover {
    background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-700) 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
    transform: translateY(-2px);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

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

/* Loading State */
.btn-login.loading {
    position: relative;
    color: transparent;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--color-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Footer Link */
.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-neutral-200);
}

.login-footer a {
    color: var(--color-primary-500);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-base);
}

.login-footer a:hover {
    color: var(--color-primary-600);
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .brand-logo {
        width: 64px;
        height: 64px;
    }

    .brand-logo-img {
        width: 64px;
        height: 64px;
    }
    
    .brand-title {
        font-size: 1.5rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-container {
    animation: fadeInUp 0.5s ease-out;
}

.brand-section {
    animation: fadeInUp 0.5s ease-out 0.1s backwards;
}

.card {
    animation: fadeInUp 0.5s ease-out 0.2s backwards;
}
