/**
 * @file
 *
 * Styles
 */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

/*
 * MARK: General
 */


html {
  background-attachment: fixed;
  background-color: var(--background-color__body);
  background-image: var(--background-image__body);
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--color__body);
  font-family: 'Roboto', Arial, Helvetica, FreeSans, Sans-Serif !important;
  font-size: 10pt;
  height: 100%;
  margin: 0px;
  padding: 0px;
  width: 100%;
}

body {
  box-sizing: border-box;
  height: 100%;
  margin: 0px;
  padding: 0px;
  width: 100%;
}

a {
  color: var(--color__link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1 {
  box-sizing: border-box;
  margin: 0 0 0.5em 0;
  padding: 0;
  font-size: 200%;
  font-weight: bold;
}


/*
 * MARK: Layout
 */


/* Layout wrapper */
.layout__wrapper {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: top;
  height: 100%;
  padding: 1em;
  row-gap: var(--gap__item);
  width: 100%;
}
.layout__wrapper.layout--centered {
  justify-content: center;
}

/* Common layout for outer content  */
.layout__content {
  align-items: center;
  background-color: var(--background-color__content);
  border-radius: var(--border-radius__content);
  border-color: var(--border-color__content);
  border-style: solid;;
  border-width: 1px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--padding__wrapper);
  width: var(--width__content);
}


/* Common layout for inner content and target for loading class */
.layout__inner {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative; /* Relative because of loading indicator */
  row-gap: 1em;
  transition: opacity 0.5s ease-in-out;
  width: 100%;
}
.layout__inner:not(.loading) .platform-ui-loader { /* Loader when not loading */
  display: none;
}


/* Intro image */
.login__intro {
  align-items: center;
  box-sizing: border-box;
  display: flex;
  height: 100%;
  justify-content: center;
  width: 100%;
  margin: 1em 0;
}

.login__intro .login__intro--image { /* Login intro image */
  max-height: 150px;
  max-width: 325px;
}


/* Login */
.login__wrapper .links__wrapper { /* Links wrapper for forgot password link */
  align-items: right;
  display: flex;
  padding-top: 1em;
  justify-content: right;
  gap: 1em;
  width: 100%;
}


/* Lobby */
.lobby__wrapper .lobby__items { /* Lobby items */
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 1em;
  justify-content: center;
  width: 100%;
}
.lobby__wrapper .lobby__item { /* Lobby item */
  align-items: left;
  background-color: var(--background-color__button);
  border-radius: var(--border-radius__content);
  border-color: var(--border-color__button);
  border-width: var(--border-width__button);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 1em;
  justify-content: left;
  padding: var(--padding__item);
  position: relative; /* Relative position for autologin notification */
  width: 100%;
}
.lobby__wrapper .lobby__item--title { /* Lobby item title */
  font-size: 150%;
  font-weight: bold;
}
.lobby__wrapper .lobby__item.interactive {
  cursor: pointer;
}
.lobby__wrapper .lobby__item.interactive:hover {
  background-color: var(--background-color__button__hover);
}
.lobby__wrapper .lobby__item.disabled, .lobby__wrapper .lobby__item.interactive.disabled, .lobby__wrapper .lobby__item.interactive.disabled:hover {
  background-color: rgba(128, 128, 128, 0.5);
  cursor: not-allowed;
  opacity: 0.5;
}
.lobby__wrapper .lobby__item--content { /* Lobby item content wrapper */
  align-items: left;
  display: flex;
  flex-direction: column;
  gap: var(--gap__item);
  width: 100%;
}
.lobby__wrapper .lobby__item--content--item {
  display: flex;
  flex-direction: row;
  gap: var(--gap__item);
  justify-content: left;
  width: 100%;
}
.lobby__wrapper .lobby__item--content--label { /* Lobby item content label */
  font-weight: bold;
}

.lobby__wrapper .lobby__item--content--item.autologin { /* Autologin notification */
  font-size: 8pt;
  justify-content: right;
  opacity: 0.5;
  position: absolute;
  right: 10px;
  top: 10px;
}


.lobby__wrapper .lobby__actions { /* Lobby actions */
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 1em;
  padding-top: 1em;
  justify-content: center;
  width: 100%;
}


/* Footer */
.content__footer {
  align-items: center;
  display: flex;
  gap: 1em;
  justify-content: center;
  padding: 1em;
  white-space: nowrap;
}


/* Responsive layout */
@media (max-width: 500px) {
  .layout__content {
    width: 100%;
  }
  .layout__wrapper {
    justify-content: flex-start;
  }
  .buttons__wrapper {
    flex-direction: column;
    gap: 5px;
    height: auto;
    margin-top: 1em;
  }
}


/*
 * MARK: Forms
 */

.form__container label {
  display: block;
  padding: 0;
  margin: 0.75em 0 0.5em 0;
}

.form__container .field__prefix {
  padding-top: 1.1em;
}

.form__container .field__wrapper {
  padding-bottom: 1.1em; /* Leave some space for error messages */
  position: relative;
}

.form__container .field__wrapper.layout--checkbox { /* Checkbox layouts */
  display: flex;
  flex-direction: row;
  gap: 1em;
  vertical-align: middle;
}

.form__container input[type="email"], .form__container input[type="text"], .form__container input[type="password"], .form__container input[type="tel"] { /* Inputs */
  background-color: var(--background-color__input);
  border-color: var(--border-color__button);
  border-radius: var(--border-radius__content);
  border-style: solid;
  border-width: 1px;
  box-sizing: border-box;
  color: inherit;
  line-height: 1.5em;
  padding: 0.25em;
  width: 100%;
}

.form__container select { /* Selects */
  background-color: var(--background-color__input);
  border-color: var(--border-color__button);
  border-radius: var(--border-radius__content);
  border-style: solid;
  border-width: 1px;
  box-sizing: border-box;
  color: inherit;
  line-height: 1.5em;
  padding: 0.25em;
  width: 100%;
}
.form__container select option.form__option { /* Styling does not take any effect */
  background-color: white;
  color: black
}

.form__container input.error,
.form__container select.error {
  border-color: rgba(255, 52, 52, 0.8);
}

.form__container .field-error {
  color: rgba(255, 52, 52, 0.8);
  font-size: 8pt;
  margin-top: 0.25em;
}

/*
 * MARK: Buttons
 */

.buttons__wrapper {
  align-items: center;
  display: flex;
  gap: 5px;
  margin-top: 1.5em;
  text-align: center;
}
button, input[type="button"], input[type="submit"] {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: var(--border-color__button);
  border-radius: var(--border-radius__content);
  border-style: solid;
  border-width: var(--border-width__button);
  box-sizing: border-box;
  color: inherit;
  cursor: pointer;
  padding: 0.5em;
  transition: opacity 0.2s linear;
  width: 100%;
}
button:hover, input[type="button"]:hover {
  background-color: var(--background-color__button__hover);
}
button:disabled, input[type="button"]:disabled, input[type="submit"]:disabled {
  background-color: rgba(128, 128, 128, 0.5);
  cursor: not-allowed;
  opacity: 0.5;
}

input[type="submit"]:not(:disabled) { /* Submit button */
  background-color: rgba(0, 255, 0, 0.2);
}
input[type="submit"]:hover:not(:disabled) {
  background-color: rgba(0, 255, 0, 0.5);
}




/*
 * MARK: Components
 */


/* Loading indicator */
.platform-ui-loader {
  display: flex;
  flex-direction: row;
  gap: var(--gap__item);
  opacity: 0.5;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.platform-ui-loader .platform-ui-loader__inner { /* Inner loader element */
  animation: platform-ui-loader-spin 1.0s linear infinite;
  border: 0.2em solid currentColor;
  border-top: 0.2em solid transparent;
  border-radius: 50%;
  box-sizing: border-box;
  margin-left: -2em;
  margin-top: -2em;
  height: 4em;
  position: absolute;
  width: 4em;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2); /* Added drop shadow */
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.1)); /* Additional subtle glow */
}
@keyframes platform-ui-loader-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}


/* Theme select element to follow input field colors */
.lang__switcher {
  background-color: transparent;
  border-color: var(--border-color__content);
  border-radius: var(--border-radius__content);
  border-style: solid;
  border-width: 1px;
  box-sizing: border-box;
  color: inherit;
  padding: 0.5em;
  width: 100%;
}
.lang__switcher option {
  background-color: var(--background-color__body);
  color: inherit;
}


/*
 * MARK: Inline
 */


.platform-ui-message__inline, /* Support backend inline messages */
.inline { /* Inline messages */
  border: 1px solid rgba(128, 128, 128, 0.5);
  padding: 0.75em;
  border-radius: 5px;
}


/*
 * MARK: Responses
 */

.responses {
  box-sizing: border-box;
  position: fixed;
  display: flex;
  gap: 1em;
  flex-direction: column;
  text-align: left;
  bottom: 1em;
  right: 1em;
  width: 250px;
}

.responses .responses__item {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  position: relative; /* Required for close button */
  width: 100%;
}

.responses .responses__content {
  box-sizing: border-box;
  padding: 1em;
}

.responses .responses__close { /* Close button */
  align-items: center;
  border-radius: 50%;
  box-sizing: border-box;
  font-weight: bold;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1em;
  color: white;
  cursor: pointer;
  display: flex;
  height: 1.5em;
  justify-content: center;
  opacity: 0.5;
  position: absolute;
  right: 0;
  top: 0;
  width: 1.5em;
}
.responses .responses__close:hover {
  opacity: 1;
}



/* Errors */
.severity-error,
.error {
  background-color: rgba(255, 0, 0, 0.5);
}

/* Success */
.severity-success,
.success {
  background-color: rgba(0, 255, 0, 0.5);
}

/* Info */
.severity-info,
.info {
  background-color: rgba(128, 128, 128, 0.5);
  border-color: rgba(128, 128, 128, 0.75);
}

/* Animations */
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}


/*
 * MARK: Platform UI support
 */

 /* Flex field section layout */
.platform-ui-field__section--layout-flex {
  display: flex;
  flex-direction: row;
  gap: 1em;
  margin: 0px;
  padding: 0px;
}

/* Header */
.platform-ui-header {
  border-bottom: 1px solid var(--border-color__header);
  margin: 1.5em 0 0.5em 0;
  padding: 0 0 0.25em 0;
}
