body {
  font-family: sans-serif;
  margin: 20px;
  background-color: #f4f4f4;
  color: #333;
}

.container {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  margin: auto;
}
.container.wide {
  max-width: 80rem;
}

h1 {
  color: #333;
  text-align: center;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

button,
input[type="submit"] {
  color: white;
  background: #333333;
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  width: 100%;
}
.float-right {
  float: right;
}
button.float-right {
  width: auto;
  margin: 1rem 0 1rem 1rem;
}

/* Button specific colors */
.btn-safe {
  background-color: #007bff; /* Blue for login */
}
.btn-safe:hover {
  background-color: #0056b3; /* Darker blue on hover */
}

.btn-danger {
  background-color: #dc3545; /* Red for logout */
}
.btn-danger:hover {
  background-color: #c82333; /* Darker red on hover */
}

.btn-save {
  background-color: #28a745; /* Green for register */
}
.btn-save:hover {
  background-color: #218838; /* Darker green on hover */
}

.result-area {
  /* Class for #login-result, #logout-result, #register, #email-exists, #pw-checklist */
  margin-top: 20px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #e9ecef;
}

.result-area:empty {
  display: none;
}

.result-positive {
  color: #064e3b;
}
.result-negative {
  color: #7f1d1d;
}

/* Specific result areas that don't need margin-top if they are not the primary result */
#email-exists,
#pw-checklist {
  margin-top: 5px; /* Reduced margin for these specific areas */
}

.htmx-indicator {
  display: none;
  margin-left: 10px;
  font-style: italic;
}

.htmx-indicator.htmx-request,
.htmx-request .htmx-indicator {
  display: inline-block;
}

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

#pw-checklist ul {
  list-style-type: none;
  padding-left: 0;
  margin-top: 5px;
}

#pw-checklist li {
  margin-bottom: 3px;
}

.centered-link {
  margin-top: 20px;
  text-align: center;
}

.centered-link-secondary {
  margin-top: 10px;
  text-align: center;
}

/* Input field full width fix for logout page */
#sessionToken {
  width: 100%; /* Ensures it takes full width like other inputs */
}

/* Styles for password_test.html specific elements if any, or general utility */
.password-strength-meter {
  /* Example style, adjust as needed */
  height: 10px;
  background-color: #ddd;
  border-radius: 5px;
  margin-top: 5px;
}

.strength-bar {
  height: 100%;
  background-color: red; /* Default, will be changed by JS */
  border-radius: 5px;
  width: 0%; /* Initial width */
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}
th,
td {
  padding: 10px;
  border: 1px solid #ccc;
  text-align: left;
}
th {
  background-color: #f2f2f2;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.grid-item {
  display: flex;
  flex-direction: column;
}
/* Pushes a button to the bottom if it's the last child of a grid-item */
.grid-item > button:last-child {
  margin-top: auto;
}
/* $ Grid layout for header
 * This floats all elements to the right,
 * except the first element which is left aligned and takes all remaining space.
*/
.grid-container.grid-header {
  grid-template-columns: 1fr auto auto; /* First column takes remaining space */
  align-items: center;
  margin: 5rem 0 1rem;
}
.grid-header > * {
  margin: 0; /* Reset margin for grid items */
}
.grid-header > :first-child {
  text-align: left; /* Left align the first item */
}
.grid-header > :not(:first-child) {
  text-align: right; /* Right align all other items */
}
.grid-header > button {
  margin-left: 1rem; /* Add space between buttons */
}
.grid-header h2 {
  margin: 0; /* Reset margin for h2 in header */
}
