/* ===== Redesigned auth screen (2026-07-20) =====
   Fully scoped under .nx-auth — does not touch the rest of the app.
   Matches the new landing/trial visual system (light, DM Sans + Manrope). */

.nx-auth {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  grid-template-columns: minmax(380px, 44%) 1fr;
  font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
  background: #f5f7f2;
  overflow: auto;
  /* app.js injects markup using these theme vars (e.g. the "Check Your Email"
     panel) — rebind them to light-theme values inside the auth screen so that
     inline style="color:var(--text-primary)" stays readable on white */
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --accent: #4f46e5;
}

/* ----- left story panel ----- */
.nx-auth-story {
  background: radial-gradient(120% 90% at 15% 10%, #12233f 0%, #0b1526 60%, #0a1120 100%);
  color: #eef2f7;
  display: flex;
  flex-direction: column;
  padding: 34px 44px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.nx-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 20px; }
.nx-brand b, .nx-mobile-brand b { color: #6366f1; }
.nx-story-body { margin: auto 0; max-width: 460px; }
.nx-eyebrow { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .18em; color: #a5b4fc; margin-bottom: 18px; }
.nx-story-body h1 { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: clamp(28px, 2.6vw, 40px); line-height: 1.15; margin: 0 0 16px; color: #f8fafc; }
.nx-story-body p { font-size: 15.5px; line-height: 1.65; color: #b6c2d4; margin: 0 0 26px; }
.nx-trust { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 13.5px; font-weight: 600; color: #86efac; }

/* ----- right form side ----- */
.nx-auth-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.nx-auth-card { width: min(430px, 100%); }
.nx-mobile-brand { display: none; align-items: center; gap: 8px; font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 19px; color: #0f172a; margin-bottom: 18px; }
.nx-heading h2 { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 26px; color: #0f172a; margin: 0 0 6px; }
.nx-heading p { font-size: 14.5px; color: #64748b; margin: 0 0 22px; }

/* tabs — app.js toggles .active on .auth-tab */
.nx-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #e9edf3; border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.nx-auth .auth-tab { border: 0; background: transparent; border-radius: 9px; padding: 11px 0; font: inherit; font-weight: 600; font-size: 14.5px; color: #64748b; cursor: pointer; transition: background .15s, color .15s; }
.nx-auth .auth-tab.active { background: #fff; color: #0f172a; box-shadow: 0 1px 4px rgba(15, 23, 42, .1); }

/* google button container (GSI renders its own iframe inside).
   min-height reserves the space BEFORE the iframe loads so the form below
   doesn't jump down mid-tap (layout-shift misclicks). */
.nx-google { display: flex; justify-content: center; margin-bottom: 4px; min-height: 44px; }
.nx-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: #94a3b8; font-size: 12.5px; }
.nx-divider::before, .nx-divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }

/* fields */
.nx-field { margin-bottom: 15px; }
.nx-field label { display: block; font-size: 13.5px; font-weight: 600; color: #334155; margin-bottom: 7px; }
.nx-field label em { font-style: normal; font-weight: 400; color: #94a3b8; font-size: 12px; }
.nx-label-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.nx-label-row label { margin-bottom: 0; }
.nx-label-row a { font-size: 12.5px; color: #4f46e5; cursor: pointer; font-weight: 600; text-decoration: none; }
.nx-auth input {
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 11px;
  padding: 13px 14px;
  font: inherit;
  font-size: 15px;
  color: #0f172a;
  transition: border-color .15s, box-shadow .15s;
}
.nx-auth input::placeholder { color: #a4afc0; }
.nx-auth input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, .14); }

/* primary button — keeps .btn-auth class (app.js queries it) */
.nx-auth .btn-auth {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 15.5px;
  padding: 14px 0;
  margin-top: 6px;
  cursor: pointer;
  transition: transform .12s, box-shadow .2s;
  box-shadow: 0 10px 24px -10px rgba(79, 70, 229, .55);
}
.nx-auth .btn-auth:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -10px rgba(79, 70, 229, .6); }
.nx-auth .btn-auth:disabled { opacity: .6; cursor: default; transform: none; }

/* forgot/reset panels */
.nx-panel-intro { text-align: center; margin-bottom: 18px; }
.nx-panel-icon { font-size: 26px; margin-bottom: 8px; }
.nx-panel-intro strong { display: block; font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 18px; color: #0f172a; margin-bottom: 4px; }
.nx-panel-intro small { font-size: 13px; color: #64748b; }
.nx-helper { text-align: center; margin: 14px 0 0; font-size: 13.5px; }
.nx-helper a, .nx-auth #forgotForm a { color: #4f46e5; cursor: pointer; font-weight: 600; text-decoration: none; }

/* generic text inside dynamically-replaced forgot form (sendReset innerHTML) */
.nx-auth #forgotForm { color: #334155; }
.nx-auth #forgotForm strong { color: #0f172a; }

.nx-trial-link { text-align: center; margin: 22px 0 0; font-size: 13.5px; color: #64748b; }
.nx-trial-link a { color: #4f46e5; font-weight: 700; text-decoration: none; }

/* ----- responsive ----- */
@media (max-width: 900px) {
  .nx-auth { grid-template-columns: 1fr; }
  .nx-auth-story { display: none; }
  .nx-mobile-brand { display: inline-flex; }
  .nx-auth-side { padding: 28px 18px 48px; align-items: flex-start; }
}

/* ===== Story panel additions to match the prototype (2026-07-20b) ===== */
.nx-auth-story { position: relative; overflow: hidden; }
.nx-story-glow {
  position: absolute; top: -80px; right: -100px; width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(99,102,241,.18) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.nx-story-glow::after {
  content: ''; position: absolute; bottom: -160px; left: -60px; width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(165,180,252,.12) 0%, transparent 70%);
  border-radius: 50%;
}
.nx-story-body { position: relative; z-index: 1; }

.nx-preview-row { display: flex; gap: 12px; margin: 22px 0 20px; }
.nx-preview-card, .nx-preview-stat {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; padding: 12px 14px; flex: 1;
}
.nx-preview-card span { display: block; font-size: 11.5px; color: #94a3b8; margin-bottom: 6px; }
.nx-preview-card strong { display: block; font-size: 13.5px; font-weight: 700; color: #f1f5f9; margin-bottom: 8px; }
.nx-preview-card i { display: block; height: 5px; background: rgba(255,255,255,.12); border-radius: 3px; overflow: hidden; }
.nx-preview-card i b { display: block; height: 100%; background: linear-gradient(90deg,#a5b4fc,#818cf8); border-radius: 3px; }
.nx-preview-stat { display: flex; flex-direction: column; justify-content: center; }
.nx-preview-stat strong { font-size: 19px; font-weight: 800; color: #86efac; }
.nx-preview-stat span { font-size: 11px; color: #94a3b8; line-height: 1.3; margin-top: 2px; }

/* ----- form-side additions ----- */
.nx-back-home { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #64748b; text-decoration: none; font-weight: 600; margin-bottom: 18px; }
.nx-back-home:hover { color: #4f46e5; }
.nx-kicker { display: block; font-size: 11px; font-weight: 800; letter-spacing: .14em; color: #4f46e5; margin-bottom: 6px; }

.nx-password-field { position: relative; display: block; }
.nx-password-field input { padding-right: 60px; }
.nx-reveal {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: #4f46e5; font: inherit; font-weight: 700; font-size: 12.5px;
  padding: 6px 8px; cursor: pointer;
}

.nx-remember-row { display: flex; align-items: center; gap: 8px; margin: -4px 0 4px; font-size: 13px; color: #475569; cursor: pointer; }
.nx-remember-row input { width: 16px; height: 16px; accent-color: #4f46e5; }

@media (max-width: 900px) {
  .nx-preview-row { display: none; }
}
