/* ─────────────────────────────────────────────────────────────────────────────
   SPNR Auth Pages — Login / Register / Forgot / Reset
   Design: Photo-left with deep ink overlay panel + clean clinical right form
   Fonts: Barlow Condensed (display) + IBM Plex Mono (labels) loaded via header
───────────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:        #050f1f;
  --ink-mid:    #0d2b5e;
  --blue:       #1a5fa8;
  --blue-light: #2575cc;
  --blue-pale:  #deeaf8;
  --red:        #cc2229;
  --red-dark:   #a81b20;
  --white:      #ffffff;
  --off-white:  #f5f7fa;
  --rule:       #dde3ed;
  --text:       #050f1f;
  --muted:      #6b7fa3;
  --success:    #16a34a;
  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body:    'Source Serif 4', Georgia, serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;
  --radius:     4px;
  --shadow:     0 8px 40px rgba(5,15,31,.15), 0 2px 8px rgba(5,15,31,.08);
}

html, body {
  height: 100%; min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px; line-height: 1.6;
  color: var(--text);
  background: var(--off-white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Hide site header/footer on auth pages */
.nex-auth-body .nex-header,
.nex-auth-body .nex-footer,
.nex-auth-body .nex-bottom-nav,
.nex-auth-body .nex-drawer,
.nex-auth-body .nex-drawer-overlay,
.nex-auth-body #wpadminbar { display: none !important; }
.nex-auth-body { margin-top: 0 !important; padding-top: 0 !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   OUTER WRAPPER — left photo panel + right form
═══════════════════════════════════════════════════════════════════════════ */
.nex-auth-wrap {
  display: grid;
  grid-template-columns: 1fr clamp(420px, 42vw, 560px);
  min-height: 100vh;
  overflow: hidden; /* prevent any panel from bleeding outside */
  width: 100%;
  position: relative;
}

/* Centered variant for password reset / single-column */
.nex-auth-wrap--centered {
  grid-template-columns: 1fr;
  place-items: center;
  background: var(--ink);
  padding: 24px 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LEFT PANEL — hero photo with overlay content
═══════════════════════════════════════════════════════════════════════════ */
.nex-auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;           /* never exceed grid column */
  min-width: 0;          /* allow grid to constrain it */
}

/* The actual hero photo */
.nex-auth-brand__photo {
  position: absolute;
  inset: 0;
  /* background-image set via inline style in PHP template */
  background-size: cover;
  background-position: center center;
  z-index: 0;
}

/* Dark overlay for readability */
.nex-auth-brand__photo::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    160deg,
    rgba(5,15,31,.82) 0%,
    rgba(13,43,94,.70) 40%,
    rgba(5,15,31,.88) 100%
  );
}

/* Red accent stripe */
.nex-auth-brand::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--red), rgba(204,34,41,.2));
  z-index: 3;
}

/* Everything inside left panel stacks above overlay */
.nex-auth-brand > * { position: relative; z-index: 2; }

/* Logo at top */
.nex-auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 32px 40px 0;
  flex-shrink: 0;
}
.nex-auth-logo-img {
  height: 52px;
  width: auto;
  /* white version of logo on dark bg — use filter to ensure visibility */
  filter: brightness(0) invert(1);
}

/* Bottom content block */
.nex-auth-brand-content {
  margin-top: auto;
  padding: 40px;
}
.nex-auth-brand-content h2 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  text-transform: uppercase;
  letter-spacing: -.02em;
  line-height: .95;
  color: var(--white);
  margin-bottom: 16px;
}
.nex-auth-brand-content h2 em {
  color: var(--red);
  font-style: normal;
  display: block;
}

/* Tagline */
.nex-auth-tagline {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: .12em;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 24px;
}
.nex-auth-tagline::before {
  content: '';
  display: inline-block;
  width: 24px; height: 2px;
  background: var(--red);
  flex-shrink: 0;
}

/* Feature list */
.nex-auth-features {
  list-style: none;
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 32px;
}
.nex-auth-features li {
  display: flex; align-items: flex-start; gap: 10px;
  font-family: var(--font-body);
  font-size: .9rem;
  color: rgba(222,234,248,.82);
  line-height: 1.4;
}
.nex-auth-features li::before {
  content: '✓';
  color: var(--red);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Stats row */
.nex-auth-stats {
  display: flex; gap: 0;
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 24px;
}
.nex-auth-stat {
  flex: 1;
  border-right: 1px solid rgba(255,255,255,.08);
  padding-right: 16px;
  margin-right: 16px;
}
.nex-auth-stat:last-child { border-right: none; margin-right: 0; }
.nex-auth-stat span {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.8rem;
  color: var(--white);
  line-height: 1;
  letter-spacing: -.02em;
}
.nex-auth-stat small {
  font-family: var(--font-mono);
  font-size: .58rem;
  color: rgba(222,234,248,.4);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-top: 4px;
  display: block;
}

/* Testimonial */
.nex-auth-testimonial {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
}
.nex-auth-testimonial__stars { color: var(--red); font-size: .8rem; margin-bottom: 6px; letter-spacing: 2px; }
.nex-auth-testimonial__text {
  font-family: var(--font-body);
  font-size: .875rem;
  font-style: italic;
  color: rgba(222,234,248,.85);
  line-height: 1.55;
  margin-bottom: 10px;
}
.nex-auth-testimonial__author {
  display: flex; align-items: center; gap: 10px;
}
.nex-auth-testimonial__avatar {
  width: 30px; height: 30px;
  background: var(--blue);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: .9rem; font-weight: 900;
  color: var(--white);
  text-transform: uppercase; flex-shrink: 0;
}
.nex-auth-testimonial__name {
  font-family: var(--font-body);
  font-size: .8rem; font-weight: 600;
  color: rgba(222,234,248,.8);
}
.nex-auth-testimonial__badge {
  font-family: var(--font-mono);
  font-size: .58rem; font-weight: 700;
  background: var(--red); color: var(--white);
  padding: 2px 6px; border-radius: 2px;
  text-transform: uppercase; letter-spacing: .06em;
  display: inline-block; margin-top: 2px;
}

/* Brand footer */
.nex-auth-brand-footer {
  font-family: var(--font-mono);
  font-size: .62rem;
  color: rgba(222,234,248,.3);
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: 0 40px 28px;
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.nex-auth-brand-footer::before {
  content: '';
  display: inline-block;
  width: 16px; height: 1px;
  background: rgba(255,255,255,.2);
}

/* Hero img — not used in new design (using CSS bg instead) */
.nex-auth-hero-visual { display: none; }
.nex-auth-hero-img { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   RIGHT PANEL — form
═══════════════════════════════════════════════════════════════════════════ */
.nex-auth-form-wrap {
  background: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 56px;
  position: relative;
  border-left: 1px solid var(--rule);
  overflow-y: auto;
  min-width: 0;          /* allow grid to constrain it */
  width: 100%;
  /* Ensure the panel is always fully opaque and above the left panel */
  z-index: 2;
  isolation: isolate;
}

/* Red top accent bar */
.nex-auth-form-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--blue));
}

/* SPNR badge in form panel */
.nex-auth-form-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: .65rem; font-weight: 600;
  color: var(--blue);
  background: var(--blue-pale);
  border: 1px solid rgba(26,95,168,.2);
  padding: 5px 12px;
  border-radius: 2px;
  text-transform: uppercase; letter-spacing: .1em;
  margin-bottom: 28px;
  width: fit-content;
}
.nex-auth-form-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--blue);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Card header */
.nex-auth-card-header {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.nex-auth-card-header h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.4rem;
  text-transform: uppercase;
  letter-spacing: -.01em;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 6px;
}
.nex-auth-card-header p {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0;
}

/* Mobile logo (hidden on desktop) */
.nex-auth-mobile-logo { display: none !important; }

/* Alert / error box */
.nex-auth-alert {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: .875rem;
  line-height: 1.5;
  margin-bottom: 20px;
  border-left: 3px solid var(--red);
  background: rgba(204,34,41,.06);
  color: var(--red);
}
.nex-auth-alert--success {
  border-left-color: var(--success);
  background: rgba(22,163,74,.06);
  color: #15803d;
}

/* Form */
.nex-auth-form { display: flex; flex-direction: column; gap: 18px; }

/* Field */
.nex-auth-field { display: flex; flex-direction: column; gap: 6px; }
.nex-auth-field label {
  font-family: var(--font-mono);
  font-size: .65rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink);
  display: flex; align-items: center; justify-content: space-between;
}
.nex-auth-field-link {
  font-family: var(--font-mono);
  font-size: .62rem;
  color: var(--blue);
  text-decoration: none;
  letter-spacing: .04em;
  font-weight: 400; text-transform: none;
  transition: color .15s;
}
.nex-auth-field-link:hover { color: var(--red); }

.nex-auth-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Input wrap */
.nex-auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.nex-auth-input-wrap input,
.nex-auth-input-wrap select {
  width: 100%;
  height: 48px;
  background: var(--off-white);
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .9rem;
  color: var(--ink);
  padding: 0 16px 0 44px;
  transition: border-color .15s, background .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
  outline: none;
}
.nex-auth-input-wrap input:focus,
.nex-auth-input-wrap select:focus {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(26,95,168,.1);
}
.nex-auth-input-wrap input::placeholder { color: var(--muted); font-style: italic; }
.nex-auth-input-wrap input.is-error { border-color: var(--red); }
.nex-auth-input-wrap input.is-ok    { border-color: var(--success); }

.nex-auth-icon {
  position: absolute; left: 14px;
  width: 16px; height: 16px;
  color: var(--muted);
  pointer-events: none;
  flex-shrink: 0;
  z-index: 1;
}

/* No icon on some inputs */
.nex-auth-input-wrap input.no-icon { padding-left: 16px; }

/* Select */
.nex-auth-select-wrap::after {
  content: '▾';
  position: absolute; right: 14px;
  font-size: .7rem; color: var(--muted);
  pointer-events: none;
}
.nex-auth-select-wrap select { padding-right: 32px; cursor: pointer; }

/* Password toggle */
.nex-auth-toggle-pass {
  position: absolute; right: 12px;
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  padding: 6px;
  display: flex; align-items: center;
  transition: color .15s;
}
.nex-auth-toggle-pass:hover { color: var(--blue); }
.nex-auth-toggle-pass svg { width: 16px; height: 16px; }

/* Password strength */
.nex-pw-strength { margin-top: 8px; }
.nex-pw-bars { display: flex; gap: 4px; margin-bottom: 5px; }
.nex-pw-bars div { flex: 1; height: 3px; background: var(--rule); border-radius: 2px; transition: background .25s; }
.nex-pw-label { font-family: var(--font-mono); font-size: .62rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.nex-pw-strength.strength-1 .nex-pw-bars div:nth-child(1) { background: var(--red); }
.nex-pw-strength.strength-2 .nex-pw-bars div:nth-child(-n+2) { background: #f59e0b; }
.nex-pw-strength.strength-3 .nex-pw-bars div:nth-child(-n+3) { background: #3b82f6; }
.nex-pw-strength.strength-4 .nex-pw-bars div { background: var(--success); }

/* Remember / terms checkbox row */
.nex-auth-row { display: flex; align-items: center; }
.nex-auth-check {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer; user-select: none;
}
.nex-auth-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--blue);
  flex-shrink: 0; margin-top: 2px;
  cursor: pointer;
}
.nex-auth-check span {
  font-family: var(--font-body);
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.4;
}
.nex-auth-check span a { color: var(--blue); text-decoration: underline; }
.nex-auth-check span a:hover { color: var(--red); }

/* Primary button */
.nex-auth-btn {
  width: 100%; height: 52px;
  background: var(--red);
  color: var(--white);
  border: 2px solid var(--red);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  gap: 8px;
  transition: all .2s;
  text-decoration: none;
  margin-top: 4px;
}
.nex-auth-btn:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(204,34,41,.3);
}
.nex-auth-btn-outline {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
  margin-top: 0;
}
.nex-auth-btn-outline:hover {
  background: var(--blue);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(26,95,168,.2);
}
.nex-auth-btn[disabled] { opacity: .5; pointer-events: none; }

/* Spinner */
.nex-spin { animation: nex-spin 1s linear infinite; }
@keyframes nex-spin { to { transform: rotate(360deg); } }
.nex-auth-btn-loader svg { width: 18px; height: 18px; }

/* Divider */
.nex-auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0 16px;
}
.nex-auth-divider::before,
.nex-auth-divider::after {
  content: ''; flex: 1;
  height: 1px; background: var(--rule);
}
.nex-auth-divider span {
  font-family: var(--font-mono);
  font-size: .62rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
  white-space: nowrap;
}

/* Form footer note */
.nex-auth-form-note {
  font-family: var(--font-mono);
  font-size: .62rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

/* Centered card (forgot/reset) */
.nex-auth-card {
  width: 100%;
  max-width: 440px;
}
.nex-auth-card--standalone {
  background: var(--white);
  border-radius: 6px;
  padding: 48px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--red);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .nex-auth-wrap {
    grid-template-columns: 1fr;  /* single column — form only */
  }
  .nex-auth-brand {
    display: none; /* hide left panel — show only form */
  }
  .nex-auth-form-wrap {
    padding: 40px 28px;
    min-height: 100vh;
    border-left: none;
    justify-content: flex-start;
    padding-top: 48px;
  }
  /* Show mobile logo instead */
  .nex-auth-mobile-logo { display: flex !important; }
  .nex-auth-field-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .nex-auth-form-wrap { padding: 32px 20px; }
  .nex-auth-card-header h1 { font-size: 2rem; }
}
