/* =======================
   General Reset
   ======================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =======================
   Login Container
   ======================= */
.login-container {
    width: 100%;
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background: #f8f8f8;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* =======================
   Form Fields
   ======================= */
.form-field {
    position: relative;
    margin-bottom: 15px;
    /* spacing between fields */
}

/* =======================
   Password Toggle (Adjusted for better alignment and styling)
   ======================= */
.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 2.75rem;
    /* space for toggle */
    padding-left: 0.75rem;
    height: 2.5rem;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
}

.password-toggle:hover {
    opacity: 0.8;
}

/* =======================
   Error Messages
   ======================= */
.error-message {
    color: #d9534f;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* =======================
   Submit Button
   ======================= */
.login-btn {
    width: 100%;
    height: 2.5rem;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

.login-btn:hover {
    background: #0069d9;
}

/* =======================
   Input Adjustments
   ======================= */
input[type="email"],
input[type="password"],
button {
    width: 100%;
    box-sizing: border-box;
}

/* =======================
   Ensure Consistent Layout
   ======================= */
.password-wrapper {
    position: relative;
}

.password-wrapper input[type="password"] {
    padding-right: 30px;
    /* Adjust based on toggle button size */
}

.password-wrapper .toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

/* =======================
   Adjust Vertical Spacing Between Inputs
   ======================= */
input[type="email"],
input[type="password"] {
    margin-bottom: 10px;
    /* Adjust spacing as needed */
}

/* =======================
   Important Overrides (Ensure consistency in elements)
   ======================= */
.password-input-wrapper {
    position: relative !important;
    width: 100% !important;
}

.password-input-wrapper input {
    padding-right: 2.75rem !important;
}

.password-toggle {
    position: absolute !important;
    top: 50% !important;
    right: 0.75rem !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    padding: 0 !important;
}

.login-container input[type="email"],
.login-container input[type="password"],
.login-container button {
    width: 100%;
}

/* =======================
   Final Adjustments for Layout Consistency
   ======================= */
.password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #ffffff;
    opacity: 0.8;
    z-index: 2;
}

.password-toggle:hover {
    opacity: 1;
}

/* Adjust password input */
.login-form input[type="password"] {
    width: 100%;
    /* Makes the password input the same width as the other inputs */
    padding: 10px;
    /* Adjust the padding for uniformity */
    margin-bottom: 15px;
    /* Uniform spacing between fields */
    position: relative;
    /* Ensure the toggle button can be absolutely positioned inside it */
}

/* Adjust toggle button position */
.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    pointer-events: none;
    /* Ensure the toggle button doesn't block clicks */
}

/* Hide the toggle button */
.password-toggle {
    display: none;
}

/* Remove spacing under username/email field on login page */
#id_username {
    margin-bottom: 0 !important;
}