/* Global */
input {
  width: 100%;
  box-sizing: border-box;
  font-family: 'Open Sans', 'Arial', sans-serif;
  font-size: 16px;
  line-height: 24px;
  caret-color: #002454;
  outline: none;
  padding: 15px;
  border: 1px solid #716A5B;
  border-radius: 8px;
  margin: 8px 0 12px 0;
}

/* Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}

a {
  color: #002454;
}

button {
  background-color: transparent;
  color: #002454;
  font-family: 'Open Sans', 'Arial', sans-serif;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  padding: 0;
  border: none;
  margin: 0;
  cursor: pointer;
}

button.primary {
  width: 100%;
  height: 56px;
  background-color: #002454;
  color: #ffffff;
  font-size: 16px;
  line-height: 16px;
  font-weight: 600;
  border-radius: 8px;

  &:disabled {
    cursor: not-allowed;
    background-color: #bbb;
  }
}

button.secondary {
  width: 100%;
  height: 56px;
  background-color: transparent;
  color: #002454;
  font-size: 16px;
  line-height: 16px;
  font-weight: 600;
  border-radius: 8px;
}

.semibold {
  color: #000000;
  font-weight: 600;
}

.error {
  background-color: #F8D7DA;
  color: #B10000;
  padding: 16px;
  border-radius: 8px;
}

.highlight {
  background-color: #F7F7F7;
  color: #716A5B;
  border-radius: 8px;
}

.info {
  margin-bottom: 24px;
}

.description {
  margin-bottom: 30px;
  font-weight: 600;
}

body, html {
  height: 100%;
  width: 100%;
  font-family: 'Open Sans', 'Arial', sans-serif;
  color: #716A5B;
  box-sizing: border-box;
  margin: 0px;
  padding: 0px;
}

#root {
  width: 100%;
  height: 100%;
  margin: 0px;
  padding: 0px;
}

/* Container */
/* The container is the main wrapper for the page, it contains the content and the aside elements. */
div#container {
  display: flex;
  height: 100%;
}

/* Content container */
div#content-container {
  width: 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: center;
  padding: 24px;
  overflow-y: auto;
  box-sizing: border-box;
}

/* Header */
header {
  width: 100%;
  display: flex;
  flex-direction: column;
}

header button#back-button {
  width: fit-content;
  display: flex;
  align-items: center;
}

header img#back-arrow {
  rotate: -90deg;
  margin-right: 8px;
}

header button#logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  width: fit-content;
  margin-left: auto;

  svg {
    margin-right: 8px;
  }
}

header div#whitespace {
  height: 24px;
}

header img#husqvarna-group-logo {
  width: 84px;
  display: block;
  margin: 64px auto 48px;
}

/* main */
/* The main element is the main content of the page, it contains the brand logo and the login form. */
/* The main element is also used for the authorize page and the error page. */
main {
  width: 100%;
  max-width: 350px;
  min-height: fit-content;
  margin: 64px 0px;
  display: flex;
  flex-direction: column;
}

div#brand-logo-container {
  height: 32px;

  img#brand-logo-image {
    height: 32px;
  }

  /* Husqvarna Group logo is a special case, it has a different height and text-align */
  &.husqvarnagroup-logo {
    height: auto;
    text-align: center;

    img#brand-logo-image {
      height: auto;
    }
  }
}

/* Login */
div#account-description-container {
  margin: 16px 0;
}

button#account-description-title {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
}

img#account-description-arrow {
  width: 16px;
}

p#account-description-text {
  display: none;
  padding: 16px;
  margin: 16px 0;
}

div#login-error {
  margin-bottom: 16px;
}

label#mfa-code-label {
  display: none;
}

input#mfa-code {
  margin-top: 0;
}

button#login-button {
  margin-top: 20px;
}

#link-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  gap: 6px;
}

a#forgot-password, a#login-without-password {
  width: 100%;
  display: block;
  text-align: center;
  font-size: 16px;
  line-height: 24px;
}

/* footer */
footer {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  /* Push footer to the bottom */
  margin-top: auto;
}

.footer__container {
  max-width: 500px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

img#footer-logo {
  width: 100%;
  max-width: 200px;
  display: block;
  margin: 10px auto;
}

.footer__text {
  width: 100%;
  display: block;
  margin: 0 auto;
  color: rgb(143, 142, 142);
  text-align: center;
  font-size: 14px;
  line-height: 20px;
}

.footer__links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: row;
  margin-top: 15px;
  gap: 16px;
  @media only screen and (max-width: 550px) {
    flex-direction: column;
    gap: 8px;
  }
}

.footer__links a {
  font-size: 14px;
  line-height: 20px;
  color: rgb(113, 106, 91);
  text-decoration: underline;
}

/* Login with code */
p#login-with-code-title, p#send-code-title, p#login-with-link-title, p#passwordless-login-title {
  color: #002454;
  font-size: 24px;
  font-weight: 600;
  margin: 24px 0 16px 0;
}

p#login-with-code-description, p#send-code-description, p#login-with-link-description, p#passwordless-login-subtitle {
  margin: 16px 0;
  padding: 16px;
}

div.login-with-code-error {
  margin: 16px 0;
}

/* Authorize */
div#authorize-error {
  margin: 16px 0;
}

div#consent-scopes {
  padding: 8px 16px;
}

div#consent-scopes ul {
  padding-left: 16px;
  margin: 0;
}

div#consent-scopes li {
  color: #000000;
  margin: 8px 0;
}

button#allow-button {
  margin-top: 16px;
  margin-bottom:8px;
}

/* Error page */
#error-container {
  text-align: center;
  margin-top: 24px;
}

#error-title {
  color: #002454;
  font-size: 24px;
  font-weight: 600;
  margin: 24px 0 16px 0;
}

#error-image {
  width: 64px;
  display: block;
  margin: 0 auto;
}

#error-message {
  margin: 0 0 8px 0;
}

#error-request-id {
  margin: 0;
}

/* Aside element */
aside {
  width: 50%;
  height: 100%;
  display: flex;
  flex: 1;
  /* Align to the right side */
  right: 0;
  /* Align to the top */
  top: 0;
}

aside img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover ;
}

.password-input-wrapper {
  position: relative;
}

#eye-icon {
  position: absolute;
  top: 60%;
  right: 12px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  cursor: pointer;
  background-repeat: no-repeat;
  background-size: contain;
}

.eye-open {
  background-image: url('/static/general/eye-open.svg');
}

.eye-closed {
  background-image: url('/static/general/eye-closed.svg');
}

/* Media queries */
@media only screen and (max-width: 960px) {
  div#content-container {
    width: 100%;
  }

  aside {
    display: none;
  }
}

.passwordless-login-container {
  margin: 0 auto;

  /* Options */
  .option {
    display: block;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    cursor: pointer;

    input[type="radio"] {
      display: none;
    }

    /* Selected state */
    &.selected {
      border: 2px solid #2563eb;
      background: #f8fbff;
    }

    /* option content */
    .option-content {
      .option-text {
        h3 {
          margin: 0 0 4px 0;
          font-size: 16px;
        }

        p {
          margin: 0;
          font-size: 14px;
          color: #475569;
        }
      }
    }
  }
}

[x-cloak] { display: none !important; }
