* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #182d42; background: #f1f6fa; }
.inv-auth { display: grid; grid-template-columns: 55% 45%; min-height: 100svh; }
.story { position: relative; display: flex; flex-direction: column; padding: 5.2vh 5vw; background: linear-gradient(90deg, rgba(244,249,253,.85), rgba(244,249,253,.12)), url('../img/architecture.webp') center / cover; -webkit-user-select: none; user-select: none; }
.brand { font-size: 40px; font-weight: 600; color: #182d42; text-decoration: none; letter-spacing: 1px; }
.brand span { color: #7395b5; font-weight: 400; }
.motto { font-size: 11px; letter-spacing: 2px; margin-top: 12px; }
.story-title { margin: auto 0; }
.story-title i { display: block; width: 36px; height: 2px; background: #7395b5; margin-bottom: 28px; }
.story h1 { font-size: clamp(38px, 4.2vw, 70px); line-height: 1.12; letter-spacing: -2px; margin: 0; font-weight: 700; }
.story footer { font-size: 14px; color: #476785; }
.story blockquote { font-style: italic; margin: 32px 0; line-height: 1.6; }
.story small { font-size: 10px; letter-spacing: 1px; }
.auth-main { padding: 4vh 4vw; display: flex; flex-direction: column; justify-content: center; }
.auth-card { background: rgba(255,255,255,.94); border-radius: 26px; padding: 36px 32px; max-width: 680px; width: 100%; margin: 0 auto; }
.card-body h2 { font-size: 30px; line-height: 1.2; letter-spacing: -.8px; margin: 0 0 8px; }
.subtitle { color: #5f7894; font-size: 16px; line-height: 1.5; margin: 0 0 26px; }
label { display: block; font-size: 14px; font-weight: 500; margin: 18px 0 8px; }
input { display: block; width: 100%; height: 48px; border: 1px solid #cbdbea; border-radius: 10px; background: #f8fbfe; padding: 0 15px; font: inherit; font-size: 14px; color: #182d42; transition: border-color 160ms ease, box-shadow 160ms ease; }
input:hover { border-color: #8ca7bf; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #2b6fa6; outline-offset: 3px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 50px; }
.show-password { position: absolute; right: 4px; top: 4px; height: 40px; width: 40px; background: none; border: 0; color: #5f7894; cursor: pointer; border-radius: 8px; transition: color 160ms ease, background 160ms ease; }
.show-password:hover { color: #182d42; background: #edf4f9; }
.primary { display: flex; justify-content: center; align-items: center; gap: 20px; width: 100%; min-height: 52px; border: 0; border-radius: 10px; background: #182d42; color: white; font: inherit; font-size: 16px; margin-top: 20px; cursor: pointer; text-decoration: none; padding: 12px 16px; transition: background 180ms ease, transform 180ms ease, box-shadow 180ms ease; }
.primary:hover { background: #24445f; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(24,45,66,.10); }
.primary:active { transform: translateY(0); box-shadow: none; background: #102338; }
.primary:disabled { opacity: .6; transform: none; box-shadow: none; }
.secondary { width: 100%; min-height: 44px; background: white; border: 1px solid #cbdbea; border-radius: 10px; margin-top: 12px; font: inherit; color: #285f8f; cursor: pointer; transition: background 180ms ease; }
.secondary:hover { background: #edf4f9; }
a { color: #285f8f; }
.forgot { margin: 12px 0 0; }
.forgot a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border: 1px solid #dce5ef; border-radius: 10px; background: #edf4f9; color: #182d42; font-size: 14px; font-weight: 500; line-height: 20px; text-decoration: none; transition: background 180ms ease, border-color 180ms ease, transform 180ms ease; }
.forgot a:hover { background: #e3edf5; border-color: #bfd0df; transform: translateY(-1px); }
.forgot a:active { transform: translateY(0); background: #dceaf8; }
.footer { text-align: center; color: #5f7894; font-size: 12px; margin: 28px 0 0; }
.notice { font-size: 14px; line-height: 1.5; padding: 12px; background: #eaf2fa; border-radius: 8px; margin: 16px 0; }
.notice.error { background: #fbecef; color: #a12f43; }
.hint { font-size: 12px; color: #5f7894; line-height: 1.5; }
.link-button { margin-bottom: 12px; }
@keyframes auth-reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 1800px) {
  .auth-card { padding: 40px 38px; }
  .card-body h2 { font-size: 34px; }
  input { height: 52px; }
}
@media (max-width: 900px) {
  .inv-auth { grid-template-columns: 42% 58%; }
  .story { padding: 32px; }
  .story h1 { font-size: 38px; }
  .auth-main { padding: 32px 24px; }
  .auth-card { padding: 28px 24px; }
  .brand { font-size: 30px; }
}
@media (max-width: 640px) {
  .inv-auth { display: block; }
  .story { min-height: 150px; padding: 24px; background-position: center 35%; }
  .story-title, .story footer { display: none; }
  .brand { font-size: 28px; }
  .motto { font-size: 9px; }
  .auth-main { padding: 24px 16px 32px; }
  .auth-card { padding: 28px 20px; border-radius: 20px; }
  .card-body h2 { font-size: 26px; }
  input { font-size: 16px; }
  .footer { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .inv-auth *, .inv-auth *::before, .inv-auth *::after { animation: none !important; transition: none !important; }
  .inv-auth .primary:hover, .inv-auth .forgot a:hover { transform: none; }
}

/* Keep the surrounding layout steady across Keycloak document navigation. */
@view-transition { navigation: auto; }
.story { view-transition-name: auth-story; }
.auth-card { view-transition-name: auth-card; }
.footer { view-transition-name: auth-footer; }
.card-body { animation: auth-form-enter 180ms ease-out; }
@keyframes auth-form-enter {
  from { opacity: .7; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
::view-transition-old(root), ::view-transition-new(root),
::view-transition-old(auth-story), ::view-transition-new(auth-story),
::view-transition-old(auth-footer), ::view-transition-new(auth-footer) {
  animation: none;
}
::view-transition-group(auth-card) { animation-duration: 180ms; }
::view-transition-old(auth-card), ::view-transition-new(auth-card) { animation-duration: 180ms; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
