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

/* Import Google Fonts for better typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

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

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(37, 99, 235, 0.3); }
    50% { box-shadow: 0 0 10px rgba(37, 99, 235, 0.5); }
}

@keyframes logoGlow {
    0%, 100% { filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.15)); }
    50% { filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.25)); }
}

@keyframes cardGlow {
    0%, 100% { 
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
    50% { 
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 
                    0 0 10px rgba(37, 99, 235, 0.05),
                    inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-page);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
    padding: 16px;
    animation: slideInUp 0.6s ease;
}

.login-card {
    background: linear-gradient(145deg, #f8fafb, #f0f4f8);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    padding: 40px 36px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: scaleIn 0.6s ease, cardGlow 4s ease-in-out infinite;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.15));
    animation: logoGlow 3s ease-in-out infinite, bounce 2s ease-in-out infinite;
}

.login-header h1 {
    font-size: 1.6rem;
    color: var(--primary-blue);
    font-weight: 700;
    letter-spacing: -0.5px;
    animation: slideInDown 0.5s ease;
}

.login-subtitle {
    color: var(--text-lighter);
    font-size: 0.9rem;
    margin-top: 4px;
    font-weight: 400;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-label);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.form-group input {
    width: 100%;
    padding: 11px 14px;
    background: linear-gradient(145deg, #fafbfd, #f5f8fb);
    border: 1px solid rgba(203, 219, 235, 0.5);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02), inset 0 1px 2px rgba(255, 255, 255, 0.5);
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: rgba(76, 124, 179, 0.4);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.02), inset 0 1px 2px rgba(255, 255, 255, 0.5), 0 0 0 4px rgba(76, 124, 179, 0.1);
    background: #fafcfd;
}

.error-msg {
    color: #d97c5e;
    font-size: 0.85rem;
    margin-bottom: 12px;
    min-height: 20px;
    font-weight: 500;
}

button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: linear-gradient(145deg, var(--gradient-from), var(--gradient-to));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(var(--primary-blue-rgb), 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(var(--primary-blue-rgb), 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(var(--primary-blue-rgb), 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

button[type="submit"]:disabled {
    background: linear-gradient(145deg, #b5c7d9, #a8bdd1);
    cursor: not-allowed;
    transform: none;
}

/* ---- Mobile responsiveness ---- */
@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px;
        border-radius: 18px;
    }
    .login-header {
        margin-bottom: 24px;
    }
    .login-logo {
        width: 52px;
        height: 52px;
    }
    .login-header h1 {
        font-size: 1.3rem;
    }
    .login-subtitle {
        font-size: 0.82rem;
    }
    .form-group input {
        padding: 12px 14px;
        font-size: 16px; /* prevents iOS zoom */
    }
    button[type="submit"] {
        padding: 14px;
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    .login-wrapper {
        padding: 10px;
    }
    .login-card {
        padding: 22px 16px;
        border-radius: 14px;
    }
    .login-header h1 {
        font-size: 1.15rem;
    }
}
