/* ===== After-school interest form ===== */
/* Scoped to .webform-submission-form so it doesn't bleed into other forms. */

/* --- Overall form container --- */
.webform-submission-form {
  max-width: 720px;
  margin: 1.5rem auto;
  padding: 0 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #222;
}

/* --- Intro markup paragraph --- */
.webform-submission-form > div:first-child p,
.webform-submission-form .webform-element--type-webform-markup p {
  font-size: 1.125rem;
  color: #333;
  background: #fff8e1;
  border-left: 4px solid #d4a017;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  border-radius: 0 6px 6px 0;
}

/* --- Sections render as cards --- */
.webform-submission-form fieldset.webform-section {
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: 8px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s ease;
}

.webform-submission-form fieldset.webform-section:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Section titles (legends) */
.webform-submission-form fieldset.webform-section > legend {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
  width: auto;
  padding: 0 0 0.5rem 0;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid #d4a017;
  letter-spacing: -0.01em;
}

/* Section help description */
.webform-submission-form fieldset.webform-section > .description,
.webform-submission-form fieldset.webform-section .fieldset-description {
  color: #6c757d;
  font-size: 0.925rem;
  margin: -0.25rem 0 1rem 0;
  font-style: italic;
}

/* --- Field spacing inside sections --- */
.webform-submission-form fieldset.webform-section .form-item,
.webform-submission-form fieldset.webform-section .js-form-item {
  margin-bottom: 1.25rem;
}

.webform-submission-form fieldset.webform-section .form-item:last-child {
  margin-bottom: 0;
}

/* --- Labels --- */
.webform-submission-form label.form-label,
.webform-submission-form .form-item > label {
  font-weight: 600;
  color: #2a2a2a;
  margin-bottom: 0.375rem;
  font-size: 0.95rem;
  display: inline-block;
}

/* Required marker — clearer than tiny red asterisk */
.webform-submission-form .form-required::after,
.webform-submission-form label.js-form-required::after {
  content: " *";
  color: #c0392b;
  font-weight: 700;
  margin-left: 2px;
}

/* --- Inputs, selects, textareas --- */
.webform-submission-form input.form-control,
.webform-submission-form select.form-select,
.webform-submission-form textarea.form-control,
.webform-submission-form input[type="text"],
.webform-submission-form input[type="email"],
.webform-submission-form input[type="tel"],
.webform-submission-form input[type="number"],
.webform-submission-form input[type="date"],
.webform-submission-form select,
.webform-submission-form textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 1rem;
  border: 1px solid #c4c8cc;
  border-radius: 6px;
  background-color: #fff;
  color: #212529;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Number / date / phone inputs slightly narrower so they don't look stretched */
.webform-submission-form input[type="number"],
.webform-submission-form input[type="date"],
.webform-submission-form input[type="tel"] {
  max-width: 280px;
}

/* Selects look like inputs */
.webform-submission-form select {
  max-width: 360px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2010%206%22%3E%3Cpath%20fill%3D%22%23666%22%20d%3D%22M0%200l5%206%205-6z%22/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 10px 6px;
  padding-right: 2.25rem;
}

/* Textareas: comfortable min-height */
.webform-submission-form textarea {
  min-height: 90px;
  resize: vertical;
  font-family: inherit;
}

/* Focus states — high contrast accessibility */
.webform-submission-form input:focus,
.webform-submission-form select:focus,
.webform-submission-form textarea:focus {
  outline: 0;
  border-color: #d4a017;
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.2);
}

/* Placeholders */
.webform-submission-form ::placeholder {
  color: #99a;
  opacity: 1;
}

/* Help text under inputs */
.webform-submission-form .description,
.webform-submission-form .form-text {
  color: #6c757d;
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* --- Checkbox / radio groups --- */
.webform-submission-form .form-checkboxes,
.webform-submission-form .form-radios {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem 1rem;
  margin-top: 0.25rem;
}

.webform-submission-form .form-check {
  padding: 0.5rem 0.75rem;
  border: 1px solid #e3e6ea;
  border-radius: 6px;
  background: #f9fafb;
  transition: background 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.webform-submission-form .form-check:hover {
  background: #f0f4f8;
  border-color: #c4cad0;
}

/* Custom-drawn checkbox / radio — visible even when unchecked */
.webform-submission-form .form-check input[type="checkbox"],
.webform-submission-form .form-check input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin: 0;
  flex-shrink: 0;
  border: 2px solid #6c757d;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.webform-submission-form .form-check input[type="checkbox"] {
  border-radius: 4px;
}

.webform-submission-form .form-check input[type="radio"] {
  border-radius: 50%;
}

.webform-submission-form .form-check input[type="checkbox"]:hover,
.webform-submission-form .form-check input[type="radio"]:hover {
  border-color: #d4a017;
  background: #fffbeb;
}

.webform-submission-form .form-check input[type="checkbox"]:checked,
.webform-submission-form .form-check input[type="radio"]:checked {
  background: #d4a017;
  border-color: #d4a017;
}

/* Checkmark drawn with two CSS borders rotated 45° */
.webform-submission-form .form-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 1px;
  width: 7px;
  height: 13px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

/* Radio inner dot */
.webform-submission-form .form-check input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

.webform-submission-form .form-check input[type="checkbox"]:focus-visible,
.webform-submission-form .form-check input[type="radio"]:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.35);
}

/* Disabled state */
.webform-submission-form .form-check input[type="checkbox"]:disabled,
.webform-submission-form .form-check input[type="radio"]:disabled {
  border-color: #ccd1d5;
  background: #f0f2f4;
  cursor: not-allowed;
}

.webform-submission-form .form-check-label {
  font-weight: 500;
  margin: 0;
  cursor: pointer;
  font-size: 0.975rem;
  color: #2a2a2a;
}

/* Visible CHECKED state for the whole chip — modern :has() */
.webform-submission-form .form-check:has(input:checked) {
  background: #fff8e1;
  border-color: #d4a017;
  border-width: 2px;
  padding: calc(0.5rem - 1px) calc(0.75rem - 1px);
  box-shadow: 0 1px 4px rgba(212, 160, 23, 0.25);
}

.webform-submission-form .form-check:has(input:checked) .form-check-label {
  font-weight: 600;
  color: #1a1a1a;
}

/* Fallback class — set by the optional JS for older browsers */
.webform-submission-form .form-check.is-checked {
  background: #fff8e1;
  border-color: #d4a017;
  border-width: 2px;
  padding: calc(0.5rem - 1px) calc(0.75rem - 1px);
  box-shadow: 0 1px 4px rgba(212, 160, 23, 0.25);
}

.webform-submission-form .form-check.is-checked .form-check-label {
  font-weight: 600;
  color: #1a1a1a;
}

/* Days-of-week: keep compact in one row on wider screens */
.webform-submission-form .form-item-preferred-days .form-checkboxes {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* --- Validation errors --- */
.webform-submission-form input.error,
.webform-submission-form select.error,
.webform-submission-form textarea.error,
.webform-submission-form .form-control.is-invalid {
  border-color: #c0392b;
  background-color: #fdf2f0;
}

.webform-submission-form .form-item--error-message,
.webform-submission-form .invalid-feedback {
  color: #c0392b;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.25rem;
  display: block;
}

/* --- Submit / actions area --- */
.webform-submission-form .form-actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e3e6ea;
  text-align: center;
}

.webform-submission-form .form-actions .button,
.webform-submission-form .form-actions input[type="submit"],
.webform-submission-form .form-actions .webform-button--submit {
  background: #d4a017;
  color: #fff;
  border: none;
  padding: 0.875rem 2.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 4px rgba(212, 160, 23, 0.3);
}

.webform-submission-form .form-actions .button:hover,
.webform-submission-form .form-actions input[type="submit"]:hover,
.webform-submission-form .form-actions .webform-button--submit:hover {
  background: #b8870a;
  box-shadow: 0 4px 8px rgba(212, 160, 23, 0.4);
}

.webform-submission-form .form-actions .button:active,
.webform-submission-form .form-actions input[type="submit"]:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(212, 160, 23, 0.3);
}

.webform-submission-form .form-actions .button:focus,
.webform-submission-form .form-actions input[type="submit"]:focus {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.4);
}

/* --- Mobile tweaks --- */
@media (max-width: 600px) {
  .webform-submission-form {
    padding: 0 0.5rem;
  }

  .webform-submission-form fieldset.webform-section {
    padding: 1.25rem 1rem;
  }

  .webform-submission-form fieldset.webform-section > legend {
    font-size: 1.125rem;
  }

  .webform-submission-form .form-checkboxes,
  .webform-submission-form .form-radios {
    grid-template-columns: 1fr;
  }

  .webform-submission-form .form-actions .button {
    width: 100%;
  }
}