/* Patternfly CSS places a "bg-login.jpg" as the background on this ".login-pf" class.
   This clashes with the "keycloak-bg.png' background defined on the body below.
   Therefore the Patternfly background must be set to none. */
.login-pf {
  background: none;
}

.login-pf body {
  background: url("../img/login-background.webp?v=3");
  background-size: cover;
  height: 100%;
  z-index: -1;
  display: flex;
  justify-content: center;
  align-items: center;
}

textarea.pf-c-form-control {
  height: auto;
}

.pf-c-alert__title {
  font-size: var(--pf-global--FontSize--xs);
}

p.instruction {
  margin: 5px 0;
}

.pf-c-button.pf-m-control {
  border-color: rgba(230, 230, 230, 0.5);
}

h1#kc-page-title {
  margin-top: 10px;
}

#kc-locale ul {
  background-color: var(--pf-global--BackgroundColor--100);
  display: none;
  top: 20px;
  min-width: 100px;
  padding: 0;
}

#kc-locale-dropdown {
  display: inline-block;
}

#kc-locale-dropdown:hover ul {
  display: block;
}

#kc-locale-dropdown a {
  color: var(--pf-global--Color--200);
  text-align: right;
  font-size: var(--pf-global--FontSize--sm);
}

#kc-locale-dropdown button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #212121;
  text-align: right;
  font-size: 0.8rem;
}

/* Chevron from the design, drawn in the text colour */
button#kc-current-locale-link::after {
  content: "";
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin-left: 0.4rem;
  vertical-align: -0.05rem;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.login-pf .container {
  padding-top: 40px;
}

.login-pf a:hover {
  color: #0099d3;
}

#kc-logo {
  width: 100%;
}

div.kc-logo-text {
  background-image: url(../img/keycloak-logo-text.png);
  background-repeat: no-repeat;
  height: 63px;
  width: 300px;
  margin: 0 auto;
}

div.kc-logo-text span {
  display: none;
}

#kc-header {
  color: #ededed;
  overflow: visible;
  white-space: nowrap;
}

#kc-header-wrapper {
  font-size: 29px;
  text-transform: uppercase;
  letter-spacing: 3px;
  line-height: 1.2em;
  padding: 62px 10px 20px;
  white-space: normal;
}

#kc-content {
  width: 100%;
}

#kc-attempted-username {
  font-size: 20px;
  font-family: inherit;
  font-weight: normal;
  padding-right: 10px;
}

#kc-username {
  text-align: center;
  margin-bottom: -10px;
}

#kc-webauthn-settings-form {
  padding-top: 8px;
}

#kc-form-webauthn .select-auth-box-parent {
  pointer-events: none;
}

#kc-form-webauthn .select-auth-box-desc {
  color: var(--pf-global--palette--black-600);
}

#kc-form-webauthn .select-auth-box-headline {
  color: var(--pf-global--Color--300);
}

#kc-form-webauthn .select-auth-box-icon {
  flex: 0 0 3em;
}

#kc-form-webauthn .select-auth-box-icon-properties {
  margin-top: 10px;
  font-size: 1.8em;
}

#kc-form-webauthn .select-auth-box-icon-properties.unknown-transport-class {
  margin-top: 3px;
}

#kc-form-webauthn .pf-l-stack__item {
  margin: -1px 0;
}

#kc-content-wrapper {
  margin-top: 20px;
}

#kc-form-wrapper {
  margin-top: 10px;
}

/* Runs to the card edges: cancels the #kc-content side and bottom padding */
#kc-info {
  margin: 20px -60px -42px;
}

#kc-info-wrapper {
  font-size: 13px;
  padding: 15px 60px;
  background-color: #f0f0f0;
}

#kc-form-options span {
  display: block;
}

#kc-form-options .checkbox {
  margin-top: 0;
  color: #72767b;
}

#kc-terms-text {
  margin-bottom: 20px;
}

#kc-registration-terms-text {
  max-height: 100px;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 5px;
}

#kc-registration {
  margin-bottom: 0;
}

/* TOTP */

.subtitle {
  text-align: right;
  margin-top: 30px;
  color: #909090;
}

.required {
  color: var(--pf-global--danger-color--200);
}

ol#kc-totp-settings {
  margin: 0;
  padding-left: 20px;
}

ul#kc-totp-supported-apps {
  margin-bottom: 10px;
}

#kc-totp-secret-qr-code {
  max-width: 150px;
  max-height: 150px;
}

#kc-totp-secret-key {
  background-color: #fff;
  color: #333333;
  font-size: 16px;
  padding: 10px 0;
}

/* OAuth */

#kc-oauth h3 {
  margin-top: 0;
}

#kc-oauth ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#kc-oauth ul li {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  padding: 10px 0;
}

#kc-oauth ul li:first-of-type {
  border-top: 0;
}

#kc-oauth .kc-role {
  display: inline-block;
  width: 50%;
}

/* Code */
#kc-code textarea {
  width: 100%;
  height: 8em;
}

/* Social */
.kc-social-links {
  margin-top: 20px;
}

.kc-social-links li {
  width: 100%;
}

.kc-social-provider-logo {
  font-size: 23px;
  width: 30px;
  height: 25px;
  float: center;
}

.kc-social-gray {
  color: var(--pf-global--Color--200);
}

.kc-social-gray h2 {
  font-size: 1em;
}

.kc-social-item {
  margin-bottom: var(--pf-global--spacer--sm);
  font-size: 15px;
  text-align: center;
}

.kc-social-provider-name {
  position: relative;
}

.kc-social-icon-text {
  left: -15px;
}

.kc-social-grid {
  display: grid;
  grid-column-gap: 10px;
  grid-row-gap: 5px;
  grid-column-end: span 6;
  --pf-l-grid__item--GridColumnEnd: span 6;
}

.kc-social-grid .kc-social-icon-text {
  left: -10px;
}

.kc-login-tooltip {
  position: relative;
  display: inline-block;
}

.kc-social-section {
  text-align: center;
}

.kc-social-section hr {
  margin-bottom: 10px;
}

.kc-login-tooltip .kc-tooltip-text {
  top: -3px;
  left: 160%;
  background-color: black;
  visibility: hidden;
  color: #fff;

  min-width: 130px;
  text-align: center;
  border-radius: 2px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  padding: 5px;

  position: absolute;
  opacity: 0;
  transition: opacity 0.5s;
}

/* Show tooltip */
.kc-login-tooltip:hover .kc-tooltip-text {
  visibility: visible;
  opacity: 0.7;
}

/* Arrow for tooltip */
.kc-login-tooltip .kc-tooltip-text::after {
  content: " ";
  position: absolute;
  top: 15px;
  right: 100%;
  margin-top: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent black transparent transparent;
}

@media (min-width: 768px) {
  #kc-container-wrapper {
    position: absolute;
    width: 100%;
  }

  .login-pf .container {
    padding-right: 80px;
  }

  #kc-locale {
    position: relative;
    text-align: right;
    z-index: 9999;
  }
}

@media (max-width: 767px) {
  .login-pf body {
    background: white;
  }

  #kc-header {
    padding-left: 15px;
    padding-right: 15px;
    float: none;
    text-align: left;
  }

  #kc-header-wrapper {
    font-size: 16px;
    font-weight: bold;
    padding: 20px 60px 0 0;
    color: #72767b;
    letter-spacing: 0;
  }

  div.kc-logo-text {
    margin: 0;
    width: 150px;
    height: 32px;
    background-size: 100%;
  }

  #kc-form {
    float: none;
  }

  #kc-info-wrapper {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: transparent;
  }

  .login-pf .container {
    padding-top: 15px;
    padding-bottom: 15px;
  }

  #kc-locale {
    position: relative;
    text-align: right;
    z-index: 9999;
  }
}

@media (min-height: 646px) {
  #kc-container-wrapper {
    bottom: 12%;
  }
}

@media (max-height: 645px) {
  #kc-container-wrapper {
    padding-top: 50px;
    top: 20%;
  }
}

.card-pf form.form-actions .btn {
  float: right;
  margin-left: 10px;
}

#kc-form-buttons {
  margin-top: 20px;
}

.select-auth-box-arrow {
  display: flex;
  align-items: center;
  margin-right: 2rem;
}

.select-auth-box-icon {
  display: flex;
  flex: 0 0 2em;
  justify-content: center;
  margin-right: 1rem;
  margin-left: 3rem;
}

.select-auth-box-parent {
  border-top: 1px solid var(--pf-global--palette--black-200);
  padding-top: 1rem;
  padding-bottom: 1rem;
  cursor: pointer;
  text-align: left;
  align-items: unset;
  background-color: unset;
  border-right: unset;
  border-bottom: unset;
  border-left: unset;
}

.select-auth-box-parent:hover {
  background-color: #f7f8f8;
}

.select-auth-container {
  padding-bottom: 0px !important;
}

.select-auth-box-headline {
  font-size: var(--pf-global--FontSize--md);
  color: var(--pf-global--primary-color--100);
  font-weight: bold;
}

.select-auth-box-desc {
  font-size: var(--pf-global--FontSize--sm);
}

.select-auth-box-paragraph {
  text-align: center;
  font-size: var(--pf-global--FontSize--md);
  margin-bottom: 5px;
}

/* The brand tab and the grey form section sit flush with the card edges,
   so the card has no padding of its own and its sections pad themselves. */
.login-pf-page .card-pf {
  margin: 0 auto;
  box-shadow: var(--pf-global--BoxShadow--lg);
  padding: 0;
  max-width: 500px;
  width: 500px;
  /* PatternFly 3 gives .card-pf a transparent top border - it shows as a white line above the brand tab */
  border-top: 0;
  border-radius: 18px;
  overflow: hidden;
}

/*phone*/
@media (max-width: 767px) {
  .login-pf-page .card-pf {
    max-width: none;
    width: auto;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    padding-top: 0;
    border-top: 0;
    box-shadow: 0 0;
  }

  .kc-social-grid {
    grid-column-end: 12;
    --pf-l-grid__item--GridColumnEnd: span 12;
  }

  .kc-social-grid .kc-social-icon-text {
    left: -15px;
  }
}

.login-pf-page .login-pf-signup {
  font-size: 15px;
  color: #72767b;
}
#kc-content-wrapper .row {
  margin-left: 0;
  margin-right: 0;
}

.login-pf-page.login-pf-page-accounts {
  margin-left: auto;
  margin-right: auto;
}

.login-pf-page .btn-primary {
  margin-top: 0;
}

.login-pf-page .list-view-pf .list-group-item {
  border-bottom: 1px solid #ededed;
}

.login-pf-page .list-view-pf-description {
  width: 100%;
}

#kc-form-login div.form-group:last-of-type,
#kc-register-form div.form-group:last-of-type,
#kc-update-profile-form div.form-group:last-of-type,
#kc-update-email-form div.form-group:last-of-type {
  margin-bottom: 0px;
}

.no-bottom-margin {
  margin-bottom: 0;
}

#kc-back {
  margin-top: 5px;
}

/* Recovery codes */
.kc-recovery-codes-warning {
  margin-bottom: 32px;
}
.kc-recovery-codes-warning .pf-c-alert__description p {
  font-size: 0.875rem;
}
.kc-recovery-codes-list {
  list-style: none;
  columns: 2;
  margin: 16px 0;
  padding: 16px 16px 8px 16px;
  border: 1px solid #d2d2d2;
}
.kc-recovery-codes-list li {
  margin-bottom: 8px;
  font-size: 11px;
}
.kc-recovery-codes-list li span {
  color: #6a6e73;
  width: 16px;
  text-align: right;
  display: inline-block;
  margin-right: 1px;
}

.kc-recovery-codes-actions {
  margin-bottom: 24px;
}
.kc-recovery-codes-actions button {
  padding-left: 0;
}
.kc-recovery-codes-actions button i {
  margin-right: 8px;
}

.kc-recovery-codes-confirmation {
  align-items: baseline;
  margin-bottom: 16px;
}

#certificate_subjectDN {
  overflow-wrap: break-word;
}
/* End Recovery codes */

/* Own css */

body {
  height: 100%;
  position: relative;
  z-index: 0;
}

/* Consolia login card */

/* Roboto, as in the design and the application (copied from AppTrend.Lupus.Web/wwwroot/fonts) */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Roboto-Regular.ttf?v=3") format("truetype");
}

:root {
  --pf-global--FontFamily--sans-serif: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --pf-global--FontFamily--heading--sans-serif: "Roboto", "Helvetica Neue", Arial, sans-serif;
}

.login-pf body,
.login-pf body h1,
.login-pf body input,
.login-pf body button {
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
}

.consolia-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.consolia-brand-tab {
  display: block;
  height: 28px;
  width: auto;
}

.consolia-card-top #kc-locale {
  padding: 0.5px 26px 0 0;
}

.login-pf-page .login-pf-header > :not(.consolia-card-top),
#kc-content {
  padding-left: 60px;
  padding-right: 60px;
}

#kc-content {
  padding-bottom: 42px;
}

.login-pf-page .login-pf-header h1#kc-page-title {
  margin-top: 1.5rem;
  margin-bottom: 0;
  font-size: 1.75rem;
  font-weight: 400;
  color: #000;
}

/* Login page measurements from the Figma design (px at 100%); other pages sharing
   the template keep the default PatternFly spacing. */
[data-page-id="login-login"] .login-pf-page .login-pf-header {
  margin-bottom: 0;
}

[data-page-id="login-login"] .login-pf-page .login-pf-header h1#kc-page-title {
  margin-top: 29px;
  font-size: 32px;
  line-height: 1.2;
}

[data-page-id="login-login"] #kc-content-wrapper {
  margin-top: 0;
}

[data-page-id="login-login"] #kc-form-wrapper {
  margin-top: 58px;
}

.consolia-button {
  display: block;
  width: 100%;
  height: 39px;
  padding: 0 16px;
  border: 1px solid #274ba5;
  border-radius: 6px;
  font-size: 16px;
  line-height: 37px;
  text-align: center;
  cursor: pointer;
}

.consolia-button--primary {
  background-color: #274ba5;
  color: #fff;
}

/* Keeps the generic ".login-pf a:hover" link colour off the button text */
.login-pf a.consolia-button--primary:hover,
.login-pf a.consolia-button--primary:focus {
  color: #fff;
  text-decoration: none;
}

.consolia-button--primary:hover {
  background-color: #1f3c85;
}

.consolia-button--outline {
  background-color: transparent;
  color: #274ba5;
}

.consolia-button--outline:hover {
  background-color: rgba(39, 75, 165, 0.08);
}

.consolia-button.pf-m-aria-disabled,
.consolia-button:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.consolia-sso {
  margin-top: 38px;
}

.consolia-sso-hint {
  display: flex;
  gap: 7px;
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 16px;
}

.consolia-sso-hint-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-top: 1px;
}

/* With Entra the password form is secondary and sits in a grey section
   running to the card edges, so it cancels the #kc-content padding. */
[data-page-id="login-login"] #kc-form-wrapper.consolia-password-section {
  margin: 36px -60px -42px;
  padding: 19px 60px 42px;
  background-color: #e5e5e5;
}

#kc-form-login {
  font-size: 14px;
}

#kc-form-login .form-group {
  margin-bottom: 13.5px;
}

#kc-form-login label {
  display: block;
  margin-bottom: 2.5px;
  font-size: 14px;
  line-height: 1.1;
  font-weight: 400;
  color: #212121;
}

#kc-form-login .pf-c-form-control {
  height: 39px;
  padding: 0 15px;
  border: 1px solid #d2d2d2;
  border-radius: 8px;
  background-color: #fff;
  font-size: 14px;
}

/* The password field sits in PatternFly's input group, whose white square background
   showed around the field's rounded corners on the grey section */
#kc-form-login .pf-c-input-group {
  background-color: transparent;
}

#kc-form-login .login-pf-settings {
  margin-bottom: 0;
}

.consolia-remember-me {
  margin: 0;
}

#kc-form-login .consolia-remember-me label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  cursor: pointer;
  line-height: 1;
}

.consolia-remember-me input {
  width: 19px;
  height: 19px;
  margin: 0;
  cursor: pointer;
  accent-color: #274ba5;
}

#kc-form-login #kc-form-buttons {
  margin-top: 28px;
  margin-bottom: 0;
}

.consolia-forgot-password {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  font-size: 14px;
  line-height: 1.2;
}

/* Messages (error, success, warning, info) in the colours of the application's own
   notifications (AppTrend.Lupus.Web app.scss --danger-*, --success-*, --info-*, --warning-*)
   instead of the PatternFly 4 reds. Success and warning text are a shade darker than the
   app tokens to keep 4.5:1 contrast for 14px text. */
.login-pf-page .pf-c-alert {
  --consolia-alert-color: #cc0e47;
  --consolia-alert-background: #fcf1f7;
  --consolia-alert-border: #f4dee9;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--consolia-alert-border);
  border-radius: 6px;
  background-color: var(--consolia-alert-background);
  box-shadow: none;
  --pf-c-alert__icon--Color: var(--consolia-alert-color);
  --pf-c-alert__title--Color: var(--consolia-alert-color);
}

.login-pf-page .pf-c-alert.alert-success {
  --consolia-alert-color: #008043;
  --consolia-alert-background: #eef7f4;
  --consolia-alert-border: #c3e3d7;
}

.login-pf-page .pf-c-alert.alert-info {
  --consolia-alert-color: #1076ae;
  --consolia-alert-background: #eefbff;
  --consolia-alert-border: #c7e5f8;
}

.login-pf-page .pf-c-alert.alert-warning {
  --consolia-alert-color: #986809;
  --consolia-alert-background: #fff9ef;
  --consolia-alert-border: #f6e7cb;
}

.login-pf-page .pf-c-alert .pf-c-alert__icon {
  margin-top: 0;
  font-size: 16px;
}

.login-pf-page .pf-c-alert .pf-c-alert__title {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
}

/* Field errors in the same red (a shade darker for contrast on the grey section) */
.login-pf-page .pf-c-form__helper-text.pf-m-error {
  color: #c70d45;
}

#kc-form-login .pf-c-form-control[aria-invalid="true"] {
  border-color: #cc0e47;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%23cc0e47'/%3E%3Cpath d='M8 4.2v4.6' stroke='white' stroke-width='1.8' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11.7' r='1' fill='white'/%3E%3C/svg%3E");
}

/* Login page: the message sits between the title and the form */
[data-page-id="login-login"] #kc-content-wrapper > .pf-c-alert {
  margin-top: 16px;
}

[data-page-id="login-login"] .pf-c-alert + #kc-form .consolia-sso,
[data-page-id="login-login"] .pf-c-alert + #kc-form #kc-form-wrapper:not(.consolia-password-section) {
  margin-top: 24px;
}

/* Phone: the design is desktop-only; 60px side padding would leave narrow fields */
@media (max-width: 767px) {
  .login-pf-page .login-pf-header > :not(.consolia-card-top),
  #kc-content {
    padding-left: 24px;
    padding-right: 24px;
  }

  #kc-info {
    margin-left: -24px;
    margin-right: -24px;
  }

  #kc-info-wrapper {
    padding-left: 24px;
    padding-right: 24px;
  }

  [data-page-id="login-login"] #kc-form-wrapper.consolia-password-section {
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 24px;
    padding-right: 24px;
  }
}
