/* -----------------------
  \static\css\forms.css
----------------------- */

/* === Core Containers === */
form.verified-form,
.form-request-box {
  max-width: 1200px;
  margin: 2em auto;
  padding: 2em 3em;
  background-color: #fafafa;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: Arial, sans-serif;
  font-size: 1em;
  color: #333;
  box-sizing: border-box;
}

/* Center content for submission page */
.submission-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

/* === Headings === */
form.verified-form h1,
.form-container > h1 {
  text-align: center;
  font-size: 1.6em;
  margin-bottom: 0.75em;
}

form.verified-form h2 {
  margin-top: 1.5em;
  font-size: 1.2em;
  color: #333;
  border-bottom: 2px solid #ccc;
  padding-bottom: 0.25em;
}

/* === Paragraphs & Labels === */
form.verified-form p {
  line-height: 1.4;
  margin-bottom: 1em;
}

label {
  font-weight: bold;
  display: block;
  margin-top: 0.5em;
}

/* Short inline input */
label > input.short-input,
label > input.name,
label > input[type="tel"],
label > input[type="email"],
label > input[type="date"],
label > input[type="password"] {
  display: inline-block;
  width: 100%;
  max-width: 20em;
  margin-left: 1em; /* horizontal gap from label text */
}

/* === Star indicators for required fields === */
fieldset:not(.all-required) label:has(input[required]):not(:has(input[type="radio"]))::before,
fieldset:not(.all-required) label:has(textarea[required])::before,
fieldset:not(.all-required) label:has(select[required])::before {
  content: "* ";
  color: red;
}

fieldset:has(input[type="radio"][required]) > legend::after,
fieldset.all-required legend::after {
  content: " *";
  color: red;
}

/* === Input Elements === */
input, select, textarea {
  height: auto;
  display: block;
  width: 100%;
  margin: 0.25em 0 0.5em 0;
  padding: 0.25em 0.5em;
  box-sizing: border-box;
  vertical-align: middle;
}

#leaderList {
  list-style-type: none;
  padding-left: 0;
  margin-left: 0;
}

/* === Focus highlight === */
input:focus,
select:focus,
textarea:focus {
  border-color: #007acc;
  outline: none;
  box-shadow: 0 0 3px rgba(0, 122, 204, 0.4);
}

/* === Textarea === */
textarea {
  min-height: 4em;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* === Default buttons === */
button[type="button"],
button[type="submit"] {
  display: block;
  width: auto;
  margin: 2em 2em 1em 1em; /* top right bottom left */
  padding: 0.75em 1em;
  font-size: 1em;
  font-weight: bold;
  color: #fff;
  background-color: #007acc;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  vertical-align: middle;
}

/* Preserve smaller editButton style while aligning vertically */
button.editButton {
  display: inline-block;
  margin: 0;
  padding: 0 0.5em;
  font-size: 0.9em;
  font-weight: normal;
}

button[type="button"]:hover ,
button[type="submit"]:hover  {
  background-color: #005fa3;
}
/* === Inline-fit Buttons === */
form.verified-form button.inline-fit {
  display: inline-block;
  box-sizing: border-box;
}

/* === Fieldsets: radios and checkboxes === */
fieldset {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 1em;
  margin-top: 1.5em;
  background-color: #fff;
  display: block;
}

legend {
  font-weight: bold;
  font-size: 1em;
  margin-bottom: 0.5em;
}

input[type="radio"],
input[type="checkbox"] {
  margin: 0;
  vertical-align: middle;
}

input[type="radio"] {
  width: auto;
}

label:has(input[type="radio"]),
label:has(input[type="checkbox"]) {
  align-items: center;
  gap: 1em;
  font-weight: normal;
  margin-bottom: 0.25em;
  display: flex; 
}

label:has(input[type="radio"]) {
  display: inline-flex;
  margin-right: 2em;
  width: auto;
}

label:has(input[type="checkbox"]) input[type="checkbox"] {
  display: inline-block;
  width: auto;
}

/* === Record list display === */
#recordList label {
  display: flex;
  align-items: center;
  gap: 0.5em; /* spacing between checkbox and text */
  font-weight: normal;
}

#recordList input[type="checkbox"] {
  width: auto;
  margin: 0;
  vertical-align: middle;
}

/* === Misc === */
hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px solid #ccc;
}

input.autofill-today {
  background-color: #f9f9ff;
}

/* Disabled state */
form.verified-form input:disabled,
form.verified-form textarea:disabled,
form.verified-form select:disabled,
form.verified-form button:disabled {
  background-color: #f0f0f0;
  color: #777;
  cursor: not-allowed;
}

/* === Print === */
@media print {
  body {
    margin: 2cm;
    font-size: 12pt;
  }
  form, input, textarea, select, fieldset {
    width: 100% !important;
    box-sizing: border-box;
  }
  button {
    display: none;
  }
  fieldset, textarea {
    page-break-inside: avoid;
  }
}
