/* Scoped entirely to the unauthenticated login view. No operational UI changes. */
html:not(.nexus-authenticated) body{margin:0!important;overflow-x:hidden}
#nexus-auth-root{
 position:relative;isolation:isolate;box-sizing:border-box;
 min-height:100vh;min-height:100dvh;
 width:100%;padding:24px clamp(16px,3vw,44px) clamp(18px,3vh,36px);
 display:flex;flex-direction:column;align-items:center;justify-content:space-between;
 background-color:#220936;
 background-image:linear-gradient(180deg,rgba(25,3,45,.10) 0%,rgba(45,1,53,.03) 40%,rgba(29,2,36,.12) 100%),url('/assets/nexus-login-scene.svg');
 background-size:cover;background-position:center;
 color:#fff;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
 overflow:hidden
}
#nexus-auth-root::before{
 content:"";position:absolute;z-index:-1;inset:0;
 background:linear-gradient(90deg,transparent 18%,rgba(35,4,62,.12) 38%,rgba(35,4,62,.12) 62%,transparent 83%);
 pointer-events:none
}
#nexus-auth-root .nx-login-hero{
 position:relative;z-index:1;text-align:center;width:min(900px,100%);
 display:flex;flex-direction:column;align-items:center;
 padding-top:clamp(0px,1vh,12px);
 text-shadow:0 3px 18px rgba(22,0,34,.6)
}
#nexus-auth-root .nx-login-logo{
 position:relative;display:block;width:max-content;
 font-size:clamp(67px,7.2vw,132px);line-height:.90;
 letter-spacing:-.105em;font-style:italic;font-weight:950;
 transform:skew(-9deg);padding-right:.20em;
 color:#fff;background:linear-gradient(180deg,#fff 2%,#f4effb 42%,#c7b6da 86%,#f7efff 100%);
 -webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
 filter:drop-shadow(0 4px 3px rgba(20,0,45,.6))
}
#nexus-auth-root .nx-login-logo:after{
 content:"";position:absolute;z-index:-1;
 width:55%;height:45%;right:-8%;top:-17%;
 border-top:clamp(12px,2.3vw,35px) solid #cb00ff;
 border-radius:75% 85% 0 0;transform:rotate(-4deg);
 filter:drop-shadow(0 0 8px rgba(228,0,255,.65))
}
#nexus-auth-root .nx-login-hero h1{
 margin:clamp(13px,1.6vh,20px) 0 0!important;padding:0;
 font-size:clamp(30px,3.25vw,56px)!important;line-height:1.05!important;
 font-weight:850!important;letter-spacing:-.045em;color:white!important
}
#nexus-auth-root .nx-login-hero p{
 margin:8px 0 0!important;color:#fff!important;
 font-size:clamp(15px,1.6vw,26px)!important;line-height:1.2!important;
 font-weight:450;letter-spacing:-.025em
}
#nexus-auth-root .nexus-auth-card{
 position:relative;z-index:1;box-sizing:border-box;flex-shrink:0;
 width:min(420px,100%);padding:23px 28px 22px!important;
 margin:clamp(22px,3vh,40px) auto 0;
 background:linear-gradient(145deg,rgba(45,14,61,.96),rgba(27,8,45,.97))!important;
 border:3px solid #d324ff;border-radius:43px!important;
 box-shadow:0 0 0 1px rgba(244,116,255,.2),0 0 22px rgba(195,0,255,.65),0 0 65px rgba(117,0,180,.32),inset 0 1px 12px rgba(224,67,255,.23);
 backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
 color:#fff!important
}
#nexus-auth-root .nexus-auth-logo,
#nexus-auth-root .nexus-auth-card>h1,
#nexus-auth-root .nexus-auth-card>p,
#nexus-auth-root .nexus-auth-foot{display:none!important}
#nexus-auth-root #nexus-auth-form{margin:0;display:flex;flex-direction:column;gap:12px}
#nexus-auth-root .nx-workspace-choice{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin-bottom:-2px}
#nexus-auth-root .nx-workspace-choice label{margin:0!important;font-size:11px!important;color:#dbc1e7!important;font-weight:650!important;letter-spacing:.03em}
#nexus-auth-root .nx-workspace-choice select{
 width:auto!important;min-width:125px;padding:5px 22px 5px 10px!important;
 border:1px solid rgba(219,138,237,.45)!important;border-radius:10px!important;
 background:rgba(77,30,95,.64)!important;color:#fff!important;
 font-size:11px!important;height:29px;outline-offset:3px
}
#nexus-auth-root .nx-field-wrap{position:relative;display:block}
#nexus-auth-root .nx-field-wrap>label{
 position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);
 margin:0!important;white-space:nowrap
}
#nexus-auth-root .nx-field-wrap .nx-field-icon{
 position:absolute;z-index:1;left:20px;top:50%;transform:translateY(-50%);
 width:24px;height:24px;pointer-events:none;fill:none;stroke:#fff;stroke-width:2;
 stroke-linecap:round;stroke-linejoin:round;opacity:.98
}
#nexus-auth-root .nx-field-wrap input{
 box-sizing:border-box;width:100%!important;height:58px;min-height:58px;
 padding:12px 55px 12px 61px!important;
 border:2px solid #86539f!important;border-radius:28px!important;
 color:#fff!important;background:rgba(62,24,78,.75)!important;
 font:500 18px Inter,system-ui,sans-serif!important;
 box-shadow:inset 0 1px 6px rgba(0,0,0,.17)!important;
 outline:none;transition:background .18s,border-color .18s,box-shadow .18s
}
#nexus-auth-root .nx-field-wrap input::placeholder{color:rgba(255,255,255,.88)!important}
#nexus-auth-root .nx-field-wrap input:focus{border-color:#e28aff!important;background:rgba(70,28,90,.96)!important;box-shadow:0 0 0 3px rgba(225,98,255,.23)!important}
#nexus-auth-root .nx-password-toggle{
 position:absolute;right:13px;top:50%;transform:translateY(-50%);
 display:grid;place-items:center;width:42px;height:42px;margin:0!important;
 border:0;background:transparent;color:#fff;border-radius:50%;cursor:pointer;
 transition:background .18s
}
#nexus-auth-root .nx-password-toggle:hover{background:rgba(255,255,255,.11)}
#nexus-auth-root .nx-password-toggle svg{width:23px;height:23px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#nexus-auth-root #nexus-auth-error{
 margin:2px 0!important;font-size:12px!important;
 border:1px solid #d984b0;background:rgba(110,20,54,.8)!important;color:#fff!important
}
#nexus-auth-root #nexus-auth-submit{
 width:100%!important;height:63px!important;min-height:63px!important;
 margin:3px 0 0!important;padding:8px 18px!important;
 border:1px solid rgba(226,145,255,.45)!important;border-radius:22px!important;
 background:linear-gradient(95deg,#ac00ef 0%,#c400ff 50%,#9200eb 100%)!important;
 box-shadow:0 6px 20px rgba(21,0,40,.3),inset 0 1px 0 rgba(255,255,255,.25);
 color:#fff!important;font-size:23px!important;font-weight:760!important;letter-spacing:-.02em;
 cursor:pointer;transition:filter .18s,transform .18s
}
#nexus-auth-root #nexus-auth-submit:hover{filter:brightness(1.13);transform:translateY(-1px)}
#nexus-auth-root #nexus-auth-submit:focus-visible{outline:3px solid #fff;outline-offset:4px}
#nexus-auth-root #nexus-auth-submit:disabled{opacity:.7;cursor:wait}
#nexus-auth-root .nx-login-arrow{display:inline-block;font-size:30px;vertical-align:-2px;margin-left:9px;font-weight:350}
@media(max-height:760px) and (min-width:700px){
 #nexus-auth-root{padding-top:10px;padding-bottom:12px}
 #nexus-auth-root .nx-login-logo{font-size:clamp(54px,6.1vw,90px)}
 #nexus-auth-root .nx-login-hero h1{font-size:clamp(27px,3vw,43px)!important;margin-top:6px!important}
 #nexus-auth-root .nx-login-hero p{font-size:clamp(14px,1.5vw,20px)!important}
 #nexus-auth-root .nexus-auth-card{padding:13px 21px 15px!important;border-radius:32px!important}
 #nexus-auth-root .nx-field-wrap input{height:49px;min-height:49px}
 #nexus-auth-root #nexus-auth-submit{height:50px!important;min-height:50px!important}
 #nexus-auth-root #nexus-auth-form{gap:8px}
}
@media(max-width:700px){
 #nexus-auth-root{padding:18px 15px 24px;justify-content:space-between;background-position:center}
 #nexus-auth-root:before{background:linear-gradient(180deg,rgba(38,0,62,.48),rgba(38,0,62,.04) 55%,rgba(21,0,32,.35))}
 #nexus-auth-root .nx-login-logo{font-size:clamp(57px,15vw,105px)}
 #nexus-auth-root .nx-login-hero h1{font-size:clamp(28px,7.6vw,42px)!important}
 #nexus-auth-root .nx-login-hero p{font-size:clamp(13px,3.7vw,18px)!important}
 #nexus-auth-root .nexus-auth-card{padding:21px 17px 20px!important;border-radius:29px!important}
 #nexus-auth-root .nx-field-wrap input{height:54px;min-height:54px;font-size:16px!important}
 #nexus-auth-root #nexus-auth-submit{height:59px!important;min-height:59px!important;font-size:20px!important}
}
@media(prefers-reduced-motion:reduce){#nexus-auth-root *{transition:none!important}}

/* Actual Nexus artwork, cleaned of its baked-in login panel. The form remains live. */
#nexus-auth-root{
 background:#1d0b35 url('/assets/nexus-login-background.webp') center center/cover no-repeat!important;
 justify-content:flex-end!important;
 padding:16px 20px clamp(18px,3.3vh,36px)!important;
}
#nexus-auth-root::before{display:none!important}
#nexus-auth-root .nx-login-hero{display:none!important}
#nexus-auth-root .nexus-auth-card{
 margin:0 auto!important;
 width:min(420px,100%)!important;
 border:2px solid #e134ff!important;
 border-radius:40px!important;
 padding:20px 38px 23px!important;
 background:linear-gradient(125deg,rgba(47,17,63,.96),rgba(34,9,51,.97))!important;
 box-shadow:0 0 0 1px rgba(255,168,255,.22),0 0 14px rgba(209,0,252,.75),0 0 45px rgba(148,0,231,.27),inset 0 1px 15px rgba(200,31,234,.10)!important;
}
#nexus-auth-root #nexus-auth-form{gap:11px!important}
#nexus-auth-root .nx-field-wrap input{
 background:rgba(48,19,65,.93)!important;
 border:2px solid #815394!important;
 -webkit-text-fill-color:#fff!important;
 caret-color:#fff!important;
 color:#fff!important
}
#nexus-auth-root .nx-field-wrap input:-webkit-autofill,
#nexus-auth-root .nx-field-wrap input:-webkit-autofill:hover,
#nexus-auth-root .nx-field-wrap input:-webkit-autofill:focus{
 -webkit-text-fill-color:#fff!important;
 -webkit-box-shadow:0 0 0 1000px #391c4b inset!important;
 box-shadow:0 0 0 1000px #391c4b inset!important;
 transition:background-color 100000s ease-in-out 0s!important
}
#nexus-auth-root .nx-field-wrap input::placeholder{-webkit-text-fill-color:rgba(255,255,255,.88)!important}
#nexus-auth-root .nx-workspace-choice{margin:0 0 -1px!important}
#nexus-auth-root #nexus-auth-submit{margin-top:4px!important}
@media(max-width:700px){
 #nexus-auth-root{background-position:50% center!important;padding:12px 13px max(18px,env(safe-area-inset-bottom))!important}
 #nexus-auth-root .nexus-auth-card{padding:17px 17px 20px!important;border-radius:30px!important}
 #nexus-auth-root .nx-field-wrap input{height:52px!important;min-height:52px!important}
 #nexus-auth-root #nexus-auth-submit{height:57px!important;min-height:57px!important}
}
@media(max-height:650px) and (min-width:701px){
 #nexus-auth-root .nexus-auth-card{padding:12px 22px!important;border-radius:26px!important}
 #nexus-auth-root .nx-field-wrap input{height:46px!important;min-height:46px!important}
 #nexus-auth-root #nexus-auth-submit{height:49px!important;min-height:49px!important}
}

/* Login composition correction: show the entire supplied artwork and center the functional form. */
#nexus-auth-root{
  min-height:100vh!important;
  min-height:100dvh!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  background-image:url('/assets/nexus-login-background.webp')!important;
  background-position:center center!important;
  background-size:100% 100%!important;
  background-repeat:no-repeat!important;
  padding:20px!important;
}
#nexus-auth-root .nexus-auth-card{
  position:relative!important;
  top:auto!important;
  margin:auto!important;
  transform:none!important;
}
@media(max-width:700px){
  #nexus-auth-root{
    background-size:cover!important;
    background-position:center top!important;
    justify-content:center!important;
    padding:16px!important;
  }
  #nexus-auth-root .nexus-auth-card{margin:auto!important;}
}

/* Keep the entire authentication scene out of layout once sign-in succeeds.
   Specificity + !important defeats the unauthenticated flex rule above. */
html.nexus-authenticated #nexus-auth-root {
  display: none !important;
  visibility: hidden !important;
}

/* Subtle panel transparency — retain the glowing frame and fully opaque controls. */
#nexus-auth-root .nexus-auth-card {
  background:linear-gradient(125deg,rgba(47,17,63,.68),rgba(34,9,51,.72))!important;
  border:2px solid #e134ff!important;
  box-shadow:0 0 0 1px rgba(255,168,255,.22),0 0 14px rgba(209,0,252,.75),0 0 45px rgba(148,0,231,.27),inset 0 1px 15px rgba(200,31,234,.10)!important;
}
#nexus-auth-root .nx-field-wrap input {
  background:#301341!important;
}
#nexus-auth-root #nexus-auth-submit {
  opacity:1!important;
}
html.nexus-authenticated #nexus-auth-root {
  display:none!important;
}

/* Refined narrower desktop sign-in panel; preserve mobile sizing, transparency and controls. */
@media(min-width:701px){
 #nexus-auth-root .nexus-auth-card{width:min(420px,100%)!important;max-width:420px!important}
}

/* Login panel width correction: intentionally compact, centered and responsive. */
@media(min-width:701px){
 #nexus-auth-root .nexus-auth-card{width:420px!important;max-width:calc(100vw - 40px)!important;padding-left:24px!important;padding-right:24px!important}
}

/* iPhone Nexus Management app: preserve complete landscape artwork and use dark safe-area. */
@media(max-width:700px){
  html,body{background-color:#260a3d!important}
  html:not(.nexus-authenticated){background-color:#260a3d!important}
  #nexus-auth-root{
    min-height:100vh!important;
    min-height:100dvh!important;
    background-color:#260a3d!important;
    background-image:linear-gradient(to bottom,rgba(38,10,61,0) 0%,rgba(38,10,61,.06) 25%,rgba(38,10,61,.63) 48%,#260a3d 83%),url('/assets/nexus-login-background.webp')!important;
    background-size:100% 100%,100% auto!important;
    background-position:center center,center top!important;
    background-repeat:no-repeat,no-repeat!important;
    padding-top:max(18px,env(safe-area-inset-top))!important;
    padding-bottom:max(22px,env(safe-area-inset-bottom))!important;
  }
  #nexus-auth-root .nexus-auth-card{
    width:min(420px,100%)!important;
    max-width:calc(100vw - 26px)!important;
    margin:auto!important;
  }
}
@media(max-width:700px) and (display-mode:standalone){
  html,body{background:#260a3d!important}
}
