/*
 * Sign-in and OTP pages, shared by the classic and new interfaces. Lives under /css/ because that path is
 * public (the page is shown before login; /newui/** needs a session).
 * Scoped to body.nu-auth so the classic stylesheets loaded by common/head do not need changing.
 * Colours match static/newui/newui.css.
 */
body.nu-auth {
  --eil-navy: #0b3d6e;
  --eil-navy-dark: #072c52;
  --eil-accent: #2a7ab9;
  --eil-bg: #f4f6f9;
  --eil-border: #d7dee6;
  --eil-text: #243240;
  --eil-muted: #6b7a89;
  --eil-err: #b3261e;
  margin: 0;
  min-height: 100vh;
  background: var(--eil-bg);
  color: var(--eil-text);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
}

.nu-auth-layout {
  display: grid;
  grid-template-columns: minmax(320px, 44%) minmax(0, 1fr);
  min-height: 100vh;
}
/* grid items may shrink below their content (the support image is 1187px wide) */
.nu-auth-layout > * { min-width: 0; }
body.nu-auth { min-width: 0 !important; overflow-x: hidden; }

/* ---- brand panel ---- */
.nu-auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 48px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(42, 122, 185, .55) 0, rgba(42, 122, 185, 0) 45%),
    radial-gradient(circle at 10% 90%, rgba(42, 122, 185, .35) 0, rgba(42, 122, 185, 0) 40%),
    linear-gradient(160deg, var(--eil-navy) 0%, var(--eil-navy-dark) 100%);
}
/* faint drawing-sheet grid, a nod to engineering documents */
.nu-auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.nu-auth-brand > * { position: relative; }

.nu-auth-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}
.nu-auth-logo img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  padding: 3px;
  box-sizing: border-box;
}
.nu-auth-logo .nu-auth-org {
  font-size: 13px;
  line-height: 1.35;
  opacity: .85;
}

.nu-auth-hero h1 {
  margin: 0 0 12px;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: .3px;
  color: #fff;
}
.nu-auth-hero p {
  margin: 0;
  max-width: 420px;
  font-size: 16px;
  line-height: 1.55;
  opacity: .9;
}
.nu-auth-points {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
}
.nu-auth-points li {
  color: #fff !important;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  font-size: 14px;
  opacity: .92;
}
.nu-auth-points svg {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  box-sizing: border-box;
}
.nu-auth-foot {
  font-size: 12px;
  opacity: .7;
}

/* ---- form side ---- */
.nu-auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  gap: 28px;
}
.nu-auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--eil-border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(11, 61, 110, .10);
  padding: 32px 32px 28px;
  box-sizing: border-box;
}
.nu-auth-card h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
  color: var(--eil-navy);
}
.nu-auth-card .nu-auth-sub {
  margin: 0 0 22px;
  color: var(--eil-muted);
  font-size: 13px;
}

.nu-auth-field { margin-bottom: 16px; }
.nu-auth-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--eil-text);
}
.nu-auth-input {
  position: relative;
}
.nu-auth-input svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--eil-muted);
  pointer-events: none;
}
body.nu-auth .nu-auth-input input {
  display: block;
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  padding: 0 12px 0 40px;
  border: 1px solid var(--eil-border);
  border-radius: 8px;
  background: #fff;
  color: var(--eil-text);
  font-size: 14px;
  box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
body.nu-auth .nu-auth-input input:focus {
  outline: none;
  border-color: var(--eil-accent);
  box-shadow: 0 0 0 3px rgba(42, 122, 185, .18);
}
body.nu-auth .nu-auth-input input.nu-otp {
  padding-left: 40px;
  letter-spacing: 8px;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.nu-auth-input .nu-auth-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: var(--eil-accent);
  font-size: 12px;
  cursor: pointer;
  padding: 6px 8px;
}

.nu-auth-captcha {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.nu-auth-captcha img {
  height: 44px;
  border: 1px solid var(--eil-border);
  border-radius: 6px;
  background: #fff;
}
.nu-auth-captcha button {
  border: 1px solid var(--eil-border);
  background: #fff;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: var(--eil-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nu-auth-submit {
  width: 100%;
  height: 44px;
  margin-top: 6px;
  border: 0;
  border-radius: 8px;
  background: var(--eil-navy);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background .15s;
}
.nu-auth-submit:hover { background: var(--eil-navy-dark); }
.nu-auth-submit:disabled { opacity: .75; cursor: progress; }
.nu-auth-submit .nu-auth-spin {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: nu-auth-spin .8s linear infinite;
}
.nu-auth-submit.is-busy .nu-auth-spin { display: inline-block; }
@keyframes nu-auth-spin { to { transform: rotate(360deg); } }

.nu-auth-error {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fdecea;
  border: 1px solid #f5c2bd;
  color: var(--eil-err);
  font-size: 13px;
  line-height: 1.45;
}
.nu-auth-error svg { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; }

.nu-auth-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  font-size: 13px;
}
.nu-auth-links a {
  color: var(--eil-accent) !important;
  text-decoration: none;
}
.nu-auth-links a:hover { text-decoration: underline; }

/* ---- help / support contacts ---- */
.nu-auth-help {
  width: 100%;
  max-width: 720px;
  text-align: center;
  color: var(--eil-muted);
  font-size: 13px;
}
.nu-auth-help h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--eil-text);
  text-transform: uppercase;
  letter-spacing: .6px;
}
.nu-auth-help img {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--eil-border);
}

/* ---- small screens: brand becomes a header strip ---- */
@media (max-width: 860px) {
  .nu-auth-layout { grid-template-columns: minmax(0, 1fr); }
  .nu-auth-brand { padding: 24px; gap: 16px; }
  .nu-auth-hero h1 { font-size: 28px; }
  .nu-auth-hero p { font-size: 14px; }
  .nu-auth-points, .nu-auth-foot { display: none; }
  .nu-auth-main { justify-content: flex-start; padding: 24px 16px; }
  .nu-auth-card { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .nu-auth-submit .nu-auth-spin { animation: none; }
}
