@use '../../00-settings/settings' as *;
@use '../../00-mixins/mixins' as *;
@use '../../11-base/fonts/icons' as *;

%messages,
.messages {
  @include icon('info-circle', before);
  @include theme('color', 'color-zero', 'status-message-color');
  @include theme('background-color', 'color-info-light', 'info-message-background');
  @include theme('border-color', 'color-info', 'info-message-icon-color');

  $status-message-icon-size: 40px;

  position: relative;
  flex-direction: column;
  max-width: 970px;
  margin-top: 20px;
  margin-right: 0;
  margin-bottom: 20px;
  padding: 100px 40px 40px;
  border-bottom: 3px solid;
  font-size: .9rem;

  @include phablet {
    flex-direction: row;
    padding: 60px 60px 60px 125px;
  }

  &::before {
    @include theme('color', 'color-info', 'info-message-icon-color');

    position: absolute;
    top: 40px;
    left: 40px;
    width: calc($status-message-icon-size + 20px);
    padding-bottom: 20px;
    font-size: $status-message-icon-size;
    line-height: $status-message-icon-size;
    text-align: left;

    @include phablet {
      top: 60px;
      left: 60px;
      padding-right: 20px;
    }
  }

  &--status {
    @include icon('checkmark-circle', before);
    @include theme('background-color', 'color-success-light', 'success-message-background');
    @include theme('border-color', 'color-success', 'success-message-icon-color');

    &::before {
      @include theme('color', 'color-success', 'success-message-icon-color');
    }

    a {
      @include link-background('color-zero', 'color-success-light');
    }
  }

  &--error {
    @include icon('cross-circle', before);
    @include theme('background-color', 'color-error-light', 'error-message-background');
    @include theme('border-color', 'color-error', 'error-message-icon-color');

    &::before {
      @include theme('color', 'color-error', 'error-message-icon-color');
    }

    a {
      @include link-background('color-zero', 'color-error-light');
    }
  }

  &--warning {
    @include icon('exclamation-circle', before);
    @include theme('background-color', 'color-warning-light', 'warning-message-background');
    @include theme('border-color', 'color-warning', 'warning-message-icon-color');

    &::before {
      @include theme('color', 'color-warning', 'warning-message-icon-color');
    }

    a {
      @include link-background('color-zero', 'color-warning-pastel');
    }
  }

  > p {
    &:last-child {
      margin: 0;
    }
  }

  a {
    @include link-background('color-zero', 'color-info-pastel');
    @include theme('border-color', 'color-zero');
    @include theme('color', 'color-zero');

    &:hover {
      @include theme('color', 'color-zero');
    }
  }
}
