/* stylelint-disable selector-class-pattern, no-invalid-double-slash-comments */
@use 'pix-design-tokens/typography';

.form {
  textarea {
    height: auto;
  }

  &__instructions {
    display: block;
    margin-bottom: 10px;
    font-size: 0.8rem;
  }

  .form-section {
    padding: 0 20px 20px;

    &:first-child {
      padding: 20px;
    }
  }

  .form-section--actions {
    padding: 20px;
    border-top: 1px solid var(--pix-neutral-100);
  }

  .form-field {
    margin-bottom: 16px;

    .form-field__error {
      width: 100%;
      color: var(--pix-error-700);
      font-size: 0.8em;
    }

    &__label,
    &__label label {
      margin: 0;
      font-weight: 600;
    }
  }
}

.form-actions {
  display: flex;

  button {
    margin-right: 6px;
  }
}

.form-inline {
  display: flex;
  flex-flow: row wrap;
  align-items: center;

  input {
    margin-right: 10px;
  }
}

.input {
  height: 40px;
  padding-left: 15px;
  color: var(--pix-neutral-800);
  font-size: 1rem;
  border: 2px solid var(--pix-neutral-20);
  border-radius: 4px;
  outline: none;

  &:focus {
    border: 2px solid var(--pix-communication-dark);
  }

  &--small {
    width: 160px;
  }
}

.form-control {
  display: block;
  width: 100%;
  height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 0.75rem;
  color: var(--pix-neutral-900);
  font-size: 1rem;
  line-height: 1.5;
  background-color: var(--pix-neutral-0);
  background-clip: padding-box;
  border: 1px solid var(--pix-neutral-500);
  border-radius: 0.25rem;
}

/**
* NEW ADMIN FORM STYLE
*/

.main-admin-form {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--pix-spacing-6x);
}

.admin-form__mandatory-text {
  @extend %pix-body-s;

  margin-bottom: var(--pix-spacing-3x);
}

.admin-form__content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--pix-spacing-6x);
}

.admin-form__card {
  .card__content {
    padding: var(--pix-spacing-6x) var(--pix-spacing-8x) var(--pix-spacing-8x);
  }

  .card__content > * + * {
    margin-top: var(--pix-spacing-4x);
  }
}

.admin-form__content--with-counters {
  counter-reset: title;

  .card {
    counter-increment: title;
  }

  .card__title::before {
    content: counter(title) '.\00a0';
  }
}

.admin-form__actions {
  display: flex;
  gap: var(--pix-spacing-4x);
  margin-top: var(--pix-spacing-6x);
}

.admin-form__select {
  width: 100%;
}
