@font-face {
  font-family: "Contracts Arabic";
  src: url("../fonts/NotoSansArabic-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Contracts Arabic";
  src: url("../fonts/NotoSansArabic-Bold.ttf") format("truetype");
  font-weight: 600 900;
  font-display: swap;
}
/* Contracts authentication theme. The form behavior belongs to Keycloak 26.7. */
:root {
  color-scheme: light;
  --contracts-green: #103f37;
  --contracts-green-dark: #0a2b26;
  --contracts-gold: #9a6b25;
  --contracts-ink: #17211f;
  --contracts-muted: #53615d;
  --contracts-border: #d6ddda;
  --pf-v5-global--primary-color--100: #103f37;
  --pf-v5-global--primary-color--200: #0a2b26;
  --pf-v5-global--link--Color: #165548;
  --pf-v5-global--link--Color--hover: #0a2b26;
  --pf-v5-global--Color--100: #17211f;
  --pf-v5-global--Color--200: #53615d;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
body#keycloak-bg {
  margin: 0;
  direction: rtl;
  color: var(--contracts-ink);
  background: #fbfcfb;
  font-family: "Contracts Arabic", Tahoma, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

.pf-v5-c-login {
  display: block;
  min-height: 100svh;
  padding: 0;
  background: none;
}
.pf-v5-c-login__container {
  display: grid;
  grid-template-columns: minmax(0, 42.5fr) minmax(0, 57.5fr);
  grid-template-areas: "header main";
  grid-template-rows: 1fr;
  padding: 0;
  width: 100%;
  max-width: none;
  min-height: 100svh;
  margin: 0;
  gap: 0;
}
#kc-header {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 64px 36px;
  margin: 0;
  border-inline-end: 4px solid #c49a3a;
  background: #06483e url("../img/auth-foliage.png") center / cover;
  color: #fff;
}
#kc-header-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 520px;
  margin: 0;
  gap: 24px;
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
}
.contracts-emblem {
  display: block;
  width: min(390px, 82%);
  mix-blend-mode: lighten;
  height: auto;
  aspect-ratio: 39 / 28;
  object-fit: cover;
}
.contracts-brand-name {
  margin: 0;
  color: #fff;
  font-size: clamp(28px, 3.3vw, 49px);
  font-weight: 800;
  line-height: 1.5;
}
.contracts-brand-tagline {
  margin: 0;
  color: #f0f5f3;
  font-size: clamp(17px, 1.8vw, 27px);
  line-height: 1.7;
}
.pf-v5-c-login__main {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 100svh;
  margin: 0;
  padding: 170px clamp(40px, 9.8vw, 146px) 100px;
  padding-inline-start: clamp(40px, 12.3vw, 183px);
  border: 0;
  background: #fbfcfb;
  box-shadow: none;
}
.pf-v5-c-login__main-header,
.pf-v5-c-login__main-body,
.pf-v5-c-login__main-footer {
  width: 100%;
  padding: 0;
  background: transparent;
}
.pf-v5-c-login__main-header { display: block; margin-bottom: 54px; border-top: 0; }
#kc-page-title {
  margin: 0;
  color: var(--contracts-green-dark);
  font-family: inherit;
  font-size: clamp(30px, 3.6vw, 54px);
  font-weight: 800;
  line-height: 1.5;
  text-align: right;
  overflow-wrap: anywhere;
}
.contracts-intro {
  margin: 14px 0 0;
  color: var(--contracts-muted);
  font-size: clamp(17px, 1.85vw, 27px);
  font-weight: 600;
  line-height: 1.8;
}
.contracts-environment {
  position: absolute;
  top: 40px;
  left: 36px;
  padding: 5px 16px;
  border-radius: 8px;
  background: #f4e7ce;
  color: #805a1f;
  font-size: 15px;
  font-weight: 700;
}
.contracts-skip-link {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 10;
  padding: 10px 18px;
  transform: translateY(-160%);
  background: #fff;
  color: var(--contracts-green);
}
.contracts-skip-link:focus { transform: translateY(0); }
.pf-v5-c-form { --pf-v5-c-form--GridGap: 28px; width: 100%; }
.pf-v5-c-form__group, .pf-v5-c-form__actions { min-width: 0; }
.pf-v5-c-form__group-label { padding-bottom: 10px; }
.pf-v5-c-form__label, .pf-v5-c-form__label-text {
  color: var(--contracts-ink);
  font-size: 20px;
  font-weight: 700;
}
.pf-v5-c-form-control {
  width: 100%;
  border-radius: 10px;
  background: transparent;
  --pf-v5-c-form-control--after--BorderBottomWidth: 0;
}
.pf-v5-c-form-control::before, .pf-v5-c-form-control::after { border: 0; }
.pf-v5-c-form-control input {
  width: 100%;
  min-width: 0;
  height: 58px;
  padding: 12px 16px;
  border: 1px solid #bac8c2;
  border-radius: 10px;
  background: #fff;
  color: var(--contracts-ink);
  font: inherit;
  direction: ltr;
  text-align: left;
}
.pf-v5-c-form-control input[name="userLabel"] { direction: rtl; text-align: right; }
.pf-v5-c-form-control input[readonly] { background: #edf3f0; }
.pf-v5-c-form-control input:hover { border-color: #1c6a5a; }
.pf-v5-c-form-control input:focus {
  border-color: #1c6a5a;
  outline: 3px solid #dcece7;
  outline-offset: 1px;
}
.pf-v5-c-form-control input[aria-invalid="true"] { border-color: #852b35; }
.pf-v5-c-input-group { display: flex; direction: rtl; gap: 0; }
.pf-v5-c-input-group__item { min-width: 0; }
.pf-v5-c-input-group__item.pf-m-fill { flex: 1; }
.pf-v5-c-input-group .pf-v5-c-form-control input {
  border-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.pf-v5-c-input-group .pf-m-control {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 1px solid #bac8c2;
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: #fff;
  color: var(--contracts-muted);
}
.pf-v5-c-input-group .pf-m-control::after { border: 0; }
.pf-v5-c-form__helper-text { margin-top: 12px; }
a { color: #165548; text-underline-offset: 4px; }
a:hover { color: #0a2b26; text-decoration: underline; }
.pf-v5-c-form__helper-text a { font-size: 20px; font-weight: 600; }
.pf-v5-c-button { font-family: inherit; line-height: 1.6; }
.pf-v5-c-button.pf-m-primary {
  width: 100%;
  min-height: 60px;
  padding: 14px 24px;
  border: 1px solid var(--contracts-green);
  border-radius: 10px;
  background: var(--contracts-green);
  color: #fff;
  font-size: 25px;
  font-weight: 700;
}
.pf-v5-c-button.pf-m-primary:hover { background: var(--contracts-green-dark); }
.pf-v5-c-button::after { border-radius: inherit; }
.pf-v5-c-button.pf-m-secondary {
  min-height: 48px;
  margin-top: 8px;
  border-radius: 10px;
  color: var(--contracts-green);
  white-space: normal;
}
:where(a, button, input[type="submit"], select):focus-visible {
  outline: 3px solid #9a6b25;
  outline-offset: 4px;
}
.contracts-home-link {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 64px;
  padding-top: 30px;
  border-top: 1px solid var(--contracts-border);
  color: var(--contracts-muted);
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
}
.pf-v5-c-alert {
  margin-bottom: 24px;
  border-radius: 10px;
  text-align: right;
  font-family: inherit;
}
.pf-v5-c-helper-text__item-text.pf-m-error { color: #852b35; }
.pf-v5-c-login__main-footer-band { margin: 20px 0 0; padding: 0; background: transparent; }
.pf-v5-c-check { gap: 10px; text-align: right; }
.pf-v5-c-check__input { width: 18px; height: 18px; margin-top: 5px; }

/* The QR and enrollment secret remain generated and submitted by Keycloak. */
body[data-page-id="login-login-config-totp"] .pf-v5-c-login__main,
body[data-page-id="login-login-update-password"] .pf-v5-c-login__main {
  padding-inline: clamp(32px, 6vw, 90px);
  padding-block: 110px 60px;
}
body[data-page-id="login-login-config-totp"] #kc-page-title,
body[data-page-id="login-login-update-password"] #kc-page-title { font-size: clamp(28px, 2.5vw, 38px); }
body[data-page-id="login-login-config-totp"] .pf-v5-c-login__main-header,
body[data-page-id="login-login-update-password"] .pf-v5-c-login__main-header { margin-bottom: 28px; }
#kc-totp-settings { margin: 0 0 28px; padding-inline: 24px 0; }
#kc-totp-settings > li { padding-inline-start: 6px; margin-bottom: 20px; }
#kc-totp-settings > li::marker { color: #9a6b25; font-weight: 700; }
#kc-totp-supported-apps { margin: 10px 0; padding-inline-start: 22px; }
#kc-totp-secret-qr-code {
  display: block;
  width: 200px;
  height: 200px;
  max-width: 100%;
  margin: 16px auto 12px;
  object-fit: contain;
  background: white;
}
#kc-totp-secret-key {
  display: block;
  padding: 12px;
  border: 1px solid var(--contracts-border);
  border-radius: 8px;
  direction: ltr;
  text-align: center;
  overflow-wrap: anywhere;
  font-family: monospace;
  background: #fff;
}
#kc-totp-settings-form, #kc-passwd-update-form { --pf-v5-c-form--GridGap: 20px; }
#kc-totp-settings-form .contracts-home-link { margin-top: 28px; }
#otp, #totp { direction: ltr; text-align: center; font-size: 24px; letter-spacing: 0.25em; }
#kc-otp-login-form .pf-v5-c-tile { margin-block: 10px; border-radius: 8px; }
#kc-info-message, #kc-error-message { overflow-wrap: anywhere; }

@media (max-width: 1000px) {
  .pf-v5-c-login__main { padding-inline: 40px; }
  #kc-header { padding-inline: 24px; }
  .contracts-brand-name { font-size: 28px; }
  .contracts-brand-tagline { font-size: 18px; }
}
@media (max-width: 760px) {
  .pf-v5-c-login__container { display: flex; flex-direction: column; }
  #kc-header { padding: 26px 24px; border-inline-end: 0; border-bottom: 3px solid #c49a3a; }
  #kc-header-wrapper { display: grid; grid-template-columns: 64px 1fr; column-gap: 16px; row-gap: 0; text-align: right; }
  .contracts-emblem { grid-row: 1 / 3; width: 64px; aspect-ratio: auto; }
  .contracts-brand-name { font-size: 21px; }
  .contracts-brand-tagline { font-size: 14px; }
  .pf-v5-c-login__main,
  body[data-page-id="login-login-config-totp"] .pf-v5-c-login__main,
  body[data-page-id="login-login-update-password"] .pf-v5-c-login__main {
    min-height: auto;
    flex: 1;
    justify-content: flex-start;
    padding: 38px 24px;
  }
  .contracts-environment { position: static; align-self: flex-end; margin-bottom: 24px; font-size: 13px; }
  .pf-v5-c-login__main-header { margin-bottom: 30px; }
  #kc-page-title { font-size: 32px; }
  .contracts-intro { font-size: 17px; }
  .pf-v5-c-form__label, .pf-v5-c-form__label-text { font-size: 16px; }
  .pf-v5-c-form__helper-text a, .contracts-home-link { font-size: 16px; }
  .pf-v5-c-button.pf-m-primary { font-size: 19px; }
  .contracts-home-link { margin-top: 36px; padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Override PatternFly's first/last-child spacing on the custom shell. */
#contracts-main > .pf-v5-c-login__main-header,
#contracts-main > .pf-v5-c-login__main-footer { padding: 0; }
#contracts-main > .contracts-environment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 16px;
}
.contracts-environment .fas { font-size: 10px; }
#kc-otp-login-form { margin-top: 24px; }
