/* ===== STYLING FOR PHP DATABASE =====    */

/* Database status indicator */
.db-status {
  padding: 10px;
  margin: 10px 0;
  border-radius: 4px;
  font-size: 14px;
}

.db-connected {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.db-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}
/* ===== PAGE LAYOUT (from deaths.css - WORKING) ===== */
.page-format {          /*  Outer Container   */
  align-items: center;
  width: 1500px; 
  max-width: 100%; 
  margin: 0 auto 4rem;
  padding: 1.5rem; 
  border-style: solid;
  border-width: 6px;
  border-radius: 20px;
  border-color: brown;
  background-color: #f4dfd2;
  box-sizing: border-box; 
  font-family: "Birthstone";
  font-size: 16px;
  font-weight: 400;
}

.page-content-forms {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 1300px; /* Default max width for medium screens */
  margin: 3rem auto 4rem auto;
  padding: 25px;
  background-color: #efe2d5;
  border: 2px ridge brown;
  border-radius: 10px;
  box-sizing: border-box;
}

/* ===== MASTHEAD (from deaths.css - WORKING) ===== */
.masthead {
  background-color: #efe2d5;
  border: 3px solid #801515;
  border-radius: 100px;
  padding: 0;
  margin: 1rem auto;
  width: 70%;
  height: 120px;
  text-align: center;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.masthead-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.masthead-line1,
.masthead-line2 {
  font-family: "Birthstone", cursive;
  color: #5a1a1a;
  text-align: center;
  display: block;
}

.masthead-line1 {
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
  font-size: 3.5rem;
  font-weight: 500;
  line-height: 1;
}

.masthead-line2 {
  margin-top: 0;
  font-size: 2rem;
  line-height: 1;
}

h2.masthead-line2.subheading {
  margin-top: -0.5rem;
  margin-bottom: 0;
  font-weight: normal;
}

/* ===== FORM LAYOUT (from deaths.css - WORKING) ===== */
/* REMOVED PROBLEMATIC FLEXBOX RULES FROM FORMS.CSS */
.form-row {
  margin-bottom: 1rem;
  font-size: 1.4rem;
  /* REMOVED: display: flex, flex-wrap, gap - these caused layout issues */
}

/* ===== FIELDSET AND LEGEND (from deaths.css - WORKING) ===== */
fieldset,
.page-content-forms fieldset,
form fieldset {
  border: 2px solid brown;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin: 1rem 0;
  background-color: rgba(255, 247, 243, 1);
  box-sizing: border-box;
}

fieldset legend,
.page-content-forms legend,
form legend {
  font-family: "Birthstone", cursive;
  font-size: 1.5rem;
  color: brown;
  font-weight: bold;
  padding: 0 0.5rem;
  margin-left: 0.5rem;
  background-color: rgba(255, 247, 243, 1);
  border: none;
}

/* Special case for radio fieldsets */
fieldset.radio-fieldset {
  width: 100%;
  padding: 1rem;
  border: 1px solid #ccc;
  background-color: #f8efe7;
  box-sizing: border-box;
}

/* Grid layout for identity fieldset */
.identity-fieldset .form-row {
  display: grid;
  grid-template-columns: 100px 350px 100px 350px;
  gap: 0.5rem 1rem;
  align-items: center;
}

/* ===== SPACING CLASSES (from deaths.css - WORKING) ===== */
.label-space-right {
  margin-right: 0.5rem;
}

.input-space-right {
  margin-right: 1rem;
}

/* ===== BUTTONS (from both files - consistent) ===== */
.button-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.add-button,
.cancel-button,
.change-button,
.delete-button,
.register-button,
.reset-button,
.submit-button {
  width: 100px;
  height: 35px;
  border: 2px solid brown;
  border-radius: 5px;
  background-color: #f8f0e3;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

.add-button:hover,
.change-button:hover,
.delete-button:hover,
.reset-button:hover {
  background-color: #e0cfc0;
}

/* ===== LABELS AND INPUTS (from forms.css - useful styles) ===== */
/* Universal label style */
label {
  font-family: "Birthstone", serif;
  font-size: 1.6rem;
  font-weight: 500;
  color: brown !important;
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* Optional: Only for underlined labels */
.label-underline {
  text-decoration: underline;
  text-decoration-color: brown !important;
  color: brown;
}

/* Form inputs - REMOVED width rules that caused problems */
.form-row input {
  padding: 4px 6px;
  border: 2px solid #8b4513;
  border-radius: 4px;
  /* REMOVED: width: 80ch - this was overriding HTML size attributes */
}

/* Specific input types - same size as all other inputs */
input[type="number"]:not(:required) {
  width: 6ch;
  padding: 6px 8px !important;
  border: 2px solid #ccc !important;
}

input[type="email"]:not(:required) {
  width: 28ch;
  padding: 6px 8px !important;
  border: 2px solid #ccc !important;
}

input[type="tel"]:not(:required) {
  width: 14ch;
  padding: 6px 8px !important;
  border: 2px solid #ccc !important;
}

textarea {
  width: 100%;
}

/* ===== STYLING FOR PASSWORD RESET           ===== */
/* Password Reset Forms Styling */

.password-reset-container {
    max-width: 500px;
    margin: 50px auto;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.password-reset-container h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.8rem;
}

.password-reset-container p {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.6;
}

.password-reset-container .form-group {
    margin-bottom: 20px;
}

.password-reset-container .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.password-reset-container .form-group input[type="email"],
.password-reset-container .form-group input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.password-reset-container .form-group input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.password-requirements {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
    padding-left: 20px;
}

.password-requirements li {
    margin: 3px 0;
}

.btn-reset-submit {
    width: 100%;
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.btn-reset-submit:hover {
    background: #45a049;
}

.btn-reset-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.reset-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: none;
}

.reset-message.show {
    display: block;
}

.reset-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.reset-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.reset-back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #007bff;
    text-decoration: none;
    font-size: 1rem;
}

.reset-back-link:hover {
    text-decoration: underline;
}

.reset-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin-reset 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes spin-reset {
    to { transform: rotate(360deg); }
}
/* ===== STYLING FOR PASSWORD RESET ENDS     ===== */

/* Alternative button style for links that look like buttons */
.btn-reset-link {
    display: inline-block;
    padding: 12px 30px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s ease;
}

.btn-reset-link:hover {
    background: #45a049;
}


/* ===== REQUIRED FIELD STYLING - LARGER SIZE ===== */
input[type="text"]:required,
input[type="password"]:required,
textarea:required,
select:required {
  border: 2px solid brown !important;
  border-radius: 4px;
  padding: 6px 8px !important;
  background-color: #fff8f8 !important;
}

input:required:focus,
select:required:focus {
  outline: none;
  box-shadow: 0 0 3px brown;
}

.page-content input:required,
.page-content select:required {
  border: 2px solid brown;
  border-radius: 4px;
  padding: 6px 8px !important;
  background-color: #fff8f8;
  font-weight: 500;
}

table input:required,
table select:required,
td input:required,
td select:required {
  border: 2px solid brown !important;
  border-radius: 4px !important;
  background-color: #fff8f8 !important;
  padding: 6px 8px !important;
}

/* ===== UTILITY CLASSES (from forms.css) ===== */
.search-instructions {
  text-decoration-line: underline;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.1;
  padding: none;
  margin: 0;
}

.forgot-password {
  margin-top: 0;
  text-align: center;
  font-size: 1rem;
}

.forgot-password a {
  color: blue;
  text-decoration: underline;
}

.forgot-password a:hover {
  text-decoration: none;
}

.about {
  font: Birthstone;
  font-size: 1.5rem;
}

.page-content img {
  width: 100%;
  height: auto;
  border: none;
}

.field-note {
  margin: 0.25rem 0 1rem 1rem;
  font-size: 0.9rem;
  color: #703e3e;
  font-style: italic;
}

.required::after {
  content: " *";
  color: black;
}

/* ===== RADIO BUTTON GRIDS (from forms.css) ===== */
.radio-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  row-gap: 0.25rem;
  column-gap: 1rem;
  text-align: center;
  font-size: 1.4rem;
}

.radio-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  row-gap: 0.25rem;
  column-gap: 1rem;
  text-align: center;
  font-size: 1.4rem;
}

.radio-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: 0.25rem;
  column-gap: 1rem;
  text-align: center;
  font-size: 1.4rem;
}

.radio-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  row-gap: 0.25rem;
  column-gap: 1rem;
  text-align: center;
  font-size: 1.4rem;
}

.radio-grid-2 > div,
.radio-grid-3 > div,
.radio-grid-4 > div,
.radio-grid-5 > div {
  margin: 0;
  padding: 0;
  line-height: 1.1;
}

.radio-grid-2 label,
.radio-grid-3 label,
.radio-grid-4 label,
.radio-grid-5 label {
  display: inline-block;
  margin: 0 0.25rem;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
}

.radio-grid-2 input[type="radio"],
.radio-grid-3 input[type="radio"],
.radio-grid-4 input[type="radio"],
.radio-grid-5 input[type="radio"] {
  margin: 0;
  padding: 0;
  vertical-align: middle;
}

/* ===== LAYOUT UTILITIES (from forms.css) ===== */
.content-block {
  display: flex;
  flex-direction: column;
  background-color: #efe2d5;
  border:  2px solid brown;
  border-radius: 8px;
  align-items: center;
  padding: 2rem;
}

.flex-layout {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.grid-layout {
  display: grid;
  margin: 0 auto;
  width: 100%;
  max-width: 1200px;
  grid-template-columns: 200px 200px 200px;
  gap: 1rem 3rem;
}

.inline-block-layout {
  display: inline-block;
  vertical-align: top;
}

/* ===== INLINE FIELD GROUPS (from forms.css) ===== */
.inline-field-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.inline-field-group label {
  margin: 0;
}

.inline-field-group input {
  width: auto;
}

/* ===== CHILD INPUT STYLING (from forms.css) ===== */
input.child-input[type="text"],
input.child-input[type="email"],
input.child-input[type="tel"],
input.child-input[type="date"],
select.child-input {
  width: 90%;
  box-sizing: border-box;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  height: 1.5rem;
}

.child-input {
  width: 90%;
  box-sizing: border-box;
}

/* Specific width adjustments for table form inputs */
td input[name^="peopleMiddleName"] {
  width: 70% !important;
}

td input[name^="peopleLastName"] {
  width: 100% !important;
}

td input[name^="peopleFirstName"] {
  width: 90% !important;
}

/* ===== TABLE STYLING (from forms.css) ===== */
table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

th,
td {
  padding-top: 0 0 1px 6px;
  text-align: center;
  vertical-align: top;
  font-family: "Birthstone", cursive;
  font-size: 1.6rem;
}

td input[type="email"],
td input[type="tel"] {
  width: 50ch;
  max-width: 100%;
  padding: 6px 8px !important;
  font-size: 1rem;
  border: 2px solid #999 !important;
  border-radius: 4px;
  background-color: #fff;
  box-sizing: border-box;
}

td input[type="email"]:required,
td input[type="tel"]:required {
  border: 2px solid brown;
  background-color: #fff8f8;
}

td input[type="email"]:focus,
td input[type="tel"]:focus {
  border-color: #3366cc;
  outline: none;
  background-color: #f0f8ff;
}

/* ===== ERROR HIGHLIGHTING for form-proposed-members.html  ===== */
.row-error {
  background-color: #ffe6e6 !important;
}

.row-error input,
.row-error select {
  border-color: #ff0000 !important;
}

.field-error {
  border-color: #ff0000 !important;
  background-color: #fff5f5;
}

.error-message {
  color: #ff0000;
  font-size: 0.9em;
  margin-top: 5px;
}

/* ===== TYPOGRAPHY (from forms.css) ===== */
h1, h2 {
  margin: 0;
  padding: 0;
  font-weight: normal;
}

h1 {
  font-family: "Birthstone", cursive;
  font-size: 3.5rem;
  text-align: center;
  color: #732020;
  margin-bottom: 1rem;
}

h2 {
  font-family: "Birthstone", cursive;
  font-size: 3rem;
  text-align: center;
  margin: 1rem 1rem 0.5rem;
  color: #732020;
}

h3 {
  font-family: "Birthstone", serif;
  font-size: 2rem;
  text-align: center;
  margin: 0 1rem 0.5rem;
  color: #732020;
}

h4 {
  font-family: "Birthstone", serif;
  font-size: 1.5rem;
  text-align: center;
  margin: 0 1rem 0.5rem;
  color: #732020;
}

ul {
  list-style: none;
  padding-left: 1rem;
}

ul li a {
  font-family: "Birthstone", serif;
  font-size: 1.5rem;
  text-decoration: none;
  color: #2a5d84;
}

ul li a:hover {
  text-decoration: underline;
  color: #0a3d5c;
}

/* ===== RESPONSIVE DESIGN (from forms.css) ===== */
@media (max-width: 700px){
  #contact-admin-form .contact-webmaster-top .form-row{
    grid-template-columns: 1fr;
  }
  #contact-admin-form .contact-webmaster-bottom .form-row > label,
  #contact-admin-form .contact-webmaster-bottom .form-row > textarea{
    margin-left: 0;
    width: 100%;
  }
}

@media screen and (max-width: 500px) {
  :root {
    --column-width: 300px;
    --gap: 0.5rem;
  }
}

/* ========================================
   Registration Form - Credential Section
   ======================================== */

.credential-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid #ddd;
}

.username-help {
  color: brown;
  display: block;
  margin-left: 10px;
}

/* Password Requirements Display */
.password-requirements {
  background-color: #f9f9f9;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 4px;
  font-size: 1.25rem;
  color: brown;
}

.password-requirements ul {
  margin: 0.5rem 0 0 1.5rem;
  padding: 0;
  font-size: 1rem;
  color: brown;
}

.password-requirements li {
  margin: 0.3rem 0;
  color: brown;
}

.requirement-met {
  color: #4CAF50;
}

.requirement-unmet {
  color: #999;
}

/* Password Match Indicator */
.password-match-indicator {
  font-size: 0.9rem;
  margin-top: 0.5rem;
  min-height: 1.2rem;
}

.match-success {
  color: #4CAF50;
}

.match-error {
  color: #d32f2f;
}

/* Result Message Styles */
#result {
  margin-top: 1rem;
}

.result-error {
  background: #ffebee;
  padding: 15px;
  border-radius: 5px;
  border: 2px solid #f44336;
}

.result-warning {
  background: #fff3cd;
  padding: 15px;
  border-radius: 5px;
  border: 2px solid #ffc107;
}

.result-info {
  background: #d1ecf1;
  padding: 15px;
  border-radius: 5px;
  border: 2px solid #17a2b8;
}

.result-loading {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 5px;
}

/* ===== LOGIN MODAL STYLES ===== */

/* Modal Overlay - Must be fixed and centered */
.login-modal-overlay {
  display: none !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(4px);
  z-index: 9999 !important;
  justify-content: center !important;
  align-items: center !important;
  animation: fadeIn 0.3s ease;
}

.login-modal-overlay.active {
  display: flex !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Modal Container */
.login-modal-container {
  background: #eea679 !important;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(80, 49, 2, 0.3);
  max-width: 250px;
  width: 60%;
  max-height: 30dvh;
 /* overflow-y: auto;
  animation: slideUp 0.3s ease; */
  position: relative;
  margin: 20px;
}

/* @keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
} */

/* Modal Header */
.login-modal-header {
  background: color #eea679;
  color: brown;
  padding: 4px 3px;
  border-radius: 12px; 
  position: relative;
}

.login-modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: brown;
}

.login-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: brown;
  font-size: 28px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
}

.login-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Modal Body */
.login-modal-body {
  padding: 10px;
  background: #f6eadd;
  border-radius: 12px;
}

.login-form-group {
  margin-bottom: 5px;
}

.login-form-group label {
  display: block;
  margin-bottom: 3px;
  color: #333;
  font-weight: 500;
  font-size: 14px;
}

.login-form-group input {
  width: 100%;
  padding: 16px 10px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s;
  box-sizing: border-box;
}

.login-form-group input:focus {
  outline: none;
  border-color: #975709;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Error/Success Messages */
.login-message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  display: none;
}

.login-message.show {
  display: block;
}

.login-message.error {
  background: #fee;
  color: #c33;
  border-left: 4px solid #c33;
}

.login-message.success {
  background: #efe;
  color: #2a2;
  border-left: 4px solid #2a2;
}

/* Submit Button */
.login-modal-submit {
  width: 100%;
  padding: 6px;
  background:#f6eadd;
  color: brown;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.login-modal-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.login-modal-submit:active {
  transform: translateY(0);
}

.login-modal-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Forgot Password Link */
.login-forgot-password {
  text-align: center;
  margin-top: 16px;
}

.login-forgot-password a {
  color: #667eea;
  text-decoration: none;
  font-size: 14px;
}

.login-forgot-password a:hover {
  text-decoration: underline;
}

/* Loading Spinner */
.login-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== AUTH BUTTONS (Login & Register) - CONSOLIDATED ===== */

/* Auth button container */
.auth-buttons {
  margin-top: 0;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* Base styling for both button and anchor elements */
button.button,
a.button {
  display: inline-block;
  padding: 5px 10px;
  font-size: 22px;
  font-weight: 600;
  color: brown;
  background-color: #f0e6d6;
  border: 2px solid brown !important;
  border-radius: 6px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 100px;
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1.5;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Hover state for both */
button.button:hover,
a.button:hover {
  background-color: brown;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
}

/* Active/pressed state */
button.button:active,
a.button:active {
  transform: translateY(0);
}

/* Focus state for accessibility */
button.button:focus,
a.button:focus {
  outline: 2px solid brown;
  outline-offset: 2px;
}

/* ===== FOOTER STYLING ===== */
footer {
  text-align: center;
}

/* ===== MENU GRID LAYOUT ===== */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8rem;
  text-align: center;
  justify-items: center;
  margin-top: 2rem;
  margin-bottom: 1rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.menu-column {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  border-style: solid;
  border-radius: 8px;
  border-color: brown;
  border-width: 2px;
  padding: 1rem;
  background-color: #fff6f0;
  width: 300px;
  min-height: 320px;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

.firstName,
.middleName,
.lastName {
  max-width: 100%;
}

.suffix {
  max-width: 5ch;
  margin: 0 auto;
  padding: 2px;
  background-color: #f4f4f4;
  border-radius: 5px;
}

.nickname {
  max-width: 100%;
  margin: 0 auto;
  border-style: ridge;
  border-color: brown;
  border-width: 1px;
  border-radius: 2px;
  padding: 20px;
  background-color: #f4f4f4;
  border-radius: 5px;
}

/* Grid containers and specialized layouts from forms.css */
.grid-container {
  display: grid;
  width: 1200px;
  height: 480px;
  margin-top: 125px;
  margin-left: 15px;
  margin-bottom: 10px;
  line-height: 95%;
  font-family: Birthstone;
  font-weight: 500;
  grid-template-rows: 68px 70px 190px 50px;
  grid-template-columns: 320px 36px 227px 55px 227px 38px 227px;
  row-gap: 10px;
  column-gap: 10px;
}

.grid-container > div {
  width: auto;
  height: auto;
  padding-top: 1px;
  padding-left: 4px;
}

/* Specialized form boxes */
.entry-offspring-box,
.entry-spouseName-box {
  width: 520px;
  height: 165px;
  margin-top: 75px;
  margin-left: auto;
  margin-right: auto;
  font-size: 18px;
  font-weight: bold;
  border-style: ridge;
  border-color: brown;
  border-width: 3px;
  border-radius: 10px;
  padding-left: 5px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.contactadmin-wrap {
  display: flex;
  justify-content: center;
  width: 90%;
  border-color: brown;
  border-width: 3px;
  border-radius: 10px;
  padding-left: 45px;
  padding-top: 10px;
  padding-bottom: 10px;
}

/* Body styling for forms that need it */
body {
  font-family: Birthstone, sans-serif;
  background-color: #f7ede2;
  margin: 0;
  padding: 2rem;
}

/* ===== PROPOSED MEMBERS FORM LAYOUT FIXES ===== */

/* Fix table layout and column spacing */
.page-content-forms table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
}

/* Optimize column widths to eliminate wasted space */
.page-content-forms table th:nth-child(1), /* # */
.page-content-forms table td:nth-child(1) {
  width: 30px;
  text-align: center;
  padding: 2px 4px;
}

.page-content-forms table th:nth-child(2), /* First */
.page-content-forms table td:nth-child(2) {
  width: 120px;
  padding: 2px 4px;
}

.page-content-forms table th:nth-child(3), /* Middle */
.page-content-forms table td:nth-child(3) {
  width: 110px;
  padding: 2px 4px;
}

.page-content-forms table th:nth-child(4), /* Last */
.page-content-forms table td:nth-child(4) {
  width: 120px;
  padding: 2px 6px;
}

.page-content-forms table th:nth-child(5), /* Suffix */
.page-content-forms table td:nth-child(5) {
  width: 60px;
  padding: 2px 6px;
}

.page-content-forms table th:nth-child(6), /* Email */
.page-content-forms table td:nth-child(6) {
  width: 200px;
  padding: 2px 8px;
}

.page-content-forms table th:nth-child(7), /* Phone */
.page-content-forms table td:nth-child(7) {
  width: 130px;
  padding: 2px 8px;
}

.page-content-forms table th:nth-child(8), /* Birthdate */
.page-content-forms table td:nth-child(8) {
  width: 140px;
  padding: 2px 8px;
}

.page-content-forms table th:nth-child(9), /* Relationship */
.page-content-forms table td:nth-child(9) {
  width: 150px;
  padding: 2px 4px;
}

/* Limit the width of state select fields */
select[name="deathState"],
select[name="deathBurialState"],
select[name="marriageState"],
select[name="peopleBirthplaceState"] {
  width: 7ch;
  min-width: 60px;
  max-width: 120px;
}

/* Fix suffix dropdown sizing */
.page-content-forms table select.suffix {
  width: 100% !important;
  box-sizing: border-box;
  padding: 4px 6px;
  font-size: 0.85rem;
  border: 1px solid #999;
  border-radius: 3px;
}

/* Fix relationship dropdown - smaller text and proper sizing */
.page-content-forms table select[name="relationshipTypeID[]"] {
  width: 100% !important;
  box-sizing: border-box;
  padding: 4px 6px;
  font-size: 0.75rem !important;
  border: 1px solid #999;
  border-radius: 3px;
  line-height: 1.2;
}

/* Make relationship dropdown options smaller too */
.page-content-forms table select[name="relationshipTypeID[]"] option {
  font-size: 0.75rem !important;
  padding: 2px;
}

/* Fix table headers */
.page-content-forms table th {
  padding: 8px 4px;
  text-align: center;
  font-family: "Birthstone", cursive;
  font-size: 1.3rem;
  font-weight: normal;
  vertical-align: middle;
  border-bottom: 2px solid brown;
}

/* Fix table cells vertical alignment */
.page-content-forms table td {
  vertical-align: middle;
  border-bottom: 1px solid #ddd;
}

/* Remove excessive margins from the form container */
.page-content-forms {
  padding: 15px;
  margin: 2rem auto 3rem auto;
}

/* Ensure table doesn't have excessive margins */
.page-content-forms table {
  margin: 1rem 0;
}

/* Fix row number styling */
.page-content-forms .row-number,
.page-content-forms table td:first-child {
  font-weight: bold;
  color: #666;
  font-size: 0.9rem;
}

/* Phone number auto-formatting support */
.page-content-forms input[type="tel"] {
  font-family: monospace;
  letter-spacing: 0.5px;
}

/* Required field styling for table inputs */
.page-content-forms table input:required,
.page-content-forms table select:required {
  border: 2px solid brown !important;
  background-color: #fff8f8 !important;
}

/* Focus styling for better UX */
.page-content-forms table input:focus,
.page-content-forms table select:focus {
  outline: none;
  border-color: #3366cc !important;
  box-shadow: 0 0 3px rgba(51, 102, 204, 0.3);
}

/* ===== REFERRER FIELDSET VERTICAL LAYOUT FIXES ===== */

/* Container for the referrer fieldset form rows */
.page-content-forms fieldset .form-row-grid {
  display: grid;
  grid-template-columns: 8rem 200px 8rem 200px;
  gap: 1rem 2rem;
  align-items: center;
  margin-bottom: 1.2rem;
  width: 100%;
}

/* All labels in referrer fieldset */
.page-content-forms fieldset .form-row-grid label {
  text-align: right;
  font-family: "Birthstone", cursive;
  font-size: 1.6rem;
  font-weight: 500;
  color: brown;
  margin: 0;
  padding: 0;
}

/* All inputs in referrer fieldset */
.page-content-forms fieldset .form-row-grid input {
  padding: 6px 8px;
  border: 2px solid #8b4513;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
  margin: 0;
  width: 100%;
}

/* Special styling for required fields */
.page-content-forms fieldset .form-row-grid input:required {
  border: 2px solid brown !important;
  background-color: #fff8f8 !important;
}

/* Focus styling */
.page-content-forms fieldset .form-row-grid input:focus {
  outline: none;
  border-color: #3366cc !important;
  box-shadow: 0 0 3px rgba(51, 102, 204, 0.3);
}

/* Specific width adjustments for different input types */
.page-content-forms fieldset .form-row-grid input[type="email"] {
  width: 250px;
}

.page-content-forms fieldset .form-row-grid input[type="date"] {
  width: 180px;
}

.page-content-forms fieldset .form-row-grid input[type="number"] {
  width: 120px;
}

/* Ensure underlined labels maintain decoration */
.page-content-forms fieldset .form-row-grid .label-underline {
  text-decoration: underline;
  text-decoration-color: brown;
}

/* Override any problematic inline styles */
.page-content-forms fieldset .form-row-grid input[style],
.page-content-forms fieldset .form-row-grid label[style] {
  margin-left: 0 !important;
  position: static !important;
}