/* Emergency Contact Information form (cgi-bin/emergency-contact-form.cgi) */

.ec-form .ec-required { color: #6B1A1A; font-weight: 700; }
.ec-required-note { margin: 0 0 1rem; }

/* Bootstrap 5 dropped .form-group's bottom margin, so the rows touched. */
.ec-form .form-group { margin-bottom: 0.75rem; }

.ec-fieldset {
  min-width: 0;
  margin: 1.5rem 0 0;
  padding: 0;
  border: 0;
}
.ec-fieldset > legend {
  float: none;
  width: auto;
  margin: 0 0 0.75rem;
  padding: 0;
  font-size: 1.125rem;
  font-weight: 700;
}
.ec-help { margin: 0 0 0.75rem; }

.ec-field { min-width: 0; }
.ec-field label,
.ec-phone-part label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}
.ec-field .form-control { width: 100%; max-width: 100%; }

.ec-student {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 0.75rem;
}

.ec-phone-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content)) auto;
  gap: 0.75rem 2rem;
  align-items: end;
  margin-bottom: 1rem;
}
.ec-phone {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.ec-phone > legend {
  float: none;
  width: auto;
  margin: 0 0 0.25rem;
  padding: 0;
  font-size: 1rem;
  font-weight: 700;
}
.ec-phone-parts {
  display: flex;
  align-items: flex-end;
  gap: 0.375rem;
}
.ec-phone-part .form-control {
  width: 4.25rem;
  text-align: center;
}
.ec-phone-part.ec-phone-line .form-control { width: 5rem; }
.ec-dash { padding-bottom: 0.5rem; }

.ec-add,
.ec-remove {
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 1px solid #6B1A1A;
  border-radius: 4px;
  background: #fff;
  color: #6B1A1A;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.ec-add:hover,
.ec-remove:hover { background: #FDF3DC; }
.ec-add:focus-visible,
.ec-remove:focus-visible {
  outline: 2px solid #6B1A1A;
  outline-offset: 2px;
}
.ec-add[hidden] { display: none; }

.ec-captcha { margin-top: 1.5rem; }
.ec-submit { margin-top: 1.5rem; }

/* Stacked columns need no gutter, and the row's negative gutter margin would
   push the fields past the right edge of the content area. */
@media (max-width: 575.98px) {
  .ec-form .row {
    margin-left: 0;
    margin-right: 0;
    row-gap: 0.5rem;
  }
  .ec-form .row > * {
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 767.98px) {
  .ec-student { grid-template-columns: minmax(0, 1fr); }
  .ec-student .ec-remove { justify-self: start; }
  .ec-phone-pair { grid-template-columns: minmax(0, 1fr); }
  .ec-phone-pair .ec-remove { justify-self: start; }
}

/* The reCAPTCHA widget is a fixed 304x78, wide enough to stretch the page
   column at 320px. Scale it down inside a box of the scaled size, because a
   transform alone leaves the 304px layout width in place. */
@media (max-width: 360px) {
  .ec-captcha {
    width: 259px;
    height: 67px;
  }
  .ec-captcha .g-recaptcha {
    transform: scale(0.85);
    transform-origin: 0 0;
  }
}
