:root {
    --primary-color: #4CAF50;
    /* A pleasant green */
    --accent-color: #388E3C;
    --card-background: #ffffff;
    --text-color: #333333;
    --input-border: #e0e0e0;
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --error-color: #dc3545;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(to right, #B3B9C6, #7E92B3, #4A73B4);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    color: var(--text-color);
    padding: 20px;
    box-sizing: border-box;
}

.login-container {
    background-color: var(--card-background);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow-medium);
    width: 100%;
    max-width: 450px;
    transition: all 0.3s ease-in-out;
}

.login-container:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-color);
    font-size: 2rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

/* Style for the Django form inputs */
input {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 50px;
    /* Pill-shaped button */
    background-color: var(--primary-color);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s;
    margin-top: 1rem;
}

.btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.errorlist {
    list-style-type: none;
    padding: 0;
    margin-top: -1rem;
    margin-bottom: 1rem;
    color: var(--error-color);
    font-size: 0.9rem;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 10px;
}

.errorlist li {
    margin: 0;
    padding: 0;
}

a.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    color: #414850;
    /* A subtle, cool gray */
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.3s, transform 0.2s;
    font-weight: 600;
}

a.back-link:hover {
    color: #343a40;
    transform: translateX(-5px);
}



/* ---------------- Responsive ---------------- */
@media (max-width: 768px) {
    .login-container {
        padding: 2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    input {
        padding: 0.9rem;
        font-size: 0.95rem;
    }

    .btn {
        padding: 0.9rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 1.5rem;
        max-width: 100%;
    }

    h2 {
        font-size: 1.5rem;
    }

    input {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.8rem;
        font-size: 0.95rem;
    }

    .errorlist {
        font-size: 0.8rem;
        padding: 8px;
    }
}