/* Import a clean, modern font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

/* Define our color palette using CSS variables */
:root {
    --primary-color: #4f46e5;
    /* Modern Indigo */
    --primary-hover: #4338ca;
    --bg-color: #f3f4f6;
    /* Light Gray Background */
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --error-color: #ef4444;
    --success-color: #10b981;
}

/* Reset default margins */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

/* Center the login page vertically and horizontally */
body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Performance-friendly fade-in animation using opacity and transform */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Form & Card Styling --- */
.login-container,
.form-card {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 400px;
    /* Smooth hardware-accelerated entry animation */
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
}

h2 {
    margin-bottom: 1.5rem;
    color: var(--text-main);
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    /* Optimize transition by only animating specific properties */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    /* Soft glow effect */
}

button {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    /* Optimize transition for smooth hover without lag */
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    margin-top: 0.5rem;
    will-change: transform;
}

button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

button:active {
    transform: translateY(0);
    box-shadow: none;
}

.error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 1rem;
    text-align: center;
}
/* ==========================================
   PASSWORD TOGGLE & LOGIN BUTTONS
========================================== */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    padding-right: 45px; /* Make room for the eye icon */
}

.toggle-password-btn {
    position: absolute;
    right: 10px;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: var(--text-muted) !important;
    box-shadow: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.toggle-password-btn:hover {
    color: var(--primary) !important;
    background: transparent !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Fix for the faint "Back to Login" button */
.back-btn {
    background-color: #f1f5f9 !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-light) !important;
    box-shadow: none !important;
    margin-top: 1rem;
    width: 100%;
}

.back-btn:hover {
    background-color: #e2e8f0 !important;
}
