:root {
  color-scheme: light;
  --login-blue: #2458e8;
  --login-blue-dark: #173fbd;
  --login-ink: #10203d;
  --login-muted: #6c7890;
  --login-border: #c8d4e5;
  --login-surface: rgba(255, 255, 255, 0.97);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body.login-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--login-ink);
  background-color: #03152e;
  background-image:
    linear-gradient(90deg, rgba(1, 10, 28, .08), rgba(1, 10, 28, .02) 58%, rgba(1, 10, 28, .08)),
    url("../images/fda-login-background-clean.webp");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
}

.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(16px, 2vh, 28px);
  padding: clamp(28px, 5vh, 64px) clamp(20px, 6vw, 96px) clamp(22px, 3.5vh, 46px);
  background: linear-gradient(180deg, rgba(2, 13, 34, .04), rgba(2, 13, 34, .20));
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 2vw, 30px);
  color: #fff;
  filter: drop-shadow(0 3px 12px rgba(0, 11, 34, .45));
}

.login-brand-logo {
  width: clamp(230px, 22vw, 340px);
  height: auto;
  display: block;
  background: rgba(255,255,255,.96);
  border-radius: 10px;
  padding: 7px 12px;
}

.login-brand-divider {
  width: 1px;
  height: clamp(48px, 5vw, 68px);
  background: rgba(255, 255, 255, .72);
}

.login-product-name {
  margin: 0;
  font-size: clamp(26px, 3vw, 45px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -.025em;
  white-space: nowrap;
}

.login-main {
  display: grid;
  place-items: center;
  min-height: 0;
}

.login-card {
  width: min(500px, calc(100vw - 40px));
  padding: clamp(30px, 4vw, 48px);
  border: 1px solid rgba(255, 255, 255, .88);
  border-radius: 18px;
  background: var(--login-surface);
  box-shadow: 0 30px 74px rgba(0, 14, 42, .36), 0 8px 22px rgba(0, 14, 42, .20);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: login-card-enter .35s ease-out both;
}

@keyframes login-card-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.message {
  padding: 12px 14px;
  border-radius: 10px;
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.45;
}

.message-error { color: #991b1b; background: #fef2f2; border: 1px solid #fecaca; }
.message-success { color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; }

.field { margin-bottom: 22px; }

.login-card label {
  display: block;
  margin: 0 0 9px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.input-shell { position: relative; display: flex; align-items: center; }

.field-icon {
  position: absolute;
  left: 17px;
  width: 21px;
  height: 21px;
  color: #17284b;
  pointer-events: none;
}

.login-card input {
  width: 100%;
  min-height: 56px;
  padding: 14px 50px 14px 53px;
  border: 1px solid var(--login-border);
  border-radius: 10px;
  background: #fff;
  color: var(--login-ink);
  font: inherit;
  font-size: 16px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.login-card input::placeholder { color: #7a869d; }
.login-card input:hover { border-color: #9fb0ca; }
.login-card input:focus { border-color: var(--login-blue); box-shadow: 0 0 0 3px rgba(36, 88, 232, .15); }

.password-toggle {
  position: absolute;
  right: 10px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1a2b50;
  cursor: pointer;
}

.password-toggle:hover { background: #eef3fb; }
.password-toggle:focus-visible { outline: 3px solid rgba(36, 88, 232, .24); outline-offset: 1px; }
.password-toggle svg { width: 21px; height: 21px; }

.sign-in-button {
  width: 100%;
  min-height: 56px;
  margin-top: 6px;
  padding: 14px 18px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--login-blue), #143fd1);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(36, 88, 232, .24);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.sign-in-button:hover { background: linear-gradient(135deg, #2c63f1, var(--login-blue-dark)); box-shadow: 0 13px 26px rgba(36, 88, 232, .30); transform: translateY(-1px); }
.sign-in-button:active { transform: translateY(0); }
.sign-in-button:focus-visible { outline: 3px solid rgba(255,255,255,.92); outline-offset: 3px; }

.login-footer { color: #fff; text-shadow: 0 2px 8px rgba(0, 10, 30, .55); }

.login-features {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  max-width: 1080px;
  margin: 0 auto 16px;
}

.login-feature {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 20px;
  border-right: 1px solid rgba(255, 255, 255, .38);
}

.login-feature:last-child { border-right: 0; }
.feature-icon-wrap {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 2px solid rgba(123, 153, 255, .92);
  border-radius: 50%;
  background: rgba(4, 31, 78, .54);
}
.feature-icon { width: 28px; height: 28px; color: #83a2ff; }
.feature-label { font-size: clamp(14px, 1.25vw, 18px); line-height: 1.25; font-weight: 600; }

.login-copyright {
  text-align: center;
  color: rgba(255, 255, 255, .76);
  font-size: 14px;
}
.login-copyright-separator { margin: 0 12px; }

@media (max-width: 1000px) {
  .login-shell { padding-left: 28px; padding-right: 28px; }
  .login-brand-logo { width: clamp(200px, 30vw, 285px); }
  .login-features { grid-template-columns: repeat(2, minmax(190px, 1fr)); gap: 14px 0; max-width: 680px; }
  .login-feature:nth-child(2) { border-right: 0; }
}

@media (max-width: 700px) {
  body.login-page { background-position: 60% center; }
  .login-shell { grid-template-rows: auto 1fr auto; padding: 24px 16px; gap: 16px; }
  .login-brand { flex-direction: column; gap: 10px; text-align: center; }
  .login-brand-divider { display: none; }
  .login-brand-logo { width: min(245px, 72vw); }
  .login-product-name { font-size: clamp(23px, 7vw, 32px); white-space: normal; }
  .login-card { width: min(500px, calc(100vw - 24px)); padding: 28px 24px; }
  .login-features { display: none; }
  .login-copyright { font-size: 12px; }
}

@media (max-height: 760px) and (min-width: 701px) {
  .login-shell { padding-top: 22px; padding-bottom: 18px; gap: 12px; }
  .login-brand-logo { width: 220px; }
  .login-brand-divider { height: 46px; }
  .login-product-name { font-size: 28px; }
  .login-card { padding: 26px 34px; }
  .field { margin-bottom: 16px; }
  .login-card input, .sign-in-button { min-height: 50px; }
  .feature-icon-wrap { width: 44px; height: 44px; }
  .feature-icon { width: 23px; height: 23px; }
  .login-features { margin-bottom: 8px; }
}

@media (max-height: 620px) {
  .login-shell { min-height: 100vh; height: auto; overflow-y: auto; }
  .login-features { display: none; }
  .login-brand { transform: scale(.88); transform-origin: center top; }
  .login-card { padding-top: 24px; padding-bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-card { animation: none; }
  .login-card input, .sign-in-button { transition: none; }
}

/* UI-R2 — final visual polish */
.login-brand {
  transform: translateY(4px);
  animation: login-brand-enter .28s ease-out both;
}

.login-brand-logo {
  width: clamp(265px, 24vw, 365px);
  padding: 0;
  border-radius: 0;
  background: transparent;
  filter: drop-shadow(0 3px 10px rgba(0, 9, 28, .40));
}

.login-brand-divider {
  height: clamp(44px, 4.5vw, 62px);
  background: rgba(255, 255, 255, .64);
}

.login-product-name {
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 680;
  text-shadow: 0 3px 12px rgba(0, 9, 28, .52);
}

.login-main {
  transform: translateY(-18px);
}

.login-card {
  border-radius: 22px;
  background: rgba(255, 255, 255, .965);
  box-shadow: 0 22px 54px rgba(0, 14, 42, .30), 0 6px 18px rgba(0, 14, 42, .16);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.login-card label { font-weight: 720; }
.login-card input::placeholder { color: #8290a8; }
.sign-in-button { font-weight: 760; }

.login-feature {
  gap: 16px;
  border-right-color: rgba(255, 255, 255, .24);
}

.login-copyright { opacity: .82; }

@keyframes login-brand-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 1000px) {
  .login-brand-logo { width: clamp(230px, 32vw, 315px); }
}

@media (max-width: 700px) {
  .login-main { transform: none; }
  .login-brand-logo { width: min(275px, 78vw); }
}

@media (max-height: 760px) and (min-width: 701px) {
  .login-main { transform: translateY(-8px); }
  .login-brand-logo { width: 245px; }
}

@media (max-height: 620px) {
  .login-main { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .login-brand { animation: none; }
}
