/* Basic CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f4f7f6; /* Lighter, modern background */
}

h1 {
  text-align: center;
  color: #0056b3; /* A nice blue */
  margin-bottom: 1.5rem;
}

h2 {
  border-bottom: 2px solid #0056b3; /* Consistent with h1 color */
  padding-bottom: 0.5rem;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  color: #0056b3;
}

form {
  max-width: 700px;
  margin: 2rem auto;
  padding: 2rem 2.5rem;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

label {
  display: block;
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
  font-weight: 600; /* Slightly bolder */
  color: #555;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #ced4da; /* Lighter border */
  border-radius: 4px; /* Slightly more rounded */
  box-sizing: border-box;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

input[type="file"] {
    padding-top: 0.8rem; /* Adjust padding for file input */
    padding-bottom: 0.8rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  border-color: #80bdff; /* Blue focus border */
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25); /* Subtle shadow on focus */
}

textarea {
  resize: vertical;
  min-height: 80px; /* Minimum height for textareas */
}

.gender-group {
  margin-top: 0.5rem;
  display: flex; /* Use flexbox for radio buttons */
  gap: 1rem; /* Space between radio buttons */
}

.gender-group label {
  font-weight: normal;
  margin-top: 0;
  margin-bottom: 0;
  display: inline-flex; /* Align text with radio button */
  align-items: center;
}

button {
  display: inline-block;
  margin-top: 1.8rem; /* More space above buttons */
  padding: 0.8rem 1.8rem;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  background: #007bff; /* Primary blue button */
  color: white;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

button:hover {
  background: #0056b3; /* Darker blue on hover */
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

button[type="submit"] {
    background: #28a745; /* Green for submit */
}

button[type="submit"]:hover {
    background: #218838;
}

.add-subject-btn {
  margin-top: 1rem;
  background: #17a2b8; /* Info blue for add subject */
}
.add-subject-btn:hover {
  background: #138496;
}

.subject-input {
  margin-top: 0.8rem;
  position: relative;
  display: flex; /* Use flex for subject input and remove button */
  align-items: center;
}

.subject-input input {
  flex-grow: 1; /* Allow input to grow */
  margin-top: 0; /* Reset margin from general input rule */
}

.remove-subject-btn {
  background: #dc3545;
  color: white;
  border: none;
  font-weight: bold;
  width: 35px; /* Slightly larger button */
  height: 35px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 0.5rem; /* Space between input and button */
  flex-shrink: 0; /* Prevent shrinking */
  display: flex;
  justify-content: center;
  align-items: center;
}
.remove-subject-btn:hover {
  background: #c82333;
}

#nextKin2Section {
    border-top: 1px solid #e9ecef; /* Lighter border for section separator */
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

#referralOtherContainer {
    margin-top: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  form {
    margin: 1rem auto;
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.8rem;
  }
  h2 {
    font-size: 1.4rem;
  }
  button {
    width: 100%;
    padding: 0.7rem;
    font-size: 1rem;
  }
  .gender-group {
    flex-direction: column; /* Stack radio buttons on small screens */
    gap: 0.5rem;
  }
}