/* NEXUS Single Sign-On — matches the Figma "NEXUS SSO" frames (2000 × 928). */
@font-face { font-family: 'Lato'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/lato-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/lato-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-weight: 900; font-style: normal; font-display: swap; src: url('../fonts/lato-latin-900-normal.woff2') format('woff2'); }

:root {
  --nx-blue: #003399;
  --nx-blue-hover: #002a80;
  --nx-blue-press: #00226a;
  --nx-text: #1b1b1b;
  --nx-placeholder: #6e6e6e;
  --nx-footer: #f3f2f1;
  --nx-error: #c50f1f;
  --nx-error-bg: #fdf3f4;
  --nx-required: #d13438;
  --nx-panel: 37.5%;
  --nx-form: 416px;
  /* Background photo fade. The placeholder background.jpg already has the blue fade baked in (cropped from the Figma export),
     so this is 0. When you replace it with the original photo, set this to 1. */
  --nx-hero-fade: 0;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Lato', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--nx-text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

.sso { display: flex; min-height: 100vh; min-height: 100dvh; }

.sso-panel {
  flex: 0 0 var(--nx-panel);
  min-width: 480px;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.sso-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: var(--nx-form);
  max-width: calc(100% - 32px);
  margin: 0 auto;
  padding: 80px 0 40px;
}

.sso-footer {
  height: 42px;
  display: flex;
  align-items: center;
  padding: 0 21px;
  background: var(--nx-footer);
  color: var(--nx-blue);
  font-size: 10.5px;
  flex-shrink: 0;
}

.sso-hero {
  flex: 1;
  position: relative;
  background: #1a408c url('../img/background.jpg') center / cover no-repeat;
}
/* Blue fade from the Figma design — controlled by --nx-hero-fade above. */
.sso-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 51, 153, 0) 55%, rgba(0, 51, 153, .55) 82%, rgba(0, 51, 153, .9) 100%);
  opacity: var(--nx-hero-fade);
}

/* ---------- Wordmark ---------- */
.brand { display: inline-flex; flex-direction: column; align-items: flex-end; align-self: flex-start; margin-bottom: 25px; }
.brand-img { height: 36px; width: auto; }
.brand-word {
  font-weight: 900;
  font-size: 30px;
  line-height: 24px;
  letter-spacing: .5px;
  color: #000;
}
.brand-sub { font-size: 10px; line-height: 12px; margin-top: 1px; color: #000; }

/* ---------- Headings ---------- */
.sso-title {
  margin: 0 0 19px;
  font-size: 22px;
  line-height: 26px;
  font-weight: 700;
  color: var(--nx-blue);
}
.sso-title--tight { margin-bottom: 0; }
.sso-subtitle { margin: 0 0 18px; font-size: 15px; line-height: 18px; color: var(--nx-blue); word-break: break-all; }
.sso-section { font-size: 15px; margin: 6px 0 10px; color: var(--nx-blue); }

/* ---------- Form ---------- */
.sso-form { display: flex; flex-direction: column; margin: 0; }
.sso-label { font-size: 13px; line-height: 16px; margin: 0 0 7px 1px; }
.req { color: var(--nx-required); margin-left: 1px; }

.sso-input {
  width: 100%;
  height: 31px;
  margin: 0 0 21px;
  padding: 0 6px;
  font: inherit;
  font-size: 13px;
  color: var(--nx-text);
  background: #fff;
  border: 1.5px solid var(--nx-blue);
  border-radius: 5px;
  outline: none;
}
.sso-input::placeholder { color: var(--nx-placeholder); opacity: 1; }
.sso-input:focus-visible { box-shadow: 0 0 0 2px rgba(0, 51, 153, .25); }
.sso-input[aria-invalid='true'] { border-color: var(--nx-error); }

.sso-select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.sso-select:invalid, .sso-select.is-empty { color: var(--nx-placeholder); }
.sso-select option { color: var(--nx-text); }

.sso-link {
  align-self: flex-start;
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 16px;
  color: var(--nx-blue);
  text-decoration: none;
}
.sso-link:hover, .sso-link:focus-visible { text-decoration: underline; }

.sso-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 36px;
  margin: 1px 0 0;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  color: #fff;
  background: var(--nx-blue);
  border: 0;
  border-radius: 5px;
  text-decoration: none;
  cursor: pointer;
}
.sso-btn:hover { background: var(--nx-blue-hover); }
.sso-btn:active { background: var(--nx-blue-press); }
.sso-btn:focus-visible { outline: 2px solid #000; outline-offset: 2px; }
.sso-btn[disabled], .sso-btn.is-loading { cursor: progress; background: var(--nx-blue); opacity: .85; }
.sso-btn--secondary { background: #fff; color: var(--nx-blue); border: 1.5px solid var(--nx-blue); margin-bottom: 12px; }
.sso-btn--secondary:hover { background: #f0f4fb; }
.sso-btn + .sso-btn, .sso-btn + .sso-form { margin-top: 12px; }

.sso-error {
  margin: -6px 0 18px;
  padding: 9px 11px;
  font-size: 13px;
  line-height: 18px;
  color: var(--nx-error);
  background: var(--nx-error-bg);
  border-left: 3px solid var(--nx-error);
  border-radius: 2px;
}
.sso-text, .sso-help { font-size: 13px; line-height: 19px; margin: -6px 0 20px; }
.sso-help { color: #444; margin-top: 0; }

/* ---------- Welcome ---------- */
.sso-welcome { display: flex; align-items: center; gap: 21px; margin: 0 0 21px; }
.sso-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #e8ecf5; }
.sso-welcome-name { margin: 0; font-size: 20px; line-height: 24px; font-weight: 400; color: #000; }
.sso-welcome-meta { margin: 0; font-size: 12px; line-height: 16px; color: var(--nx-blue); }
.sso-btn--busy { cursor: progress; }

/* ---------- MFA enrolment ---------- */
.sso-enrol { display: flex; gap: 16px; align-items: flex-start; margin: 0 0 12px; }
.sso-qr { border: 1px solid #d6d6d6; border-radius: 4px; padding: 4px; background: #fff; flex-shrink: 0; }
.sso-steps { margin: 0; padding-left: 18px; font-size: 13px; line-height: 19px; }
.sso-steps li + li { margin-top: 4px; }
.sso-manual { font-size: 12px; margin: 0 0 18px; }
.sso-manual summary { cursor: pointer; color: var(--nx-blue); }
.sso-secret { display: block; margin-top: 8px; padding: 8px 10px; background: #f3f2f1; border-radius: 4px; font-size: 13px; letter-spacing: 1px; word-break: break-all; user-select: all; }

/* ---------- Portal ---------- */
.sso-apps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.sso-app { display: block; padding: 10px 12px; border: 1.5px solid var(--nx-blue); border-radius: 5px; text-decoration: none; color: var(--nx-blue); }
.sso-app:hover, .sso-app:focus-visible { background: #f0f4fb; }
.sso-app-name { display: block; font-weight: 700; font-size: 14px; }
.sso-app-desc { display: block; font-size: 12px; color: #444; margin-top: 2px; }

/* ---------- Small screens: form only ---------- */
@media (max-width: 900px) {
  .sso-hero { display: none; }
  .sso-panel { flex: 1; min-width: 0; }
  .sso-content { padding: 48px 0 32px; }
}
@media (prefers-reduced-motion: no-preference) {
  .sso-btn { transition: background-color .12s ease; }
}
