/* Override legacy global form sizing only on public contact and login forms. */
.public-form {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.public-form label {
  display: block;
  min-width: 0;
  margin-bottom: 0;
}

.public-form input,
.public-form select,
.public-form textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 3rem;
  margin: 0.5rem 0 0;
  padding: 0.75rem;
  font-size: 1rem;
}

.public-form textarea {
  min-height: 6rem;
  resize: vertical;
}

.public-form :is(input, select, textarea):focus-visible {
  outline: 2px solid #ff7430;
  outline-offset: 2px;
}

.public-form button {
  min-height: 2.75rem;
}

/* Light fields must not inherit white text from the dark page, including on mobile. */
.shared-form-fields
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.shared-form-fields select,
.shared-form-fields textarea {
  color: #2e2e2e;
  caret-color: #2e2e2e;
  color-scheme: light;
}

.shared-form-fields input::placeholder,
.shared-form-fields textarea::placeholder {
  color: #626262;
  opacity: 1;
}

.shared-form-fields input:-webkit-autofill,
.shared-form-fields textarea:-webkit-autofill {
  -webkit-text-fill-color: #2e2e2e;
  caret-color: #2e2e2e;
}

/* Keep paired mentor textareas aligned when one label wraps onto two lines. */
@media (min-width: 768px) {
  .public-form .mentor-textarea-label {
    display: block;
    min-height: 3em;
    line-height: 1.5;
  }
}

.shared-form-fields .public-form label.mentor-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.public-form .mentor-consent input[type="checkbox"] {
  flex: 0 0 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  min-height: 0;
  margin: 0.2rem 0 0;
  padding: 0;
}

/* Same entrance as the hacker signup steps (HackerFormLayout.css). */
.public-form {
  animation: public-form-reveal 240ms ease-out;
}

@keyframes public-form-reveal {
  from {
    opacity: 0.5;
    filter: blur(4px);
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .public-form {
    animation: none;
  }
}
