@use '../../partials/flex';
@use '../../partials/dir';

.auth__base {
  --pattern-size: 48px;
  min-height: 100%;
  background-color: var(--bg-surface-low);

  background-image: radial-gradient(rgba(0, 0, 0, 6%) 2px, rgba(0, 0, 0, 0%) 2px);
  background-size: var(--pattern-size) var(--pattern-size);

  display: flex;
  flex-direction: column;
}
.auth__wrapper {
  flex: 1;
  padding: var(--sp-loose);
  padding-bottom: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.auth-footer {
  padding: var(--sp-normal) 0;
  display: flex;
  justify-content: center;
  align-items: center;

  & > *:nth-child(2n) {
    margin: 0 var(--sp-loose);
  }
  & a {
    color: var(--tc-surface-normal);
    &:hover { text-decoration: underline; }
  }
}
.auth-card {
  width: 462px;
  background-color: var(--bg-surface);
  border-radius: var(--bo-radius);
  box-shadow: var(--bs-popup);
  overflow: hidden;

  &__content {
    padding: var(--sp-extra-loose) calc(var(--sp-normal) + var(--sp-extra-loose));
  }
  &__switch {
    margin-top: var(--sp-loose) !important;
  }
}

.homeserver-form,
.auth-form__heading {
  & .context-menu__item .text {
    margin: 0 !important;
  }
}

.homeserver-form {
  display: flex;
  margin-bottom: var(--sp-extra-tight);
  align-items: flex-end;
  & > .input-container {
    flex: 1;
    & .input {
      background-color: var(--bg-surface);
      @include dir.prop(border-right-width, 0, 1px);
      @include dir.prop(border-left-width, 1px, 0 );
      @include dir.prop(border-radius,
        var(--bo-radius) 0 0 var(--bo-radius),
        0 var(--bo-radius) var(--bo-radius) 0,
      );
    }
  }
  & .ic-btn {
    height: 46px;
    border: 1px solid var(--bg-surface-border);
    @include dir.prop(border-radius,
      0 var(--bo-radius) var(--bo-radius) 0,
      var(--bo-radius) 0 0 var(--bo-radius),
    );
  }

  &__status {
    margin-top: var(--sp-normal);
    & .donut-spinner {
      min-width: 28px;
    }
    & .text {
      margin: 0 var(--sp-tight);
    }
  }
  &__error {
    margin-bottom: var(--sp-normal) !important;
    color: var(--tc-danger-normal) !important;
  }
}

.auth-form {
  & > .input-container,
  &__pass-eye-wrapper {
    margin: var(--sp-tight) 0 var(--sp-ultra-tight);
  }
  
  &__heading {
    display: flex;
    justify-content: space-between;
    margin-top: calc(var(--sp-extra-loose) + var(--sp-tight));
  }

  &__pass-eye-wrapper {
    position: relative;
    & .ic-btn {
      position: absolute;
      @include dir.prop(right, 6px, unset);
      @include dir.prop(left, unset, 6px );
      bottom: 6px;
      border-radius: 4px;
    }
    & input {
      @include dir.side(padding, var(--sp-normal), 46px);
    }
  }

  &__btns {
    padding-top: var(--sp-loose);
    margin-bottom: var(--sp-extra-loose);
    display: flex;
    justify-content: flex-end;
  }

  &__error {
    color: var(--tc-danger-normal) !important;
  }
}
.sso__divider {
  margin-bottom: var(--sp-tight);
  display: flex;
  align-items: center;

  &::before,
  &::after {
    flex: 1;
    content: '';
    margin: var(--sp-tight);
    border-bottom: 1px solid var(--bg-surface-border);
  }
}

@media (max-width: 462px) {
  .auth__wrapper {
    padding: var(--sp-tight);
  }
  .auth-card {
    &__content {
      padding: var(--sp-loose) var(--sp-normal);
    }
  }
}

.process-wrapper {
  @extend .cp-fx__column--c-c;

  min-height: 100%;
  width: 100%;
  background-color: var(--bg-surface-low);
  opacity: .96;

  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
}