@import url('../fonts/sourcesans/SourceSans.ttf');

:root {
  --valo-success: #1e7b34;
  --valo-danger: #c9190b;
}

.kcHeaderWrapperClass {
  /* NOTE: We would use `body {` if we'd like the font to be applied to everything. */
  font-family: "Playwrite NL", cursive;
}

.pf-v5-c-login__container {
  grid-template-columns: 34rem;
  grid-template-areas: "header"
    "main"
}

.login-pf body {
  background: var(--keycloak-bg-logo-url) no-repeat center center fixed;
  background-size: cover;
}

div.kc-logo-text {
  background-image: var(--keycloak-logo-url);
  height: var(--keycloak-logo-height);
  width: var(--keycloak-logo-width);
  background-repeat: no-repeat;
  background-size: contain;
  margin: 0 auto;
}

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

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

.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;
}

#kc-recovery-codes-list {
  columns: 2;
}

#certificate_subjectDN {
  overflow-wrap: break-word
}

#kc-header-wrapper {
  font-size: 29px;
  text-transform: uppercase;
  letter-spacing: 3px;
  line-height: 1.2em;
  white-space: normal;
  color: var(--pf-v5-global--Color--light-100);
  text-align: center;
}

hr {
  margin-top: var(--pf-v5-global--spacer--sm);
  margin-bottom: var(--pf-v5-global--spacer--md);
}

@media (min-width: 768px) {
  div.pf-v5-c-login__main-header {
    grid-template-columns: 100%;
    padding: 0 140px 24px 140px;
    text-align: center;
  }
}


/* custom styles */

.login-pf body {
  height: auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: SourceSans,Arial,Helvetica,sans-serif;
}

.login-container {
  display: flex;
  flex: 1;
}

.pf-v5-c-login__main {
  margin-top: auto;
  margin-bottom: auto;
  width: 100%;
  padding: 3.5rem 2.5rem;
  --tw-bg-opacity: 1;
  background-color: rgb(255 255 255 / 1);
  border-radius: 1rem;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

#kc-header-wrapper {
  margin-bottom: 2rem;
  margin-left: 3rem;
  margin-right: 3rem;
}

#kc-header-wrapper img {
  max-height: 9rem;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
}

#kc-page-title {
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 2rem;
  text-align: center;
  margin-bottom: 1rem;
}

#kc-content {
  display: flex;
  flex-direction: column;
}

.pf-v5-c-form__group {
  padding: 8px;
  width: 100%;
  margin-bottom: 1.2rem;
}

.pf-v5-c-form__group:has(.pf-v5-c-form-control) {
  border-bottom: 1px solid black;
}

.pf-v5-c-form__group:has(.pf-v5-c-form-control):focus-within {
  border-bottom-color: #FE7342;
}

.pf-v5-c-form__group label {
  color: #00000099;
  font-size: 11px;
}

.pf-v5-c-form__group:has(.pf-v5-c-form-control):focus-within label {
  color: #FE7342;
}

.pf-v5-c-form__group input {
  border: none #e8f0fe;
  outline-width: 0;
}

:is(#kc-passwd-update-form, #kc-totp-settings-form) .pf-v5-c-form-control::before,
:is(#kc-passwd-update-form, #kc-totp-settings-form) .pf-v5-c-form-control::after {
  border: none;
}

#kc-passwd-update-form {
  gap: 0;
}

#kc-passwd-update-form .pf-v5-c-form__label-text {
  font-weight: normal;
}

#kc-password-rules {
  margin: 0 8px 1.2rem;
  font-size: 13px;
  color: #00000099;
}

#kc-password-rules ul {
  margin: 0.25rem 0 0;
  padding-left: 0;
  list-style: none;
  line-height: 1.4;
}

#kc-password-rules li {
  position: relative;
  padding-left: 1.25rem;
}

#kc-password-rules li::before {
  content: "•";
  position: absolute;
  left: 0.3rem;
}

#kc-password-rules li[data-valid],
.kc-password-feedback[data-valid] {
  color: var(--valo-success);
}

#kc-password-rules li[data-valid]::before {
  content: "✓";
  left: 0.15rem;
  font-weight: 700;
}

.kc-password-feedback {
  margin: -0.8rem 8px 1.2rem;
  font-size: 13px;
  color: var(--valo-danger);
}

.kc-password-feedback:empty {
  display: none;
}

#kc-caps-lock {
  color: #000000cc;
}

#kc-caps-lock::before {
  content: "⇪ ";
}

#kc-password-devices-hint,
#kc-access-suspended-message {
  margin: 0 8px 1.2rem;
  padding: 0.625rem 0.75rem;
  border-left: 3px solid #FE7342;
  border-radius: 0 0.5rem 0.5rem 0;
  background-color: #fff4ef;
  font-size: 13px;
  line-height: 1.4;
  color: #000000cc;
}

#kc-error-reset-password {
  display: inline-block;
  padding: 0.25rem 0;
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

.pf-v5-c-button.pf-m-control {
  color: #00000099;
  background: none;
}

.pf-v5-c-button.pf-m-control::after {
  border: none;
}

.pf-v5-c-form__group:has(> #kc-form-options) {
  display: flex;
  justify-content: space-between;
}

#kc-form-login a{
  color: black;
  font-size: 14px;
  text-decoration: underline;
}

#kc-form-options .checkbox label {
  display: flex;
  align-items: center;
  flex-direction: row;
  color: black;
  font-size: 14px;
}

#kc-form-options .checkbox input{
  margin-right: 10px;
}

.pf-v5-c-button.pf-m-block {
  background: #fe7443;
  border-radius: 9999px;
  height: 3rem;
  font-size: 14px;
  text-transform: uppercase;
  font-weight: 700;
  cursor: pointer;
}

.pf-v5-c-button:disabled {
  color: #fff;
}

/* A link styled as a block button (login-access-suspended.ftl): centred like the <button> ones */
#kc-access-suspended-restart {
  display: flex;
  align-items: center;
  justify-content: center;
}

#kc-registration {
  text-align: center;
  font-size: 13px;
}

#kc-registration a{
  text-decoration: underline;
  color: #000;
}

#kc-login-footer-links footer {
  display: flex;
  height: 73px;
  max-height: 73px;
  align-items: center;
  background-color: #f2f2f9;
  border-top: 1px solid #b8b8c9;
  font-size: 16px;
}

#kc-login-footer-links footer .logo {
    display: flex;
    margin-left: 80px;
    height: 100%;
    max-width: 160px;
    align-items: center;
}

#kc-login-footer-links footer .logo img {
  width: 100% !important;
}

#kc-login-footer-links footer .separator {
  width: 48px;
  display: flex;
  flex-flow: column;
  align-items: center;
}

#kc-login-footer-links footer .vertical-line {
  width: 1px;
  height: 21px;
  background-color: #b8b8c9;
}

.copyright {
  font-size: 15px;
  align-items: center;
  color: #000;
}

.menu {
  display: flex;
  align-items: center;
  position: absolute;
  right: 80px;
}

.menu-item {
  padding: 8px;
  border-radius: .375rem;
}

.menu-item a {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

/* Config totp */

body[data-page-id="login-login-config-totp"] .pf-v5-c-login__main{
  max-width: 60rem;
}

body[data-page-id="login-login-config-totp"] .pf-v5-c-alert {
  display: none;
}

body[data-page-id="login-login-config-totp"] #kc-content-wrapper {
  display: flex;
  gap: 20px;
}

body[data-page-id="login-login-config-totp"] #kc-page-title {
  margin-bottom: 20px;
}

body[data-page-id="login-login-config-totp"] #kc-totp-settings-form {
  padding-top: 10px;
}

#kc-totp-settings.pf-v5-c-list {
  font-size: 12px;
}

#kc-totp-settings img {
  max-width: 60%;
  margin-left: 35px;
}

#kc-totp-settings-form input:focus-visible {
  outline: none !important;
}

#kc-totp-settings-form input:focus {
  outline: none !important;
}

body[data-page-id="login-login-config-totp"] .pf-v5-c-form-control>:is(input,select,textarea) {
    background-color: #e8f0fe;
}

body[data-page-id="login-login-config-totp"] div.pf-v5-c-form__label {
  margin-bottom: 5px;
}

/* Login totp */

body[data-page-id="login-login-otp"] .pf-v5-c-form-control:before {
  border: none;
}

body[data-page-id="login-login-otp"] input:focus-visible {
  outline: none !important;
}

body[data-page-id="login-login-otp"] input:focus {
  outline: none !important;
}


body[data-page-id="login-login-otp"] #kc-attempted-username {
  font-size: 15px;
  border: 1px solid #c9d1db;
  padding: 9px;
  margin: 0;
  border-radius: 15px;
}

body[data-page-id="login-login-otp"] .pf-v5-c-form-control>:is(input,select,textarea) {
    background-color: #e8f0fe;
}

body[data-page-id="login-login-otp"] .pf-v5-c-tile:before {
    border-radius: 10px 10px 0 0;
}

body[data-page-id="login-login-otp"] .pf-v5-c-form__group {
  display: flex;
  flex-direction: column;
  border-bottom: none;
  margin-bottom: 0.5rem;
}

body[data-page-id="login-login-otp"] #kc-username {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

body[data-page-id="login-login-otp"] .kc-otp-custom-message {
  margin-bottom: 5px;
  border: 1px solid #c9d1db;
  border-radius: 10px;
  padding: 12px;
  background-color: #f8fbff;
}

body[data-page-id="login-login-otp"] .kc-otp-custom-message__line {
  margin: 6px 0 0;
  line-height: 1.45;
  color: #1f2937;
  font-size: 14px;
}

body[data-page-id="login-login-otp"] .pf-v5-c-form {
  gap: 0.4rem;
}

body[data-page-id="login-login-otp"] #kc-otp-login-form > div.pf-v5-c-form__group {
  padding: 8px 0 0 0;
}

body[data-page-id="login-login-otp"] #kc-otp-login-form > div.pf-v5-c-form__group > div {
    overflow-x: auto;
    display: flex;
    padding: 10px 0;
    gap: 5px;
}

body[data-page-id="login-login-otp"] .pf-v5-c-tile {
  padding: 1rem 0.75rem 0.75rem 0.75rem;
  font-size: 12px;
}

body[data-page-id="login-login-otp"] #kc-username .kc-login-tooltip {
  font-size: 18px;
}

@media (max-width: 767px) {
  .pf-v5-c-login__container {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-container {
    flex-direction: column;
    min-height: 0;
  }

  .pf-v5-c-login__main {
    width: min(94vw, 34rem);
    max-width: 34rem;
    margin: 0.75rem auto 1.25rem;
    padding: 2rem 1.5rem;
    border-radius: 0.75rem;
  }

  #kc-header-wrapper {
    margin-left: 1rem;
    margin-right: 1rem;
    margin-bottom: 1.25rem;
  }

  #kc-page-title {
    font-size: 1.25rem;
    line-height: 1.6rem;
  }

  .pf-v5-c-form__group:has(> #kc-form-options) {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  #kc-form-options .checkbox label {
    font-size: 13px;
  }

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

  #kc-login-footer-links footer {
    height: auto;
    max-height: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1rem;
    padding: 0.75rem 1rem;
    text-align: center;
  }

  #kc-login-footer-links footer .logo {
    margin-left: 0;
    height: auto;
    max-width: 130px;
  }

  #kc-login-footer-links footer .separator {
    display: none;
  }

  .menu {
    position: static;
    right: auto;
    justify-content: center;
    width: 100%;
  }

  .menu-item {
    padding: 6px;
  }

  .copyright {
    width: 100%;
    font-size: 14px;
  }

  body[data-page-id="login-login-config-totp"] .pf-v5-c-login__main {
    width: min(94vw, 60rem);
    max-width: 60rem;
  }

  body[data-page-id="login-login-config-totp"] #kc-content-wrapper {
    flex-direction: column;
    gap: 1rem;
  }

  #kc-totp-settings img {
    display: block;
    max-width: 100%;
    margin: 0.5rem auto 0;
  }

  body[data-page-id="login-login-otp"] #kc-username {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  body[data-page-id="login-login-otp"] #kc-attempted-username {
    width: 100%;
    box-sizing: border-box;
  }

  body[data-page-id="login-login-otp"] #kc-otp-login-form > div.pf-v5-c-form__group > div {
    gap: 0.4rem;
  }
}

@media (min-width: 768px) and (max-height: 800px) {
  .pf-v5-c-login__main {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  #kc-header-wrapper {
    margin-bottom: 1rem;
  }

  #kc-header-wrapper img {
    max-height: 6.5rem;
  }
}

@media (max-width: 380px) {
  .pf-v5-c-login__main {
    width: calc(100% - 1rem);
    padding: 1.5rem 1rem;
  }
}
