/* Basic styling for the form container (No Change) */
#chpass {
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 15px;
    font-family: Arial, sans-serif;
    margin-left: 50px;
    font-size: .95em;
}

/* Styles for the fieldset and legend (No Change) */
#chpass fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

#chpass legend {
    font-size: .9em;
    font-weight: bold;
    margin-bottom: 15px;
}

/* ---------------------------------------------------- */
/* FIXED: VERTICAL STACKING FOR INPUTS AND ERRORS */
/* ---------------------------------------------------- */

/* 1. Container for Input + Error Message (Ensures block flow) */
.input-group {
    /* Use display: block to force items to stack vertically */
    display: block; 
    margin-bottom: 20px; /* Increased space for visual separation */
    width: 100%;
}

/* 2. Style Labels */
.input-group label {
    display: block; /* Ensures the label is on its own line */
    font-weight: bold;
    margin-bottom: 5px; /* Space between label and input */
    text-align: left; /* Aligns label text to the left */
    width: auto; /* Allow width to be determined by content */
}

/* 3. Style Input Fields */
#chpass input[type="email"],
#chpass input[type="password"] {
    display: block; /* Forces input to take up the full width */
    width: 100%; /* Makes the input stretch across the available space */
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-sizing: border-box; /* Crucial for keeping width predictable */
    margin-bottom: 0; /* Clear space before the error message */
    color: lightgray;
    background-color: rgb(64,64,64);
}
#chpass input[type="email"]:-webkit-autofill,
#chpass input[type="password"]:-webkit-autofill {
    -webkit-box-shadow: 0 0 0px 1000px rgb(64,64,64) inset; /* match your bg */
    -webkit-text-fill-color: lightgray; /* match your text */
    transition: background-color 5000s ease-in-out 0s; /* prevents flash */
}

/* 4. Style the Error Message Element */
.error-message {
    display: block; /* Ensures the error message is on its own line, below the input */
    color: #d9534f;
    font-size: 0.85em;
    padding-top: 5px; /* Space between input field and error message */
    padding-left: 0; /* Remove left padding from the horizontal layout */
    width: 100%; /* Ensures it aligns with the input */
}

/* ---------------------------------------------------- */
/* Submit Button (No Change) */
/* ---------------------------------------------------- */
#subnewpass {
    display: block; 
    width: 100%;
    padding: 10px;
    margin-top: 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 1em;
}

#subnewpass:hover {
    background-color: #0056b3;
}