@use './_theme';

$breakpoint-linear-form: theme.$sm;
$breakpoint-sticky-actions: theme.$md;

.form {
  display: grid;
  row-gap: 30px;

  @media (width > $breakpoint-linear-form) {
    grid-template-columns: max-content 1fr;
  }
  svg path {
    stroke: var(--text-color-ultra-dark);
  }
  svg path:nth-of-type(2) {
    fill: var(--text-color-ultra-dark);
  }
}

.form-heading {
  align-items: center;
  color: var(--text-color-ultra-dark);
  display: flex;
  font-size: var(--text-size-h4);
  gap: 12px;
  grid-column: 1 / -1;
  margin: 0;

  &:not(:first-child) {
    border-top: 1px solid var(--color-line);
    padding-top: 30px;
  }
}

.form-actions {
  display: flex;
  gap: 20px;
  margin-top: 30px;

  @media (width <= $breakpoint-sticky-actions) {
    background: #fff;
    border-top: 1px solid var(--color-line);
    bottom: 0;
    padding: 20px;
    position: sticky;
  }

  @media (width > $breakpoint-sticky-actions) {
    margin-bottom: 40px;
  }

  .button {
    height: 40px;
    line-height: 28px;

    .loading-dots {
      top: 14.5px;
    }
  }

  .success {
    align-items: center;
    color: var(--color-success);
    display: flex;
    font-size: var(--text-size-label);
    gap: 8px;
    justify-content: center;

    .xs {
      @media (width > theme.$sm) {
        display: none;
      }
    }

    .gte-xs {
      @media (width <= theme.$sm) {
        display: none;
      }
    }
  }
}

.form-actions-col {
  flex-basis: 0;
  flex-grow: 1;
}

.password-error-info {
  display: inline-flex;
  position: relative;
  margin-left: 5px;
  cursor: help;
  vertical-align: middle;

  .icon {
    display: block;
    position: relative;
    top: -1px;
    svg path {
      stroke: none
    }
    svg path:nth-of-type(2) {
      fill: var(--color-error);
    }

    &:hover + .password-error-info-text {
      display: block;
    }
  }

  .password-error-info-text {
    white-space: pre-wrap;
    margin-top: 5px;
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-fill);
    color: var(--text-color-disabled);
    padding: 10px;
    max-width: 350px;
    min-width: 170px;
    width: auto;
    text-align: left;
    border-radius: var(--form-input-border-radius);
    border: 1px solid var(--color-line);
    z-index: 90;
    list-style: disc;
    padding-left: 20px;
    margin: 0;
  }
}
