@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/inter/Inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/inter/Inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ─────────────────────────────────────────────────────────
   Design tokens
───────────────────────────────────────────────────────── */
:root {
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-brand-panel: #9a9a99;
  --color-brand-panel-2: #8c8c8b;
  --color-ink: #0e1626;
  --color-ink-soft: #2a3142;
  --color-text: #1a1f2c;
  --color-text-muted: #6b7280;
  --color-text-faint: #9aa0a8;
  --color-divider: #e6e7ea;
  --color-input-bg: #f1f2f4;
  --color-input-bg-focus: #ffffff;
  --color-input-border: transparent;
  --color-input-border-focus: #0e1626;
  --color-on-brand: #ffffff;

  --color-danger: #b42318;
  --color-danger-soft: #fdecea;
  --color-danger-border: #f0c2bd;

  --color-focus-ring: rgba(14, 22, 38, 0.18);

  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;

  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;

  --shadow-sm: 0 1px 2px rgba(14, 22, 38, 0.04);
  --shadow-focus: 0 0 0 3px var(--color-focus-ring);

  --form-col-width: 360px;
}

/* ─────────────────────────────────────────────────────────
   Reset / base
───────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button {
  font-family: inherit;
}
a {
  color: inherit;
}

/* ─────────────────────────────────────────────────────────
   Layout — split 50/50
───────────────────────────────────────────────────────── */
.page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* Left: brand panel */
.brand {
  position: relative;
  background: linear-gradient(180deg, var(--color-brand-panel) 0%, var(--color-brand-panel-2) 100%);
  color: var(--color-on-brand);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-12);
}

.brand__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
  pointer-events: none;
}

.brand__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 480px;
}
.brand__mark {
  font-weight: 300;
  font-size: 30px;
  letter-spacing: 0.04em;
  line-height: 1.1;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}
.brand__logo {
  height: 64px;
  width: auto;
  display: block;
  margin: -19px -6px;
}
.brand__mark .dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
  opacity: 0.6;
  flex: 0 0 auto;
}
.brand__tagline {
  margin-top: var(--s-5);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: 0.92;
}

/* Right: form column */
.form-side {
  background: var(--color-surface);
  display: grid;
  grid-template-rows: 1fr auto;
  padding: var(--s-12) var(--s-10);
}
.form-side__inner {
  width: 100%;
  max-width: var(--form-col-width);
  margin: auto;
}

/* ─────────────────────────────────────────────────────────
   Headings
───────────────────────────────────────────────────────── */
.title {
  font-size: 26px;
  font-weight: 600;
  color: var(--color-ink);
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-2);
  line-height: 1.25;
}
.subtitle {
  margin: 0 0 var(--s-8);
  color: var(--color-text-muted);
  font-size: 13px;
}

/* ─────────────────────────────────────────────────────────
   Banner (general error)
───────────────────────────────────────────────────────── */
.banner {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  background: var(--color-danger-soft);
  border: 1px solid var(--color-danger-border);
  color: var(--color-danger);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: var(--s-6);
}
.banner__icon {
  flex: 0 0 16px;
  margin-top: 2px;
  width: 16px;
  height: 16px;
}
.banner__text {
  line-height: 1.45;
}
.banner__text strong {
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────
   Form
───────────────────────────────────────────────────────── */
form {
  margin: 0;
}
.field {
  margin-bottom: var(--s-5);
}
.field__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-ink-soft);
  margin-bottom: var(--s-2);
}
.field__input-wrap {
  position: relative;
}
.field__input {
  width: 100%;
  height: 44px;
  padding: 0 var(--s-4);
  font: inherit;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-input-bg);
  border: 1px solid var(--color-input-border);
  border-radius: var(--radius-sm);
  transition:
    background 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
  appearance: none;
  outline: none;
}
.field__input::placeholder {
  color: var(--color-text-faint);
}
.field__input:hover {
  background: #ecedf0;
}
.field__input:focus {
  background: var(--color-input-bg-focus);
  border-color: var(--color-input-border-focus);
  box-shadow: var(--shadow-focus);
}
.field__input[type="password"],
.field__input.has-toggle {
  padding-right: 44px;
}

.field__toggle {
  position: absolute;
  top: 50%;
  right: var(--s-3);
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius-xs);
}
.field__toggle:hover {
  color: var(--color-ink);
}
.field__toggle:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.field__toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Blazor ValidationMessage rendered as field__error */
.field__error,
.validation-message {
  font-size: 12px;
  color: var(--color-danger);
  margin-top: var(--s-2);
  line-height: 1.4;
}

/* Apply invalid input styling only when error text is actually present */
.field:has(.field__error:not(:empty)) .field__input,
.field:has(.validation-message:not(:empty)) .field__input {
  background: #fff;
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.1);
}

/* Row: remember me */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-6);
  gap: var(--s-4);
}
.check {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.check input {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid #c8ccd2;
  border-radius: var(--radius-xs);
  background: #fff;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition:
    background 120ms ease,
    border-color 120ms ease;
}
.check input:hover {
  border-color: var(--color-ink);
}
.check input:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.check input:checked {
  background: var(--color-ink);
  border-color: var(--color-ink);
}
.check input:checked::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.link {
  font-size: 13px;
  color: var(--color-ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.link:hover {
  color: var(--color-ink);
}
.link:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: 2px;
}

/* ─────────────────────────────────────────────────────────
   Primary button
───────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  height: 48px;
  background: var(--color-ink);
  color: #fff;
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 140ms ease,
    transform 80ms ease,
    opacity 140ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  position: relative;
}
.btn-primary:hover {
  background: #1a2336;
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-primary:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.btn-primary:disabled {
  cursor: progress;
  opacity: 0.92;
}

.btn-primary__label,
.btn-primary__spinner {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.btn-primary__spinner {
  display: none;
}
.btn-primary.is-loading .btn-primary__label {
  visibility: hidden;
}
.btn-primary.is-loading .btn-primary__spinner {
  display: inline-flex;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
}
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-top-color: #fff;
  animation: spin 720ms linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─────────────────────────────────────────────────────────
   Divider
───────────────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin: var(--s-8) 0 var(--s-5);
  color: var(--color-text-faint);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-divider);
}

/* ─────────────────────────────────────────────────────────
   External providers
───────────────────────────────────────────────────────── */
.providers {
  display: grid;
  gap: var(--s-3);
}
.btn-provider {
  width: 100%;
  height: 44px;
  background: #fff;
  color: var(--color-ink);
  border: 1px solid #d8dbe0;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  transition:
    background 120ms ease,
    border-color 120ms ease;
  text-decoration: none;
}
.btn-provider:hover {
  background: #f7f8f9;
  border-color: #c2c6cd;
}
.btn-provider:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.btn-provider svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

/* ─────────────────────────────────────────────────────────
   Footer
───────────────────────────────────────────────────────── */
.footer {
  margin-top: var(--s-12);
  padding-top: var(--s-6);
  border-top: 1px solid var(--color-divider);
  color: var(--color-text-faint);
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  letter-spacing: 0.06em;
}
.footer__brand b {
  font-weight: 700;
  color: var(--color-text-muted);
}
.footer__logo {
  height: 28px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
  margin: -8px -4px;
  opacity: 0.85;
}
.footer__legal a {
  color: var(--color-text-muted);
  text-decoration: none;
}
.footer__legal a:hover {
  text-decoration: underline;
}
.footer__sep {
  color: #d4d7dc;
  margin: 0 var(--s-2);
}

/* ─────────────────────────────────────────────────────────
   404 — content side
───────────────────────────────────────────────────────── */
.content-side {
  background: var(--color-surface);
  display: grid;
  grid-template-rows: 1fr auto;
  padding: var(--s-12) var(--s-10);
}
.content-side__inner {
  width: 100%;
  max-width: 440px;
  margin: auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--s-6);
}
.eyebrow .pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-ink);
  display: inline-block;
}

.error-code {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(96px, 14vw, 168px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--color-ink);
  margin: 0 0 var(--s-4);
  display: inline-flex;
  align-items: baseline;
}
.error-code .mid {
  font-weight: 600;
  display: inline-block;
  position: relative;
  margin: 0 0.04em;
}
.error-code .mid::before {
  content: "";
  position: absolute;
  inset: -10% -14%;
  border: 1px solid var(--color-divider);
  border-radius: 999px;
  transform: rotate(-6deg);
  pointer-events: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-bottom: var(--s-8);
}
.btn {
  height: 48px;
  padding: 0 var(--s-6);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  text-decoration: none;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 80ms ease;
}
.btn svg {
  width: 14px;
  height: 14px;
}
/* .btn + .btn-primary overrides the full-width login button when used together */
.btn.btn-primary {
  width: auto;
  background: var(--color-ink);
  color: #fff;
  border: 1px solid var(--color-ink);
}
.btn.btn-primary:hover {
  background: #1a2336;
}
.btn.btn-primary:active {
  transform: translateY(1px);
}
.btn.btn-primary:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.btn-secondary {
  background: #fff;
  color: var(--color-ink);
  border: 1px solid #d8dbe0;
}
.btn-secondary:hover {
  background: #f7f8f9;
  border-color: #c2c6cd;
}
.btn-secondary:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.meta {
  border-top: 1px solid var(--color-divider);
  padding-top: var(--s-5);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-2) var(--s-5);
  font-size: 12px;
}
.meta dt {
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  font-size: 10px;
  padding-top: 3px;
}
.meta dd {
  margin: 0;
  color: var(--color-ink-soft);
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Consolas, monospace;
  word-break: break-all;
}

/* ─────────────────────────────────────────────────────────
   Responsive
───────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .form-side {
    padding: var(--s-10) var(--s-8);
  }
  .content-side {
    padding: var(--s-10) var(--s-8);
  }
  .brand {
    padding: var(--s-10);
  }
  .brand__mark {
    font-size: 28px;
  }
  .brand__logo {
    height: 58px;
    margin: -17px -6px;
  }
}

@media (max-width: 1024px) {
  .page {
    grid-template-columns: 44% 56%;
  }
  .form-side {
    padding: var(--s-10) var(--s-6);
  }
  .content-side {
    padding: var(--s-10) var(--s-6);
  }
  .brand__mark {
    font-size: 24px;
    gap: 12px;
  }
  .brand__logo {
    height: 50px;
    margin: -14px -5px;
  }
  .title {
    font-size: 24px;
  }
}

@media (max-width: 768px) {
  .page {
    grid-template-columns: 1fr;
    grid-template-rows: 220px 1fr;
  }
  .brand {
    padding: var(--s-6);
  }
  .brand__mark {
    font-size: 20px;
    gap: 10px;
  }
  .brand__logo {
    height: 42px;
    margin: -12px -4px;
  }
  .brand__tagline {
    font-size: 10px;
    margin-top: var(--s-3);
  }
  .form-side {
    padding: var(--s-8) var(--s-5);
  }
  .form-side__inner {
    max-width: 100%;
  }
  .content-side {
    padding: var(--s-8) var(--s-5);
  }
  .content-side__inner {
    max-width: 100%;
  }
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
  .actions .btn {
    flex: 1 1 auto;
  }
}
