/* Reset styles */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Base notification styling */
.notification {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 0.95em;
    font-weight: 500;
    width: 100%;
    box-sizing: border-box;
    /* Ensure notification is above login wrapper if both are present in the same flow */
    z-index: 10;
    position: relative;
}

/* Danger notification (for errors) */
.notification.is-danger {
    background-color: #ffebee; /* Light red */
    color: #b71c1c; /* Darker red text */
}

/* Success notification */
.notification.is-success {
    background-color: #e8f5e9; /* Light green */
    color: #2e7d32; /* Darker green text */
}

/* Styling for error lists within notifications */
.notification ul.errors {
    list-style: none;
    margin: 0;
    padding: 0;
}

.notification ul.errors li {
    margin-bottom: 5px;
}

/* Wrapper to center login form and its notifications */
/* This element will now house both notifications and the login box */
.login-wrapper {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center items like notifications and login box */
}

/* Login box styling */
.login-box {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1), 0 6px 20px rgba(0, 0, 0, 0.05); /* Added second shadow for depth */
    width: 100%;
    box-sizing: border-box;
    min-width: 280px; /* Prevents the box from becoming extremely narrow */
}

/* Input field groups */
.field {
    margin-bottom: 20px;
}

.label {
    font-size: 0.9em;
    color: #616161;
    margin-bottom: 5px;
    display: block;
    font-weight: 500;
}

.input {
    width: 100%;
    padding: 10px;
    border: 1px solid #bdbdbd;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out; /* Added transition for focus effect */
}

.input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.input[required]:focus:invalid {
    border-color: #f44336;
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2);
}

/* Captcha image */
img[alt="Captcha"] {
    display: block;
    margin-top: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    max-width: 100%;
    height: auto;
}

/* Remember me field */
.remember-me-field {
    display: flex;
    align-items: center;
    margin-bottom: 20px; /* Added margin for consistency */
    color: #424242;
    font-size: 0.95em;
}

.remember-me-field input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #757575;
    border-radius: 2px;
    margin-right: 10px;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s, border-color 0.2s;
}

.remember-me-field input[type="checkbox"]:checked {
    background-color: #2196F3;
    border-color: #2196F3;
}

.remember-me-field input[type="checkbox"]:checked::after {
    content: '\2713';
    color: #ffffff;
    font-size: 14px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.remember-me-field label {
    margin: 0;
    cursor: pointer;
}

/* Primary button */
.button.is-primary {
    background-color: #2196F3;
    color: #ffffff;
    padding: 12px 25px;
    border: none;
    border-radius: 4px;
    font-size: 1.1em;
    font-weight: 500;
    text-transform: uppercase;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.1s ease;
}

.button.is-primary:hover {
    background-color: #1976D2;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}

.button.is-primary:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.form-actions {
    margin-top: 30px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        padding: 15px; /* Adjust padding for smaller screens */
    }

    .login-wrapper {
        padding: 0; /* Remove wrapper padding on smaller screens */
        max-width: 100%; /* Allow wrapper to take full width */
        margin-top: 20px; /* Add some top margin to align with body padding */
        margin-bottom: 20px;
    }

    .notification {
        border-radius: 0; /* Notifications can stretch full width without rounded corners */
        box-shadow: none; /* Make notifications flat on small screens */
    }

    .login-box {
        padding: 25px;
        border-radius: 0;
        box-shadow: none;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .login-box {
        padding: 20px;
    }

    .input {
        font-size: 0.95em;
        padding: 8px 10px;
    }

    .button.is-primary {
        padding: 10px 20px;
        font-size: 1em;
    }
}