/* General form container */
form {
  max-width: 550px;
  margin: auto;
  background: #fff;
  padding: 20px 30px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Fieldset and legend */
fieldset {
  border: 1px solid #ddd;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

legend {
  font-size: 1.3rem;
  font-weight: 700;
  padding: 0 10px;
  color: #e53333;
}

/* Section titles inside form */
.form-section-title {
  font-size: 1.15rem;
  color: #003b77;
  margin: 20px 0 10px;
  font-weight: 600;
}

/* Labels */
label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #003b77;
  font-size: 0.95rem;
}

/* Inputs, selects, textareas */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 18px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  border-color: #e53333;
  outline: none;
}

/* Textarea specific */
textarea {
  resize: vertical;
  min-height: 80px;
}

/* Checkbox label inline */
label > input[type="checkbox"] {
  margin-right: 8px;
  vertical-align: middle;
}

/* Submit buttons */
.submit-btn,
.btn {
  background-color: #e53333;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 12px 0;
  width: 100%;
  transition: background-color 0.3s ease;
  margin-top: 10px;
}

.submit-btn:hover,
.btn:hover {
  background-color: #bf2929;
}

/* Responsive Adjustments */

/* Form container max width scaling */
@media (max-width: 768px) {
  form {
    max-width: 90%; /* Use almost full width on tablets and small devices */
    padding: 15px 20px;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="date"],
  select,
  textarea {
    padding: 8px 12px;
    font-size: 0.95rem;
  }

  .submit-btn,
  .btn {
    font-size: 1rem;
    padding: 10px 0;
  }
}

@media (max-width: 480px) {
  form {
    max-width: 100%; /* Full width on small phones */
    padding: 10px 15px;
  }

  legend {
    font-size: 1.1rem;
  }

  .form-section-title {
    font-size: 1rem;
  }

  label {
    font-size: 0.9rem;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="date"],
  select,
  textarea {
    font-size: 0.9rem;
    padding: 7px 10px;
  }

  .submit-btn,
  .btn {
    font-size: 0.95rem;
    padding: 9px 0;
  }
}
