* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; background: var(--canvas); color: var(--ink); font: 15px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.login-pf-page { max-width: 480px; padding: clamp(40px, 10svh, 100px) 24px 110px; margin: auto; }
#kc-header { margin: 0 auto 32px; text-align: center; }
#kc-header-wrapper img { max-width: 100%; height: auto; }
.card-pf { padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-small); }
h1 { font-size: 24px; letter-spacing: -.5px; line-height: 1.3; margin: 0 0 24px; }
.form-group { margin: 0 0 18px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
input:not([type=checkbox]):not([type=hidden]),select { width: 100%; min-height: 46px; padding: 11px 12px; border: 1px solid var(--input-border); border-radius: 8px; background: var(--input-surface); color: var(--ink); font: inherit; }
input:focus-visible,button:focus-visible,a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
button,input[type=submit] { cursor: pointer; }
#kc-login,input[type=submit] { background: var(--brand); color: var(--on-brand); font-weight: 650; border-color: var(--brand); }
#kc-login:hover { background: var(--brand-hover); }
.pf-c-input-group { display: flex; }
.pf-c-input-group input { min-width: 0; border-radius: 8px 0 0 8px !important; }
.pf-c-input-group button { min-width: 44px; border: 1px solid var(--input-border); border-left: 0; border-radius: 0 8px 8px 0; background: var(--surface-subtle); color: var(--ink); }
button[data-password-toggle]::before { content: '◉'; font-size: 18px; }
.alert-error,#input-error,#input-error-username,#input-error-password { color: var(--danger); font-size: 13px; }
.alert { padding: 12px; border-radius: 8px; background: var(--surface-tint); margin-bottom: 18px; }
.alert-error { background: var(--danger-surface); }
#kc-form-options { font-size: 13px; }
#kc-form-options label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
#kc-locale { display: none; }
.identity-appearance { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); right: max(24px, env(safe-area-inset-right)); }
#kc-current-locale-link { display: none; }
#kc-attempted-username { overflow-wrap: anywhere; }
#reset-login { display: inline-flex; margin-left: 8px; }
#kc-info-wrapper { margin-top: 18px; font-size: 13px; }
@media(max-width:480px) { .login-pf-page { padding: 40px 18px 110px; } .card-pf { padding: 24px; } }
/* Keycloak's shared stylesheet styles html.login-pf and the password group too. */
html.login-pf, html.login-pf body { background: var(--canvas); background-image: none; }
.login-pf .card-pf { border-top: 1px solid var(--border); }
.login-pf input, .login-pf button { font-family: inherit; }
.input-group { display: flex; }
.input-group input { min-width: 0; border-radius: 8px 0 0 8px !important; }
.input-group button, button[data-password-toggle] { min-width: 44px; padding: 0 12px; border: 1px solid var(--input-border); border-left: 0; border-radius: 0 8px 8px 0; background: var(--surface-subtle); color: var(--ink); }
button[data-password-toggle]::before { content: none; }
#kc-login { font: 650 15px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

#registerWebAuthn, #authenticateWebAuthnButton, #saveRecoveryAuthnCodesBtn,
.login-pf #kc-form-buttons input[type=submit]:not([name=cancel-aia]) {
  width: 100%; min-height: 46px; border: 1px solid var(--brand); border-radius: 8px;
  background: var(--brand); color: var(--on-brand); font-weight: 650;
}
#saveRecoveryAuthnCodesBtn:disabled { opacity: .55; cursor: default; }
#kc-recovery-codes-list {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,16ch),1fr));
  gap: 6px 14px; list-style: none; padding: 14px; margin: 16px 0;
  background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 8px;
  font: 14px/1.6 ui-monospace,monospace;
}
#kc-recovery-codes-list li { white-space: nowrap; }
#kc-recovery-codes-list li span { display:inline-block; min-width:3ch; color:var(--muted); }
#printRecoveryCodes, #downloadRecoveryCodes, #copyRecoveryCodes {
  min-height: 44px; padding: 6px 10px; border: 0; background: transparent; color: var(--brand); font: inherit;
}
body:has(#kc-recovery-codes-list) .identity-appearance { position: static; display: flex; justify-content: center; margin: 0 auto 24px; }
body:has(#kc-recovery-codes-list) .login-pf-page { padding-bottom: 24px; }
