/* NEXORA AI sign-in: sapphire.
   A deep-blue console with one framed plate of glass candlesticks. Static by design (no decorative motion).
   Loaded after every other stylesheet; every rule is scoped to #loginView.nxl. */
@font-face { font-family:'Nexora Manrope'; src:url('../fonts/manrope-latin.woff2') format('woff2'); font-weight:200 800; font-style:normal; font-display:swap; }

html:has(#loginView.nxl:not([hidden])),
body:has(> #loginView.nxl:not([hidden])) { background:#040a1c; }

#loginView.nxl {
  --nxl-bg:#040a1c;
  --nxl-shell:#081226;
  --nxl-line:rgba(150,180,255,.12);
  --nxl-line-strong:rgba(150,180,255,.22);
  --nxl-text:#f4f7ff;
  --nxl-soft:#cdd9f5;
  --nxl-muted:#8fa1c7;
  --nxl-blue:#2f6bff;
  --nxl-blue-light:#8db4ff;
  --nxl-gold:#f3d9a4;
  --nxl-tg:#2aabee;
  --nxl-error:#ffa2b3;
  --nxl-sans:'Nexora Manrope',ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  position:relative;
  isolation:isolate;
  display:grid;
  place-items:center;
  min-height:100dvh;
  padding:max(32px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(32px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left));
  overflow:hidden;
  background:
    radial-gradient(980px 620px at 16% -12%,rgba(47,107,255,.3),transparent 66%),
    radial-gradient(820px 600px at 104% 106%,rgba(24,84,214,.22),transparent 66%),
    linear-gradient(180deg,#061029 0%,#030817 100%);
  color:var(--nxl-text);
  font-family:var(--nxl-sans);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  color-scheme:dark;
}
#loginView.nxl[hidden] { display:none !important; }
/* Static film grain keeps the deep gradients free of banding. */
#loginView.nxl::before {
  content:'';
  display:block;
  position:absolute;
  inset:0;
  z-index:-1;
  opacity:.04;
  transform:none;
  animation:none;
  pointer-events:none;
  -webkit-mask-image:none;
  mask-image:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size:180px 180px;
  background-repeat:repeat;
}
#loginView.nxl::after { display:none; }
#loginView.nxl *,#loginView.nxl *::before,#loginView.nxl *::after { box-sizing:border-box; }
#loginView.nxl :where(button,input) { font:inherit; }

/* ---------- Shell ---------- */
#loginView .login-shell.nxl-shell {
  position:relative;
  isolation:isolate;
  display:grid;
  grid-template-columns:minmax(0,1.12fr) minmax(380px,452px);
  width:min(100%,1120px);
  min-height:0;
  margin:0;
  padding:12px;
  overflow:hidden;
  border:1px solid var(--nxl-line);
  border-radius:32px;
  background:linear-gradient(180deg,#0b1730 0%,#070f22 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.07),0 0 0 1px rgba(0,0,0,.4),0 50px 120px -30px rgba(0,0,0,.8),0 34px 90px -44px rgba(47,107,255,.55);
}

/* ---------- Plate: the framed artwork ---------- */
#loginView .nxl-stage {
  position:relative;
  isolation:isolate;
  display:flex;
  flex-direction:column;
  min-width:0;
  min-height:600px;
  padding:28px 30px;
  overflow:hidden;
  border:1px solid rgba(175,205,255,.18);
  border-radius:21px;
  background:
    radial-gradient(86% 58% at 84% 104%,rgba(96,154,255,.5),transparent 64%),
    linear-gradient(162deg,#143c8f 0%,#0c2768 44%,#071743 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.16),inset 0 0 0 1px rgba(4,12,40,.3);
}
#loginView .nxl-stage::before {
  content:'';
  position:absolute;
  inset:0;
  z-index:-1;
  background:linear-gradient(118deg,rgba(255,255,255,.1) 0%,rgba(255,255,255,0) 30%);
  pointer-events:none;
}
#loginView .nxl-brand-row { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:38px; }
#loginView .nxl-brand { display:inline-flex; align-items:center; gap:12px; color:#fff; font-size:1rem; line-height:1.3; font-weight:700; letter-spacing:.01em; }
#loginView .nxl-brand-mark { display:grid; place-items:center; width:38px; height:38px; border:1px solid rgba(255,255,255,.3); border-radius:12px; background:linear-gradient(145deg,rgba(255,255,255,.24),rgba(255,255,255,.06)); box-shadow:inset 0 1px 0 rgba(255,255,255,.35); }
#loginView .nxl-brand-mark svg { display:block; width:26px; height:26px; fill:none; stroke:none; }
#loginView .nxl-brand-mark path { stroke:#fff; stroke-width:6.5; stroke-linecap:round; stroke-linejoin:round; }
#loginView .nxl-brand-mark .nxl-node-a { fill:#a8ccff; }
#loginView .nxl-brand-mark .nxl-node-b { fill:var(--nxl-gold); }
#loginView .nxl-brand-row .nx-pause { display:none !important; }

#loginView .nxl-intro { max-width:400px; margin-top:34px; }
#loginView .nxl-intro-title { margin:0; color:#fff; font-size:2.5rem; line-height:1.12; font-weight:600; letter-spacing:-.035em; }
#loginView .nxl-intro-text { max-width:32ch; margin:12px 0 0; color:rgba(222,232,255,.82); font-size:.9375rem; line-height:1.6; text-wrap:pretty; }

#loginView .nxl-art { position:absolute; left:0; right:0; bottom:0; z-index:-1; }
#loginView .nxl-art-svg { display:block; width:100%; height:auto; overflow:visible; fill:none; stroke:none; }
#loginView .nxl-art-grid { stroke:rgba(190,214,255,.09); stroke-width:1; }
#loginView .nxl-candle.is-up .nxl-wick { fill:#8db4ff; }
#loginView .nxl-candle.is-down .nxl-wick { fill:#3b62bd; }
#loginView .nxl-candle.is-hero .nxl-wick { fill:#eef4ff; }
#loginView .nxl-candle.is-down .nxl-gloss { opacity:.4; }
#loginView .nxl-candle.is-down .nxl-rim { opacity:.6; }
#loginView .nxl-halo { fill:#8ab6ff; opacity:.9; }
#loginView .nxl-rim { fill:none; stroke-width:1; }
#loginView .nxl-art-level { stroke-width:1.2; }
#loginView .nxl-art-mark { fill:var(--nxl-gold); }

/* ---------- Sign in ---------- */
#loginView .nxl-panel { display:flex; flex-direction:column; justify-content:center; min-width:0; padding:32px 34px 26px 42px; }
#loginView .nxl-greeting { margin:0 0 26px; text-align:left; }
#loginView .nxl-greeting h1 { margin:0; padding:0; color:var(--nxl-text); font-family:var(--nxl-sans); font-size:2rem; line-height:1.15; font-weight:600; letter-spacing:-.035em; }
#loginView .nxl-greeting p { margin:8px 0 0; color:var(--nxl-muted); font-size:.9375rem; line-height:1.6; }

#loginView .nxl-form { display:grid; gap:16px; margin:0; }
#loginView .nxl-field { min-width:0; }
#loginView .nxl-field label { display:block; margin:0 0 8px; color:var(--nxl-soft); font-size:.8125rem; line-height:1.5; font-weight:500; }
#loginView .nxl-input { position:relative; display:flex; align-items:center; }
#loginView .nxl-input-icon { position:absolute; left:15px; z-index:1; display:grid; color:#7f93bd; pointer-events:none; }
#loginView .nxl-input-icon svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; }
#loginView .nxl-input input {
  display:block;
  width:100%;
  min-width:0;
  min-height:50px;
  margin:0;
  padding:12px 14px 12px 44px;
  border:1px solid rgba(150,180,255,.16);
  border-radius:13px;
  outline:2px solid transparent;
  outline-offset:2px;
  background:rgba(3,10,30,.55);
  color:var(--nxl-text);
  font-size:1rem;
  line-height:1.5;
  letter-spacing:normal;
  box-shadow:inset 0 1px 0 rgba(0,0,0,.25);
  -webkit-appearance:none;
  appearance:none;
  transition:border-color .15s,background-color .15s,box-shadow .15s;
}
#loginView .nxl-input input::placeholder { color:#7486ad; opacity:1; letter-spacing:normal; }
#loginView .nxl-input input:hover { border-color:rgba(150,180,255,.3); }
#loginView .nxl-input input:focus { border-color:#6f9dff; background:rgba(6,16,44,.75); box-shadow:0 0 0 4px rgba(47,107,255,.24); }
#loginView .nxl-input input[aria-invalid=true] { border-color:var(--nxl-error); }
#loginView .nxl-input input[aria-invalid=true]:focus { box-shadow:0 0 0 4px rgba(251,113,133,.18); }
#loginView .nxl-input input:-webkit-autofill { -webkit-text-fill-color:var(--nxl-text); -webkit-box-shadow:0 0 0 100px #0b1a3d inset; caret-color:var(--nxl-blue-light); }
#loginView .nxl-input input.nxl-password { padding-right:52px; }
#loginView .nxl-eye { position:absolute; top:3px; right:3px; display:grid; place-items:center; width:44px; height:44px; padding:0; border:0; border-radius:10px; background:transparent; color:var(--nxl-muted); cursor:pointer; transition:background-color .15s,color .15s; }
#loginView .nxl-eye:hover,#loginView .nxl-eye[aria-pressed=true] { background:rgba(150,180,255,.1); color:var(--nxl-text); }
#loginView .nxl-eye svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; }

#loginView .nxl-form .field-error { margin:7px 0 0; color:var(--nxl-error); font-size:.8125rem; line-height:1.5; }
#loginView .nxl-form .field-error:empty { display:none; }
#loginView .nxl-form .form-message { min-height:0; margin:0; color:#ffc4cf; font-size:.875rem; line-height:1.5; text-align:left; }
#loginView .nxl-form .form-message:empty { display:none; }
#loginView .nxl-form .form-message:not(:empty) { padding:10px 12px; border:1px solid rgba(251,113,133,.32); border-radius:11px; background:rgba(251,113,133,.09); }
#loginView .nxl-form .form-message.is-success:not(:empty) { color:#c6f6e2; border-color:rgba(52,211,153,.35); background:rgba(52,211,153,.08); }

#loginView .nxl-enter {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  width:100%;
  min-height:52px;
  margin-top:4px;
  padding:12px 18px;
  border:1px solid rgba(255,255,255,.16);
  border-radius:13px;
  background:linear-gradient(180deg,#4f8cff 0%,#2f6bff 52%,#2258e2 100%);
  color:#fff;
  font-family:var(--nxl-sans);
  font-size:.9375rem;
  line-height:1.5;
  font-weight:700;
  letter-spacing:0;
  text-transform:none;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.34),0 16px 34px -14px rgba(47,107,255,.95);
  cursor:pointer;
  transition:filter .15s,box-shadow .15s,transform .15s;
}
#loginView .nxl-enter:hover { filter:brightness(1.08); box-shadow:inset 0 1px 0 rgba(255,255,255,.4),0 18px 38px -14px rgba(47,107,255,1); }
#loginView .nxl-enter:active { transform:translateY(1px); }
#loginView .nxl-enter:disabled { cursor:progress; filter:saturate(.8) brightness(.92); }
#loginView .nxl-enter.is-loading::after { content:''; flex:0 0 auto; width:16px; height:16px; border:2px solid rgba(255,255,255,.3); border-top-color:#fff; border-radius:50%; background:none; box-shadow:none; animation:nxl-spin .7s linear infinite; }
#loginView.nxl[data-paused=true] .nxl-enter.is-loading::after { animation-play-state:running !important; }

/* Telegram sign-in slot */
#loginView .nxl-or { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:14px; margin:20px 0; color:var(--nxl-muted); font-size:.8125rem; line-height:1; }
#loginView .nxl-or::before,#loginView .nxl-or::after { content:''; height:1px; background:var(--nxl-line); }
#loginView .nxl-telegram-login { display:grid; gap:10px; }
#loginView .nxl-tg { display:flex; align-items:center; gap:12px; width:100%; min-height:52px; padding:7px 12px 7px 7px; border:1px solid rgba(150,180,255,.16); border-radius:13px; background:rgba(150,180,255,.05); color:var(--nxl-text); font-size:.9375rem; line-height:1.4; font-weight:600; text-align:left; cursor:pointer; transition:background-color .15s,border-color .15s; }
#loginView .nxl-tg:hover:not(:disabled) { background:rgba(150,180,255,.1); border-color:rgba(150,180,255,.3); }
#loginView .nxl-tg-mark { display:grid; place-items:center; flex:0 0 36px; width:36px; height:36px; border-radius:10px; background:var(--nxl-tg); color:#fff; }
#loginView .nxl-tg-mark svg { width:18px; height:18px; margin-left:-2px; fill:currentColor; stroke:none; }
#loginView .nxl-tg-label { flex:1; min-width:0; }
#loginView .nxl-soon { flex:0 0 auto; padding:2px 9px; border:1px solid var(--nxl-line-strong); border-radius:999px; background:rgba(150,180,255,.06); color:var(--nxl-muted); font-size:.6875rem; line-height:1.6; font-weight:600; }
#loginView .nxl-tg:not(:disabled) .nxl-soon { display:none; }
#loginView .nxl-tg:disabled { color:var(--nxl-soft); cursor:not-allowed; }
#loginView .nxl-tg:disabled .nxl-tg-mark { background:rgba(42,171,238,.85); }
#loginView .nxl-tg-widget { display:flex; justify-content:center; min-height:44px; }
#loginView .nxl-tg-widget[hidden] { display:none !important; }

/* Newcomer path: plans and admin contact */
#loginView .nxl-newcomer { display:grid; gap:8px; margin-top:22px; padding-top:20px; border-top:1px solid var(--nxl-line); }
#loginView .nxl-panel .nex-login-access { margin:0; }
#loginView .nxl-panel .nex-login-offer { min-height:48px; padding:10px 14px; border-radius:13px; }
#loginView .nxl-panel .nex-login-offer .nex-ember-text { font-family:var(--nxl-sans); font-size:.875rem; font-weight:700; letter-spacing:0; }
/* The sign-in view is static: the offer keeps its warm finish without the ember motion. */
#loginView .nxl-panel .nex-login-offer .nex-ember-text,
#loginView .nxl-panel .nex-login-offer .nex-offer-flame,
#loginView .nxl-panel .nex-login-offer .nex-offer-ember::after { animation:none; }
#loginView .nxl-panel .nx-support { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:4px 12px; margin:0; padding:0; border:0; }
#loginView .nxl-panel .nx-support p { margin:0; color:var(--nxl-muted); font-size:.8125rem; line-height:1.5; font-weight:400; }
#loginView .nxl-panel .nx-telegram { display:inline-flex; align-items:center; gap:7px; min-height:44px; margin:0 -10px; padding:0 10px; border:0; border-radius:10px; background:none; color:#8fd3ff; font-size:.8125rem; line-height:1.5; font-weight:600; text-decoration:none; cursor:pointer; transition:background-color .15s; }
#loginView .nxl-panel .nx-telegram:hover { background:rgba(42,171,238,.1); }
#loginView .nxl-panel .nx-telegram svg { width:15px; height:15px; flex-shrink:0; fill:currentColor; stroke:none; }
#loginView .nxl-panel .nx-telegram span { overflow-wrap:anywhere; }

/* Focus and interaction */
#loginView.nxl :is(button,a):focus-visible { outline:2px solid var(--nxl-blue-light); outline-offset:3px; }
#loginView.nxl .nex-login-offer:focus-visible { outline-color:#ffcf92; }
#loginView.nxl :is(button,a) { touch-action:manipulation; -webkit-tap-highlight-color:transparent; }

@keyframes nxl-spin { to { transform:rotate(360deg); } }

/* ---------- Shorter laptop screens ---------- */
@media (min-width:961px) and (max-height:800px) {
  #loginView.nxl { padding-top:max(18px,env(safe-area-inset-top)); padding-bottom:max(18px,env(safe-area-inset-bottom)); }
  #loginView .nxl-stage { min-height:540px; padding-top:24px; }
  #loginView .nxl-intro { margin-top:24px; }
  #loginView .nxl-intro-title { font-size:2rem; }
  #loginView .nxl-panel { padding-top:22px; padding-bottom:18px; }
  #loginView .nxl-greeting { margin-bottom:20px; }
  #loginView .nxl-form { gap:14px; }
  #loginView .nxl-or { margin:15px 0; }
  #loginView .nxl-newcomer { margin-top:16px; padding-top:14px; }
}

/* ---------- Tablet and phone: plate on top, form below ---------- */
@media (max-width:960px) {
  #loginView .login-shell.nxl-shell { grid-template-columns:minmax(0,1fr); width:min(100%,540px); padding:10px; border-radius:28px; }
  #loginView .nxl-stage { min-height:0; height:clamp(150px,calc(100dvh - 612px),236px); padding:16px 18px; border-radius:19px; }
  #loginView .nxl-intro { display:none; }
  #loginView .nxl-art { top:0; left:auto; right:0; }
  #loginView .nxl-art-svg { width:auto; height:100%; }
  #loginView .nxl-panel { justify-content:flex-start; padding:24px 18px 16px; }
  #loginView .nxl-greeting { margin-bottom:20px; }
  #loginView .nxl-greeting h1 { font-size:1.75rem; }
}
@media (max-width:480px) {
  #loginView.nxl { place-items:stretch; padding:0; }
  #loginView .login-shell.nxl-shell { width:100%; min-height:100dvh; grid-template-rows:auto 1fr; padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); border:0; border-radius:0; box-shadow:none; }
  #loginView .nxl-panel { padding:20px 8px 8px; }
  #loginView .nxl-greeting { margin-bottom:18px; }
  #loginView .nxl-greeting h1 { font-size:1.625rem; }
  #loginView .nxl-greeting p { margin-top:6px; font-size:.875rem; }
  #loginView .nxl-form { gap:14px; }
  #loginView .nxl-field label { margin-bottom:6px; }
  #loginView .nxl-or { margin:14px 0; }
  #loginView .nxl-newcomer { margin-top:16px; padding-top:14px; }
}
@media (max-width:360px) {
  #loginView .nxl-panel { padding-left:4px; padding-right:4px; }
  #loginView .nxl-tg { font-size:.875rem; }
}

@media (prefers-reduced-motion:reduce) {
  #loginView.nxl *,#loginView.nxl *::before,#loginView.nxl *::after { transition:none !important; }
}
@media (forced-colors:active) {
  #loginView .nxl-enter,#loginView .nxl-tg { border:1px solid ButtonText; }
  #loginView .nxl-input input:focus { outline-color:Highlight; }
}
