:root {
  --nv-ink: #071a2f;
  --nv-ink-soft: #4f6174;
  --nv-teal-950: #003f47;
  --nv-teal-900: #00545b;
  --nv-teal-800: #006b70;
  --nv-teal-700: #008d89;
  --nv-teal-500: #1bb8ad;
  --nv-teal-200: #bfe9e3;
  --nv-surface: #f7fafb;
  --nv-card: rgba(255, 255, 255, .93);
  --nv-border: #d9e3e8;
  --nv-shadow: 0 26px 70px rgba(18, 47, 63, .13);
  --nv-radius-xl: 28px;
  --nv-radius-lg: 18px;
  --nv-font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Deliberately provisional until NIVORIA_UI_DESIGN_SYSTEM.md is approved. */
  --nv-pro-accent: #006f6b;
  --nv-pro-border: #007e78;

  /* Login theme tokens: Current Nivoria values. A candidate theme overrides them on
     :root[data-nv-theme="…"] (docs/ui/theme-experiments/navy-hybrid.md). */
  --nv-login-page-bg: #eef4f6;
  --nv-login-shell-bg: #edf3f4;
  --nv-login-hero-tint: linear-gradient(90deg, rgba(0, 41, 52, .90) 0%, rgba(0, 56, 66, .74) 38%, rgba(3, 54, 63, .31) 74%, rgba(3, 54, 63, .12) 100%);
  --nv-login-hero-shade: linear-gradient(180deg, rgba(0, 29, 39, .10) 0%, rgba(0, 27, 35, .23) 70%, rgba(0, 29, 38, .60) 100%);
  --nv-login-rule: linear-gradient(90deg, #34cfc1, #0b928e);
  --nv-login-rule-fade: linear-gradient(90deg, rgba(22,196,183,.9), rgba(22,196,183,.18));
  --nv-login-feature-border: rgba(63, 222, 207, .22);
  --nv-login-feature-bg: linear-gradient(145deg, rgba(0, 102, 108, .77), rgba(0, 62, 72, .77));
  --nv-login-feature-text: #d8faf5;
  --nv-login-panel-bg:
    radial-gradient(circle at 10% 3%, rgba(213, 232, 233, .62), transparent 29%),
    linear-gradient(140deg, #f5f9fa 0%, #fdfefe 74%);
  --nv-login-panel-edge: #f3f8f9;
  --nv-login-field-focus-border: #72bdb9;
  --nv-login-field-focus-ring: 0 0 0 4px rgba(18, 151, 143, .10);
  --nv-login-link: #006b68;
  --nv-login-primary-bg: linear-gradient(105deg, #00646a 0%, #008d83 100%);
  --nv-login-primary-shadow: 0 12px 25px rgba(0, 101, 102, .16);
  --nv-login-pro-text: #064f52;
  --nv-login-icon-text: #00656a;
  --nv-login-icon-bg: #e2f1f1;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--nv-font);
  color: var(--nv-ink);
  background: var(--nv-login-page-bg);
}

button, input { font: inherit; }
a { color: inherit; text-decoration: none; }

.login-page { min-height: 100vh; }

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(560px, .86fr);
  min-height: 100vh;
  overflow: hidden;
  background: var(--nv-login-shell-bg);
}

.brand-panel {
  position: relative;
  min-height: 100vh;
  color: white;
  background:
    var(--nv-login-hero-tint),
    var(--nv-login-hero-image, url("/static/img/fjord-background.svg")) center/cover no-repeat;
}

.brand-overlay {
  position: absolute;
  inset: 0;
  background: var(--nv-login-hero-shade);
  pointer-events: none;
}

.brand-content {
  position: relative;
  z-index: 1;
  width: min(820px, 83%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 70px 0 58px;
  display: flex;
  flex-direction: column;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-mark {
  width: 115px;
  height: 72px;
  flex: none;
  filter: drop-shadow(0 9px 20px rgba(0, 0, 0, .08));
}

.brand-name {
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: .9;
}

.brand-name--hero {
  font-size: clamp(54px, 5.1vw, 78px);
  color: #fff;
  text-shadow: 0 4px 25px rgba(0,0,0,.10);
}

.brand-tagline {
  margin-top: 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .88);
  white-space: nowrap;
}

.hero-copy {
  margin-top: clamp(70px, 9vh, 125px);
  max-width: 690px;
}

.hero-rule {
  width: 68px;
  height: 4px;
  border-radius: 9px;
  background: var(--nv-login-rule);
  margin-bottom: 32px;
}

.hero-copy h1 {
  margin: 0;
  max-width: 690px;
  font-size: clamp(52px, 5.2vw, 78px);
  line-height: 1.02;
  letter-spacing: -.045em;
  font-weight: 540;
  text-wrap: balance;
}

.hero-copy p {
  max-width: 650px;
  margin: 28px 0 0;
  font-size: clamp(18px, 1.55vw, 23px);
  line-height: 1.55;
  color: rgba(255, 255, 255, .92);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 48px;
  margin-top: 46px;
  max-width: 690px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 20px;
}

.feature-icon {
  width: 58px;
  height: 58px;
  border: 1px solid var(--nv-login-feature-border);
  border-radius: 15px;
  background: var(--nv-login-feature-bg);
  display: grid;
  place-items: center;
  flex: none;
  font-size: 27px;
  color: var(--nv-login-feature-text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.feature-item strong,
.feature-item span {
  display: block;
}

.feature-item strong {
  font-size: 18px;
  margin-bottom: 5px;
}

.feature-item span {
  font-size: 15px;
  color: rgba(255, 255, 255, .85);
}

.brand-footer {
  margin-top: auto;
  padding-top: 45px;
}

.brand-footer-line {
  width: 390px;
  max-width: 62%;
  height: 2px;
  background: var(--nv-login-rule-fade);
  margin-bottom: 20px;
}

.brand-footer span {
  font-size: 12px;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: rgba(255,255,255,.82);
}

.login-panel {
  position: relative;
  min-height: 100vh;
  padding: 76px clamp(48px, 5vw, 92px) 50px;
  background: var(--nv-login-panel-bg);
}

.login-panel::before {
  content: "";
  position: absolute;
  left: -72px;
  top: 0;
  height: 100%;
  width: 145px;
  background: var(--nv-login-panel-edge);
  transform: skewX(-12deg);
  transform-origin: top;
}

.top-actions {
  position: absolute;
  top: 34px;
  right: 46px;
  display: flex;
  align-items: center;
  gap: 25px;
  z-index: 2;
}

.ghost-action {
  appearance: none;
  border: 0;
  background: none;
  color: var(--nv-ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

.action-icon {
  width: 23px;
  height: 23px;
  border: 1.7px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.chevron { margin-left: 2px; }

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 600px);
  margin: 34px auto 0;
  padding: 60px 58px 38px;
  border: 1px solid rgba(210, 222, 228, .82);
  border-radius: var(--nv-radius-xl);
  background: var(--nv-card);
  box-shadow: var(--nv-shadow);
  backdrop-filter: blur(12px);
}

.brand-lockup--card {
  justify-content: center;
  gap: 16px;
}

.brand-mark--card {
  width: 92px;
  height: 58px;
}

.brand-name--card {
  font-size: 51px;
  color: var(--nv-ink);
}

.brand-tagline--card {
  margin-top: 13px;
  color: var(--nv-teal-900);
  font-size: 10px;
  letter-spacing: .34em;
}

.login-heading {
  margin: 48px auto 30px;
  text-align: center;
}

.login-heading h2 {
  margin: 0;
  font-size: 31px;
  letter-spacing: -.035em;
}

.login-heading p {
  margin: 10px 0 0;
  color: #68788b;
  font-size: 16px;
}

.login-error {
  margin: -8px 0 4px;
  padding: 12px 14px;
  border: 1px solid #e8c8c5;
  border-radius: 12px;
  background: #fff5f4;
  color: #8b342f;
  font-size: 14px;
  line-height: 1.45;
}

.login-form { display: grid; gap: 14px; }

.field {
  height: 58px;
  border: 1px solid var(--nv-border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  padding: 0 17px;
  background: rgba(255,255,255,.85);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field:focus-within {
  border-color: var(--nv-login-field-focus-border);
  box-shadow: var(--nv-login-field-focus-ring);
  background: white;
}

.field-icon {
  width: 25px;
  color: #50647b;
  font-size: 19px;
  flex: none;
}

.field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 10px;
  color: var(--nv-ink);
  background: transparent;
  font-size: 16px;
}

.field input::placeholder { color: #6d7d8f; }

.password-toggle {
  appearance: none;
  border: 0;
  background: none;
  color: #53677c;
  cursor: pointer;
  padding: 8px;
  font-size: 16px;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 12px;
  font-size: 14px;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
}

.remember-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--nv-ink);
}

.text-link {
  color: var(--nv-login-link);
  font-weight: 600;
}

.primary-login,
.pro-login {
  width: 100%;
  min-height: 62px;
  border-radius: 15px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 25px;
  cursor: pointer;
  font-weight: 700;
  font-size: 17px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.primary-login:hover,
.pro-login:hover { transform: translateY(-1px); }

.primary-login {
  border: 0;
  color: white;
  background: var(--nv-login-primary-bg);
  box-shadow: var(--nv-login-primary-shadow);
}

.primary-login span:first-child,
.pro-login span:nth-child(2) { grid-column: 2; }

.button-arrow {
  grid-column: 3;
  justify-self: end;
  font-size: 24px;
  font-weight: 400;
}

.divider {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #728195;
  margin: 14px 0;
  font-size: 14px;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #d8e0e5;
}

.pro-login {
  border: 1.5px solid var(--nv-pro-border);
  color: var(--nv-login-pro-text);
  background: rgba(255,255,255,.72);
  box-shadow: 0 5px 14px rgba(var(--nv-brand-dark-rgb, 0, 78, 79), .04);
}

.pro-crown {
  grid-column: 1;
  justify-self: end;
  margin-right: 16px;
  color: var(--nv-pro-accent);
  font-size: 22px;
}

.new-user-card {
  margin-top: 27px;
  min-height: 82px;
  border: 1px solid #dce6e9;
  border-radius: 15px;
  padding: 15px 17px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  background: linear-gradient(110deg, var(--nv-accent-tint, #f1f7f8), #f7fafb);
}

.new-user-icon {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--nv-login-icon-text);
  background: var(--nv-login-icon-bg);
  font-size: 22px;
}

.new-user-copy strong,
.new-user-copy small { display: block; }

.new-user-copy strong {
  font-size: 15px;
  margin-bottom: 5px;
}

.new-user-copy small {
  color: #697b8c;
  font-size: 13px;
}

.new-user-arrow {
  font-size: 27px;
  color: #5f7080;
}

.login-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid #e2e8eb;
  margin-top: 36px;
  padding-top: 22px;
  color: #476075;
  font-size: 12px;
}

.login-footer nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-footer nav span {
  width: 1px;
  height: 13px;
  background: #aebbc5;
}

.login-footer small { color: #69798a; }

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

@media (max-width: 1180px) {
  .login-shell { grid-template-columns: 1fr; }
  .brand-panel { min-height: 640px; }
  .brand-content { min-height: 640px; padding-bottom: 45px; }
  .hero-copy { margin-top: 55px; }
  .login-panel { min-height: auto; padding-top: 96px; padding-bottom: 80px; }
  .login-panel::before { display: none; }
}

@media (max-width: 720px) {
  .brand-panel { min-height: 560px; }
  .brand-content { width: 88%; padding-top: 40px; }
  .brand-mark { width: 78px; height: 50px; }
  .brand-name--hero { font-size: 48px; }
  .brand-tagline { font-size: 9px; letter-spacing: .29em; }
  .hero-copy { margin-top: 45px; }
  .hero-copy h1 { font-size: 44px; }
  .hero-copy p { font-size: 17px; }
  .feature-grid { gap: 18px; }
  .feature-item:nth-child(n+5) { display: none; }
  .feature-icon { width: 48px; height: 48px; }
  .brand-footer { display: none; }

  .login-panel { padding: 82px 18px 42px; }
  .top-actions { top: 24px; right: 20px; gap: 15px; }
  .login-card { padding: 38px 22px 26px; border-radius: 22px; }
  .brand-name--card { font-size: 39px; }
  .brand-mark--card { width: 72px; }
  .brand-tagline--card { font-size: 8px; }
  .login-heading { margin-top: 36px; }
}

@media (max-width: 480px) {
  .feature-grid { grid-template-columns: 1fr; }
  .feature-item:nth-child(n+4) { display: none; }
  .brand-panel { min-height: 650px; }
  .form-options { align-items: flex-start; gap: 10px; }
  .login-footer { align-items: flex-end; }
  .login-footer nav { gap: 8px; }
}

/* Theme platform (ADR 0056): preset lockups replace mark + name in the same slots. */
.brand-lockup-image--hero { display: block; width: clamp(300px, 30vw, 420px); height: auto; }
.brand-lockup-image--card { display: block; width: 190px; height: auto; }
.brand-lockup--hero .brand-lockup-image--hero + .brand-tagline { margin-top: 16px; }
.login-preview-banner {
  position: fixed; inset: 0 0 auto 0; z-index: 50; padding: 8px 16px; text-align: center;
  color: #fff; background: #0e2034; font-size: 13px; font-weight: 700;
}

/* Environment banner (ADR 0141 §6, K5; app/_environment_banner.html). Staging and unknown
   environments only, never production. Warning semantics, not brand colours, so every theme
   preset shows it the same way. */
.nv-environment-banner {
  display: block; margin: 0; padding: 7px 16px; text-align: center;
  font-size: 13px; font-weight: 600; line-height: 1.4; letter-spacing: .01em;
  color: #3d2a00; background: #f6d987; border-bottom: 1px solid #d9b44a;
}
.nv-environment-banner strong { font-weight: 800; letter-spacing: .08em; }
.nv-environment-banner--unknown { color: #fff; background: #a63e49; border-bottom-color: #7f2d36; }
