@layer modules {
  .web-form-page {
    min-height: 100vh;
    padding-block: 3rem;
    padding-inline: 1rem;

    @media (min-width: 40rem) {
      padding-inline: 1.5rem;
    }

    @media (min-width: 64rem) {
      padding-inline: 2rem;
    }
  }

  .web-form-page--centered {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .web-form-narrow {
    max-width: var(--container-md);
    width: 100%;
  }

  .web-form-container {
    max-width: var(--container-3xl);
    margin-inline: auto;
  }

  .web-form-card {
    background-color: var(--color-white);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
    padding: 2rem;
  }

  .web-form-card--centered {
    text-align: center;
  }

  .web-form-status-icon {
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 4rem;
    width: 4rem;
    border-radius: 3.40282e38px;
    margin-bottom: 1rem;
  }

  .web-form-status-icon--error {
    background-color: var(--color-red-100);
  }

  .web-form-status-icon--success {
    background-color: var(--color-green-100);
  }

  .web-form-status-svg {
    height: 2.5rem;
    width: 2.5rem;
    color: var(--color-green-600);
  }

  .web-form-status-title {
    font-size: var(--text-2xl);
    line-height: var(--text-2xl--line-height);
    font-weight: var(--font-weight-bold);
    color: var(--color-gray-900);
    margin-bottom: 0.5rem;
  }

  .web-form-status-text {
    color: var(--color-gray-600);
    margin-bottom: 1.5rem;
  }

  .web-form-status-meta {
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
    color: var(--color-gray-500);
  }

  .web-form-header {
    text-align: center;
    margin-bottom: 2rem;
  }

  .web-form-header__title {
    font-size: var(--text-3xl);
    line-height: var(--text-3xl--line-height);
    font-weight: var(--font-weight-bold);
    color: var(--color-gray-900);
    margin-bottom: 0.5rem;
  }

  .web-form-header__description {
    color: var(--color-gray-600);
  }

  .web-form-errors {
    background-color: var(--color-red-50);
    border: 1px solid var(--color-red-200);
    color: var(--color-red-700);
    padding-inline: 1rem;
    padding-block: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
  }

  .web-form-errors__title {
    font-weight: var(--font-weight-medium);
    margin-bottom: 0.5rem;
  }

  .web-form-errors__list {
    list-style-type: disc;
    list-style-position: inside;
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
  }

  .web-form-fields {
    & > :not(:last-child) {
      margin-block-end: 1.5rem;
    }
  }

  .web-form-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: flex-end;
  }

  .web-form-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
    color: var(--color-gray-500);
  }

  .web-form-field-label {
    margin-bottom: 0.5rem;
  }

  .web-form-field-description {
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
    color: var(--color-gray-500);
    margin-bottom: 0.5rem;
  }

  /* Base border/padding/focus-ring come from base.css form controls; here we
     only override radius/border-colour/shadow/sm font-size and recolour the
     focus ring to blue-500. */
  .web-form-input {
    display: block;
    width: 100%;
    border-radius: var(--radius-md);
    border-color: var(--color-gray-300);
    box-shadow: var(--shadow-xs);

    &:focus {
      --focus-ring-color: var(--color-blue-500);
    }

    @media (min-width: 40rem) {
      font-size: var(--text-sm);
      line-height: var(--text-sm--line-height);
    }
  }

  /* Fill/hover/shadow-xs/radius/medium weight come from .btn--primary. */
  .web-form-submit {
    --btn-padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    font-size: var(--text-base);
    line-height: var(--text-base--line-height);

    &:focus-visible {
      outline: var(--focus-ring);
      outline-offset: var(--focus-ring-offset);
    }
  }
}
