/* Dedicated, responsive sign-in presentation. Uses a local image so the page
   remains self-contained and dependable without third-party font or image CDNs.
   Defaults also keep the legacy auth-only Flask app styled; the main app's
   inline preference variables override these values when available. */
:root {
  color-scheme: light;
  --bg: #12141a;
  --bg-alt: #191c24;
  --panel: #1c2029;
  --panel-alt: #232833;
  --border: #2e3542;
  --fg: #e6e8ee;
  --fg-muted: #9aa3b2;
  --fg-faint: #6d7686;
  --wash: #fff;
  --accent: #b08d57;
  --font-stack: Georgia, "Times New Roman", serif;
  --font-size: 16px;
  --gap: 18px;
  --pad: 16px 20px;
  --bg-opacity: .06;
  --bg-image: none;
  --motion: .18s;
}

html, body { min-height: 100%; }
body.login-page {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  flex-direction: column;
  justify-content: center;
  overflow-x: hidden;
  padding: clamp(30px, 5vw, 72px) clamp(18px, 5vw, 68px) 24px;
  background: #111a28;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

body.login-page::before,
body.login-page::after {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
}
body.login-page::before {
  z-index: -2;
  background-image:
    linear-gradient(90deg, rgba(8, 14, 23, .88) 0%, rgba(10, 17, 27, .78) 43%, rgba(8, 14, 22, .58) 100%),
    linear-gradient(0deg, rgba(8, 13, 21, .48), rgba(8, 13, 21, .08) 58%, rgba(8, 13, 21, .20)),
    url("/static/images/legal-login.jpg?v=0.7.14");
  background-position: center, center, center 48%;
  background-size: cover, cover, cover;
  background-repeat: no-repeat;
  transform: scale(1.01);
}
body.login-page::after {
  z-index: -1;
  background: radial-gradient(ellipse at 18% 46%, rgba(28, 49, 73, .30), transparent 54%);
}

.login-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(350px, 458px);
  align-items: center;
  gap: clamp(40px, 7vw, 100px);
  width: min(1120px, 100%);
  margin: auto;
}
.login-intro { max-width: 560px; padding: 10px 0; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: clamp(48px, 8vh, 86px); }
.login-seal {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  place-items: center;
  border: 1px solid rgba(218, 190, 133, .78);
  border-radius: 50%;
  color: #dfc48d;
  background: rgba(17, 27, 41, .66);
  box-shadow: 0 5px 24px rgba(0, 0, 0, .16), inset 0 0 0 4px rgba(218, 190, 133, .08);
  font: 30px/1 Georgia, "Times New Roman", serif;
}
.login-brand-copy { display: flex; flex-direction: column; gap: 2px; }
.login-brand-name { color: #fff; font: 600 20px/1.2 Georgia, "Times New Roman", serif; letter-spacing: .02em; }
.login-brand-caption { color: #d2bd91; font-size: 11px; font-weight: 700; letter-spacing: .17em; }
.login-kicker {
  margin: 0 0 15px;
  color: #dec58f;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .18em;
  line-height: 1.4;
  text-transform: uppercase;
}
.login-intro h2 {
  max-width: 590px;
  margin: 0;
  color: #fff;
  font: 500 clamp(42px, 5vw, 66px)/1.08 Georgia, "Times New Roman", serif;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.login-lede {
  max-width: 450px;
  margin: 22px 0 0;
  color: rgba(239, 243, 248, .84);
  font-size: 18px;
  line-height: 1.65;
}
.login-assurance {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 10px 14px;
  border: 1px solid rgba(235, 241, 247, .20);
  border-radius: 999px;
  background: rgba(8, 14, 22, .25);
  color: rgba(243, 246, 250, .90);
  font-size: 14px;
}
.assurance-mark {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  background: rgba(211, 183, 123, .20);
  color: #ead39f;
  font-size: 13px;
  font-weight: 800;
}
.login-intro-foot {
  margin: clamp(38px, 7vh, 70px) 0 0;
  color: rgba(229, 235, 242, .63);
  font-size: 13px;
  letter-spacing: .04em;
}

.login-card.panel {
  width: 100%;
  padding: clamp(30px, 4vw, 44px);
  border: 1px solid rgba(255, 255, 255, .86);
  border-radius: 20px;
  background: rgba(252, 251, 247, .98);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .34), 0 4px 18px rgba(0, 0, 0, .12);
  color: #17263a;
  backdrop-filter: blur(16px);
}
.login-card-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
  color: #8b6b33;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .14em;
  line-height: 1.35;
  text-transform: uppercase;
}
.eyebrow-rule { width: 25px; height: 2px; border-radius: 2px; background: #aa8950; }
.login-card h1 {
  margin: 0;
  color: #15243a;
  font: 600 clamp(30px, 3vw, 36px)/1.18 Georgia, "Times New Roman", serif;
  letter-spacing: -.025em;
}
.login-summary { margin: 10px 0 26px; color: #596679; font-size: 16px; }
.login-card label {
  display: block;
  margin: 18px 0 7px;
  color: #33445b;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .01em;
}
.login-card input[type="text"],
.login-card input[type="password"] {
  display: block;
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 13px 15px;
  border: 1px solid #c4ccd6;
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(18, 34, 54, .035);
  color: #16263a;
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.login-card input::placeholder { color: #8993a0; }
.login-card input:focus {
  border-color: #9d7c43;
  outline: 3px solid rgba(176, 141, 87, .22);
  outline-offset: 1px;
  box-shadow: 0 0 0 1px rgba(176, 141, 87, .10);
}
.login-card button.primary {
  display: block;
  width: 100%;
  min-height: 56px;
  margin: 25px 0 0;
  padding: 13px 18px;
  border: 1px solid #172a43;
  border-radius: 10px;
  background: #172a43;
  color: #fff;
  font: 700 16px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: .015em;
  box-shadow: 0 5px 12px rgba(22, 41, 65, .15);
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.login-card button.primary:hover {
  border-color: #24415f;
  background: #24415f;
  box-shadow: 0 8px 18px rgba(22, 41, 65, .20);
  transform: translateY(-1px);
}
.login-card button.primary:focus-visible {
  outline: 3px solid rgba(176, 141, 87, .46);
  outline-offset: 3px;
}
.login-error {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #e5b8b8;
  border-left: 4px solid #ad3c42;
  border-radius: 9px;
  background: #fff1f0;
  color: #79292e;
  font-size: 15px;
  line-height: 1.5;
}
.login-session {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 24px;
  padding-top: 19px;
  border-top: 1px solid #e1e2df;
  color: #5a6676;
}
.session-lock { display: block; width: 19px; height: 19px; flex: 0 0 19px; margin-top: 1px; color: #8c7040; }
.session-lock svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.login-session p { margin: 0; font-size: 14px; line-height: 1.5; }
.login-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: min(1120px, 100%);
  margin: 28px auto 0;
  color: rgba(230, 236, 244, .60);
  font-size: 12px;
  letter-spacing: .035em;
}
.login-footer span:first-child { font-weight: 750; letter-spacing: .16em; }

@media (max-width: 820px) {
  body.login-page { align-items: flex-start; padding: 28px 18px 18px; }
  .login-stage { grid-template-columns: minmax(0, 1fr); gap: 26px; width: min(520px, 100%); }
  .login-intro { max-width: none; padding: 0; text-align: center; }
  .login-brand { justify-content: center; margin-bottom: 22px; }
  .login-intro-copy { max-width: 500px; margin: 0 auto; }
  .login-intro h2 { font-size: clamp(30px, 7vw, 42px); }
  .login-lede { margin: 12px auto 0; font-size: 16px; }
  .login-assurance, .login-intro-foot { display: none; }
  .login-card.panel { padding: 30px clamp(22px, 6vw, 38px); }
  .login-footer { justify-content: center; margin-top: 18px; text-align: center; }
  .login-footer span:first-child { display: none; }
}
@media (max-width: 480px) {
  body.login-page { padding-right: 14px; padding-left: 14px; }
  .login-stage { gap: 20px; }
  .login-brand { margin-bottom: 17px; }
  .login-seal { width: 46px; height: 46px; flex-basis: 46px; font-size: 27px; }
  .login-brand-name { font-size: 18px; }
  .login-brand-caption { font-size: 10px; }
  .login-intro h2 { font-size: 29px; }
  .login-lede { font-size: 15px; }
  .login-card.panel { padding: 26px 21px; border-radius: 16px; }
  .login-card h1 { font-size: 30px; }
  .login-card input[type="text"], .login-card input[type="password"] { min-height: 52px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-card input, .login-card button.primary { transition: none; }
}
