/* =========================================================
   ΔΑΣΟΣ — forest
   Nature-inspired, light and organic: warm paper-white
   page, deep pine-green ink, a moss-green action and a
   quiet bark-brown secondary. Soft, botanical, unhurried.
   Palette:
     paper    #f4f2ea
     card     #fbfaf5
     pine     #1f3a2b
     moss     #4a7c4e
     moss-hi  #5c9560
     bark     #6b5844
     stone    #7a8578
========================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }

body {
  min-height: 100%;
  margin: 0;
  font-family: "Segoe UI", -apple-system, "Helvetica Neue", system-ui, sans-serif;
  background-color: #f4f2ea;
  color: #1f3a2b;
}

/* soft canopy light — two warm pools, no image */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(700px 500px at 20% 0%, rgba(92,149,96,0.10), transparent 65%),
    radial-gradient(600px 500px at 95% 100%, rgba(107,88,68,0.07), transparent 60%);
  z-index: 0; pointer-events: none;
}

/* ============ remove keycloak chrome ============ */
#kc-header, #kc-header-wrapper, .login-pf-brand,
#kc-page-title, h1#kc-page-title { display: none !important; }

.login-pf, .login-pf-page, #kc-container, #kc-container-wrapper,
#kc-content, #kc-content-wrapper {
  position: relative !important; z-index: 2 !important;
  min-height: unset !important; height: auto !important;
  display: block !important; padding: 0 !important; margin: 0 !important;
  overflow: visible !important; background: none !important;
}

/* ============ card ============ */
.card-pf {
  position: relative !important; z-index: 10 !important;
  width: 425px !important; max-width: 92vw !important;
  margin: 8vh auto 0 !important;
  padding: 42px 40px 36px !important;
  border-radius: 18px !important;
  background: #fbfaf5 !important;
  border: 1px solid #e2ddcf !important;
  box-shadow: 0 24px 55px -25px rgba(31,58,43,0.22) !important;
  display: flex !important; flex-direction: column !important;
  align-items: stretch !important; overflow: visible !important;
}

form { width: 100% !important; display: flex !important;
  flex-direction: column !important; align-items: stretch !important; }

/* ============ header ============ */
.army-header { text-align: center; margin-bottom: 26px; width: 100%; }
.army-ges-logo {
  width: 52px !important; height: 52px !important;
  margin: 0 auto 18px !important; display: block !important; filter: none !important;
}
.army-title {
  font-size: 11.5px !important; font-weight: 600 !important;
  letter-spacing: 2px !important; text-transform: uppercase;
  color: #4a7c4e !important; margin: 0 0 10px !important;
}
.army-subtitle {
  font-size: 26px !important; font-weight: 650 !important;
  letter-spacing: -0.3px !important; line-height: 1.25 !important;
  color: #1f3a2b !important; margin: 0 auto !important; max-width: 320px;
}
.army-desc {
  font-size: 13.5px; color: #7a8578;
  margin: 10px 0 0; line-height: 1.6; text-align: center;
}

/* ============ inputs ============ */
.input-group {
  position: relative !important; width: 100% !important;
  max-width: none !important; margin-bottom: 14px !important;
}
input[type="text"], input[type="password"], input[type="email"] {
  display: block !important; width: 100% !important;
  padding: 15px 16px 15px 46px !important;
  font-size: 15px !important; line-height: 1.4 !important;
  border-radius: 12px !important;
  background: #f4f2ea !important;
  border: 1.5px solid #e2ddcf !important;
  color: #1f3a2b !important; -webkit-text-fill-color: #1f3a2b !important;
  caret-color: #4a7c4e !important;
  outline: none !important; margin: 0 !important; font-family: inherit !important;
  transition: border-color 0.15s, background 0.15s !important;
}
.input-group svg {
  position: absolute !important; left: 15px !important; top: 25px !important;
  opacity: 0.5 !important; stroke: #4a7c4e !important;
  pointer-events: none !important; z-index: 1 !important;
}
input:focus {
  background: #ffffff !important;
  border-color: #4a7c4e !important;
  box-shadow: 0 0 0 4px rgba(74,124,78,0.12) !important;
}
input::placeholder {
  color: #9aa596 !important; -webkit-text-fill-color: #9aa596 !important;
}
input:-webkit-autofill, input:-webkit-autofill:hover,
input:-webkit-autofill:focus, input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #f4f2ea inset !important;
  box-shadow: 0 0 0 1000px #f4f2ea inset !important;
  -webkit-text-fill-color: #1f3a2b !important;
  caret-color: #4a7c4e !important;
  border: 1.5px solid #e2ddcf !important;
  border-radius: 12px !important;
  transition: background-color 9999s ease-in-out 0s !important;
}
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset, 0 0 0 4px rgba(74,124,78,0.12) !important;
  box-shadow: 0 0 0 1000px #ffffff inset, 0 0 0 4px rgba(74,124,78,0.12) !important;
  border-color: #4a7c4e !important;
}
input:autofill { background: #f4f2ea !important; color: #1f3a2b !important; }

/* ============ remember / forgot ============ */
.login-row {
  display: flex !important; justify-content: space-between !important;
  align-items: center !important; width: 100% !important;
  max-width: none !important; margin: 6px 0 20px !important;
  flex-wrap: nowrap !important; gap: 10px !important;
}
.login-row label {
  display: flex !important; align-items: center !important; gap: 8px !important;
  font-size: 13px !important; color: #7a8578 !important;
  margin: 0 !important; white-space: nowrap !important; cursor: pointer !important;
}
.login-row input[type="checkbox"] { accent-color: #4a7c4e !important; }
.login-row a {
  font-size: 13px !important; font-weight: 600 !important;
  color: #4a7c4e !important; text-decoration: none !important;
}
.login-row a:hover { text-decoration: underline !important; }

/* ============ buttons ============ */
input[type="submit"], .login-button, .army-btn {
  display: block !important; width: 100% !important; max-width: none !important;
  margin: 0 !important; padding: 15px 18px !important; border-radius: 12px !important;
  background: #4a7c4e !important;
  color: #fbfaf5 !important; -webkit-text-fill-color: #fbfaf5 !important;
  font-size: 15px !important; font-weight: 650 !important; letter-spacing: 0.2px !important;
  border: none !important; cursor: pointer !important;
  box-shadow: 0 10px 24px -12px rgba(31,58,43,0.5) !important;
  transition: background 0.15s !important;
  text-align: center; text-decoration: none; font-family: inherit !important;
}
input[type="submit"]:hover, .login-button:hover, .army-btn:hover {
  background: #5c9560 !important; transform: none !important;
}
input[type="submit"]:focus-visible { outline: 2px solid #4a7c4e !important; outline-offset: 3px !important; }
.army-btn-secondary {
  display: block !important; width: 100% !important; max-width: none !important;
  margin: 10px 0 0 !important; padding: 13px !important; border-radius: 12px !important;
  background: transparent !important; border: 1.5px solid #d8d0bf !important;
  color: #6b5844 !important; -webkit-text-fill-color: #6b5844 !important;
  font-size: 14px !important; font-weight: 600 !important; cursor: pointer !important;
  text-align: center; text-decoration: none; font-family: inherit !important;
}
.army-btn-secondary:hover { border-color: #6b5844 !important; }

/* ============ alerts ============ */
.alert-error {
  width: 100%; box-sizing: border-box;
  background: #f7e8e2; border: 1px solid #d9a595;
  border-radius: 12px; padding: 12px 15px; margin-bottom: 16px;
  font-size: 13px; color: #9c4b34;
}
.alert-success, .alert-info {
  width: 100%; box-sizing: border-box;
  background: #e8f0e4; border: 1px solid #a9c9a5;
  border-radius: 12px; padding: 12px 15px; margin-bottom: 16px;
  font-size: 13px; color: #2f5a37;
}
.input-error { color: #9c4b34; font-size: 12.5px; margin-top: 5px; display: block; }

.back-link { margin-top: 18px; text-align: center; font-size: 13px; }
.back-link a { color: #7a8578; text-decoration: none; font-weight: 500; }
.back-link a:hover { color: #4a7c4e; }

.register-text {
  margin-top: 16px !important; text-align: center !important;
  font-size: 13px !important; color: #7a8578 !important;
}
.register-text a { color: #4a7c4e !important; font-weight: 650 !important; text-decoration: none !important; }

#kc-form { width: 100%; display: flex; justify-content: center; }
#kc-form-wrapper { width: 100%; max-width: none; padding: 0; box-sizing: border-box; }

/* ============ footer (inside card) ============ */
.army-footer, .army-page-footer {
  position: relative !important; z-index: 10 !important;
  width: 100% !important; max-width: none !important;
  margin: 24px auto 0 !important; padding: 18px 0 0 !important;
  border-top: 1px solid #eae4d6;
  text-align: center !important;
  display: flex !important; flex-direction: column !important;
  align-items: center !important; gap: 8px !important;
}
.army-kepyes-logo, .army-page-footer img {
  width: 26px !important; height: 26px !important;
  object-fit: contain !important; opacity: 0.55 !important;
  filter: grayscale(0.3) !important; display: block !important; margin: 0 !important;
}
.army-footer-text, .army-page-footer-text {
  font-size: 10.5px !important; color: #9aa596 !important;
  line-height: 1.7 !important;
}
.army-footer-text a, .army-page-footer-text a {
  color: #9aa596 !important; text-decoration: none !important;
}

/* ============ patch: beat PatternFly login-pf ============ */
html, body, body.login-pf, .login-pf, .login-pf-page {
  background: #f4f2ea !important; background-image: none !important; border-top: none !important;
}
.login-pf::before, .login-pf-page::before { content: none !important; }
body.login-pf::before { content: "" !important; }

/* ============ registration fixes ============ */
.pf-c-form__group { width: 100% !important; max-width: none !important; margin: 0 0 14px 0 !important; padding: 0 !important; text-align: left !important; }
.pf-c-form__label, #kc-form-wrapper label { display: block !important; text-align: left !important; margin: 0 0 6px 0 !important; font-size: 12.5px !important; font-weight: 600 !important; }
.pf-c-input-group { position: relative !important; width: 100% !important; display: block !important; }
.pf-c-input-group input { width: 100% !important; padding-right: 48px !important; }
.pf-c-input-group button, button.pf-c-button.pf-m-control { position: absolute !important; right: 4px !important; top: 50% !important; transform: translateY(-50%) !important; width: 40px !important; height: calc(100% - 8px) !important; margin: 0 !important; padding: 0 !important; border: none !important; background: transparent !important; border-radius: 8px !important; cursor: pointer !important; display: flex !important; align-items: center !important; justify-content: center !important; box-shadow: none !important; }
.pf-c-input-group button:hover { background: rgba(74,124,78,0.12) !important; }
.subtitle { text-align: left !important; width: 100% !important; font-size: 12px !important; margin-bottom: 18px !important; }

/* ============ responsive ============ */
@media (min-width: 1920px) { .card-pf { width: 490px !important; padding: 48px 48px 42px !important; } .army-subtitle { font-size: 29px !important; } }
@media (max-width: 480px) {
  .card-pf { padding: 32px 24px 28px !important; margin-top: 5vh !important; border-radius: 16px !important; }
  .army-subtitle { font-size: 22px !important; }
  input[type="text"], input[type="password"], input[type="email"] { font-size: 14px !important; padding: 13px 14px 13px 42px !important; }
  .input-group svg { top: 22px !important; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.totp-qr img { max-height: none !important; width: 200px !important; height: 200px !important; }

/* ============ FIX: full-width form children (TOTP config & OTP pages) ============ */
#kc-form-wrapper form > div {
  width: 100% !important;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}
.input-group-plain { width: 100% !important; }
.input-group-plain input[type="text"],
.input-group-plain input[type="password"] {
  width: 100% !important;
  box-sizing: border-box !important;
}
.label-text { text-align: left !important; display: block !important; }

/* ============ FIX: centered OTP code appears shifted left ============ */
#otp, input#totp {
  letter-spacing: 6px !important;
  text-indent: 6px !important;
  text-align: center !important;
}

/* ============ Attempted-username header above the card ============ */
#kc-username, .kc-username { text-align: center; margin: 0 0 10px; }
#kc-username label, #kc-attempted-username, .kc-attempted-username {
  color: #7a8578 !important; font-size: 13px !important;
}
#kc-username a, #reset-login {
  color: #7a8578 !important; font-size: 12.5px !important; text-decoration: none !important;
}
#kc-username a:hover, #reset-login:hover { color: #4a7c4e !important; }

/* =========================================================
   FIX: OTP code truly centered
   The field had asymmetric padding (large left pad for the
   lock icon, small right pad), so centered text sits inside
   an off-centre content box — text-align alone can't fix
   that. Equalize the padding, hide the icon for this field,
   and offset the trailing letter-spacing gap.
========================================================= */
#kc-form-wrapper input#otp,
#kc-form-wrapper input#totp,
.card-pf input#otp,
.card-pf input#totp {
  padding-left: 18px !important;
  padding-right: 18px !important;
  text-align: center !important;
  letter-spacing: 6px !important;
  text-indent: 6px !important;
  font-variant-numeric: tabular-nums;
}

/* hide the lock icon in the OTP field wrapper (modern browsers) */
.input-group:has(> input#otp) svg,
.input-group:has(> input#totp) svg { display: none !important; }

/* fallback: add class="input-group otp-group" to the wrapper in login-otp.ftl */
.otp-group svg { display: none !important; }

/* =========================================================
   PASSWORD VISIBILITY TOGGLE (.pw-toggle)
   Used by login-v2.ftl / login-update-password-v2.ftl.
   Theme-neutral: icons use currentColor so they inherit the
   input text colour of whichever theme is active.
========================================================= */
.input-group input.has-toggle {
  padding-right: 48px !important;   /* room for the eye */
}
.pw-toggle {
  position: absolute !important;
  right: 5px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 38px !important;
  height: calc(100% - 10px) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: none !important;
  color: inherit !important;
  opacity: 0.55;
  z-index: 2;
  transition: opacity 0.12s;
}
.pw-toggle:hover { opacity: 0.9; background: rgba(127,127,127,0.12) !important; }
.pw-toggle:focus-visible { outline: 2px solid currentColor !important; outline-offset: 1px; }
.pw-toggle svg { display: block; stroke: currentColor; }

/* the toggle button must not inherit the theme's submit-button styling */
.input-group button.pw-toggle {
  width: 38px !important;
  min-width: 0 !important;
  font-size: 0 !important;
}
.pw-toggle { color: #4a7c4e !important; }

