@import '../../../../../../client/scss/settings';
@import '../../../../../../client/scss/tools';

// overrides default nice padding defined in variables.scss
$desktop-nice-padding: 100px;

html,
body,
.content-wrapper {
  background-color: $color-grey-1;
  color: $color-grey-3;
}

html {
  height: 100%;
}

body {
  margin-inline-start: 0;
  height: 100%;
}

.content-wrapper {
  border: 0;
}

.wrapper {
  padding-inline-start: $mobile-nice-padding;
  padding-inline-end: $mobile-nice-padding;
  margin-inline-start: 0;
  max-width: none;
}

h1 {
  font-weight: 300;
  font-size: 2em;
  line-height: 1em;
  color: $color-white;
  white-space: nowrap;
}

form {
  width: 100%;

  ul {
    @include unlist();
  }
}

label {
  width: auto;
  color: $color-white;
}

.button,
a.button {
  line-height: 1.2em;
  font-size: 1.5em;
  padding: 1.1em 2.4em;
  height: 3.5em;
}

.fields-wrapper {
  position: relative;
}

.fields {
  max-width: none;
}

.fields li {
  padding: 1em 0;

  &.full {
    position: relative;
    padding: 0;

    label {
      @include visuallyhidden;
    }

    input {
      border-top: 1px dashed $color-input-border;
    }
  }

  &:first-child input {
    border: 0;
  }
}

.fields .checkbox {
  padding-top: 2em;
  padding-bottom: 2em;
}

.field {
  padding: 0;
}

.iconfield .input:before {
  display: none;
}

// Special full-width, one-off fields i.e a single text or textarea input
.full input {
  border-radius: 0;
  font-weight: 300;
  border: 0;
  padding: 1.5em $mobile-nice-padding 1.5em $mobile-nice-padding;
  font-size: 1.6em;
  line-height: 1.6em;
}

// Forgotten password link
.help {
  font-size: 1.3em;
  margin-top: 0;
  padding: 10px 0;

  @include media-breakpoint-up(sm) {
    position: absolute;
    top: 139px;
    // Remove once we drop support for Safari 13.
    // stylelint-disable-next-line property-disallowed-list
    right: 5%;
    inset-inline-end: 5%;
    padding: 0;
  }

  &__link {
    color: $color-white;

    @include media-breakpoint-up(sm) {
      color: $color-link;
    }
  }
}

.messages {
  margin: 1em 0;
  z-index: 5;

  ul {
    margin: 0;

    &:before {
      display: none;
    }

    li {
      border-radius: 3px;
    }
  }
}

@include media-breakpoint-up(sm) {
  .content-wrapper {
    float: none;
    height: auto;
    width: 100%;
    display: inline-block;
    vertical-align: middle;
  }

  // centres login form vertically
  .wrapper {
    position: relative;
    height: 100%;
    padding: 0 $desktop-nice-padding;

    &:before {
      content: '';
      width: 0;
      display: inline-block;
      height: 100%;
      vertical-align: middle;
      margin-inline-start: -0.4em;
    }
  }

  h1 {
    font-size: 4em;
  }

  .full {
    margin: 0 (-$desktop-nice-padding);

    .iconfield {
      .input:before {
        display: inline-block;
        position: absolute;
        color: $color-grey-4;
        border: 2px solid $color-grey-4;
        border-radius: 100%;
        width: 1em;
        padding: 0.3em;
        // Remove once we drop support for Safari 13.
        // stylelint-disable-next-line property-disallowed-list
        left: $desktop-nice-padding;
        inset-inline-start: $desktop-nice-padding;
        margin-top: -1.1rem;
        top: 50%;
        font-size: 1.3rem;
      }

      input {
        padding-inline-start: ($desktop-nice-padding + 50px);
      }
    }
  }
}
