/* login.css - Premium Styles for Admin Login */

:root {
    /* Color Palette */
    --primary-color: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    
    /* Backgrounds */
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --card-bg: rgba(255, 255, 255, 0.85);
    
    /* Text Colors */
    --text-main: #1e293b;
    --text-muted: #64748b;
    
    /* Input Colors */
    --input-bg: #f8fafc;
    --input-border: #cbd5e1;
    --input-focus-border: #6366f1;
    --input-focus-ring: rgba(99, 102, 241, 0.2);
    
    /* Structure */
    --border-color: rgba(255, 255, 255, 0.4);
    --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 20px 40px rgba(0, 0, 0, 0.1);
}

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

body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
}

.login-box {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.login-header {
    background: transparent;
    color: var(--text-main);
    text-align: center;
    padding: 2.5rem 2rem 1rem;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    position: relative;
}

.login-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.login-body {
    padding: 2rem;
}

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

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.login-body input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 2px solid var(--input-border);
    border-radius: 0.75rem;
    background-color: var(--input-bg);
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.login-body input:focus {
    outline: none;
    border-color: var(--input-focus-border);
    background-color: #fff;
    box-shadow: 0 0 0 4px var(--input-focus-ring);
}

.login-body input:focus + .input-icon,
.login-body input:not(:placeholder-shown) + .input-icon {
    color: var(--primary-color);
}

/* Fix ordering in HTML so sibling selector works: icon needs to be after input if we want to style it based on input focus, OR put input inside a wrapper */
.input-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}
.input-wrapper .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: color 0.3s ease;
    pointer-events: none;
}
.input-wrapper input {
    padding-left: 2.75rem;
}
.input-wrapper input:focus ~ .input-icon {
    color: var(--primary-color);
}


.btn-login {
    background: var(--primary-color);
    color: white;
    width: 100%;
    padding: 0.875rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-login:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

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

.error-msg {
    background-color: #fef2f2;
    color: #e11d48;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid #fecdd3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    animation: shake 0.5s ease-in-out;
}

.back-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.back-link a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-link a:hover {
    color: var(--primary-color);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
