/*
 * IMPERIUM Build437 R1 — Login Responsive Hardening
 * Presentation only: authentication, sessions, CSRF, MFA and RBAC unchanged.
 */

body.no-auth{
  min-height:100dvh;
  overflow-x:hidden;
}

/*
 * Unified Mobile uses a fixed main viewport for the authenticated application.
 * The login is a document page instead: restore normal document flow so the
 * global programmer credit/footer can never overlap the form.
 */
html.imperium-mobile-layout-v414 body.no-auth{
  position:static!important;
  width:100%!important;
  height:auto!important;
  min-height:100dvh!important;
  max-height:none!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior-y:auto!important;
}

html.imperium-mobile-layout-v414 body.no-auth main,
html.imperium-mobile-layout-v414 body.no-auth main.imperium-mobile-main-v414,
body.no-auth main.container{
  position:static!important;
  inset:auto!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
  overscroll-behavior:auto!important;
  padding-bottom:24px!important;
}

body.no-auth .app-shell,
body.no-auth .main-column{
  width:100%!important;
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
}

body.no-auth .login426-shell{
  width:min(1040px,100%)!important;
  margin:0 auto!important;
  gap:18px!important;
  align-items:start!important;
}

body.no-auth .login426-brand{
  min-width:0!important;
  overflow:hidden!important;
}

body.no-auth .login426-brand img{
  width:min(100%,300px)!important;
  max-width:300px!important;
  height:auto!important;
  aspect-ratio:1/1;
  object-fit:contain!important;
  display:block!important;
  margin:0 auto!important;
}

/* Form density and touch targets. */
body.no-auth .login426-card form{
  gap:11px!important;
}

body.no-auth .login426-card label{
  gap:6px!important;
  margin:0!important;
}

body.no-auth .login426-card input[type="text"],
body.no-auth .login426-card input[type="email"],
body.no-auth .login426-card input[type="password"],
body.no-auth .login426-card input[name="username"]{
  width:100%!important;
  min-width:0!important;
  min-height:54px!important;
  max-height:none!important;
  padding:11px 14px!important;
  font-size:16px!important;
  line-height:1.25!important;
  border-radius:16px!important;
  box-sizing:border-box!important;
}

body.no-auth .login426-card .primary.full{
  min-height:54px!important;
  border-radius:16px!important;
}

/*
 * Global UI v431 applies width:100% to all inputs. This accidentally enlarges
 * the shared-device checkbox. Restore the checkbox as a real compact control.
 */
body.no-auth .shared-device{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  line-height:1.25!important;
}

body.no-auth .shared-device input[type="checkbox"]{
  appearance:auto!important;
  -webkit-appearance:checkbox!important;
  display:inline-block!important;
  flex:0 0 22px!important;
  width:22px!important;
  min-width:22px!important;
  max-width:22px!important;
  height:22px!important;
  min-height:22px!important;
  max-height:22px!important;
  margin:0!important;
  padding:0!important;
  transform:none!important;
  accent-color:#61dfea;
  box-sizing:border-box!important;
}

body.no-auth .shared-device span,
body.no-auth .shared-device strong{
  min-width:0!important;
  font-size:.92rem!important;
  line-height:1.25!important;
}

body.no-auth .login426-meta{
  gap:7px!important;
  padding:1px 0!important;
  min-width:0!important;
}

body.no-auth .login426-note{
  margin:0!important;
  font-size:.76rem!important;
  line-height:1.42!important;
}

/* Copyright and build information belong after the page, never over it. */
body.no-auth .imperium-programmer-credit-global{
  position:static!important;
  inset:auto!important;
  transform:none!important;
  float:none!important;
  clear:both!important;
  display:grid!important;
  place-items:center!important;
  gap:2px!important;
  width:min(calc(100% - 24px),680px)!important;
  max-width:680px!important;
  margin:14px auto 4px!important;
  padding:9px 12px!important;
  text-align:center!important;
  opacity:.82!important;
  pointer-events:none!important;
  z-index:auto!important;
}

body.no-auth .imperium-programmer-credit-global strong{
  font-size:.75rem!important;
  line-height:1.25!important;
}

body.no-auth .imperium-programmer-credit-global span{
  font-size:.69rem!important;
  line-height:1.3!important;
}

body.no-auth .imperium-programmer-credit-global small{
  font-size:.64rem!important;
  line-height:1.3!important;
}

body.no-auth footer{
  position:static!important;
  inset:auto!important;
  transform:none!important;
  clear:both!important;
  width:100%!important;
  margin:0!important;
  padding:4px 12px 18px!important;
  text-align:center!important;
  z-index:auto!important;
}

/* Tablet / narrow desktop. */
@media (max-width:900px){
  html.imperium-mobile-layout-v414 body.no-auth main,
  html.imperium-mobile-layout-v414 body.no-auth main.imperium-mobile-main-v414,
  body.no-auth main.container{
    padding:12px 10px 22px!important;
  }

  body.no-auth .login426-shell{
    display:grid!important;
    grid-template-columns:1fr!important;
    width:min(680px,100%)!important;
    padding:0 10px!important;
    gap:10px!important;
  }

  body.no-auth .login426-brand{
    position:static!important;
    width:min(100%,250px)!important;
    margin:0 auto!important;
    padding:0!important;
    border:0!important;
    border-radius:22px!important;
    background:transparent!important;
    box-shadow:none!important;
  }

  body.no-auth .login426-brand img{
    width:min(100%,210px)!important;
    max-width:210px!important;
  }

  body.no-auth .login426-brand p{
    display:none!important;
  }

  body.no-auth .login426-stack{
    gap:10px!important;
  }

  body.no-auth .login426-card{
    padding:17px 16px!important;
    border-radius:21px!important;
  }

  body.no-auth .login426-card h1{
    margin-bottom:6px!important;
    font-size:clamp(1.9rem,8vw,2.35rem)!important;
    line-height:1!important;
  }

  body.no-auth .login426-card>p{
    margin-bottom:14px!important;
    font-size:.94rem!important;
  }

  body.no-auth details.login426-detail>summary{
    padding:13px 15px!important;
  }

  body.no-auth .login426-detail-body{
    padding:0 15px 15px!important;
  }
}

/* Smartphone. */
@media (max-width:520px){
  html.imperium-mobile-layout-v414 body.no-auth main,
  html.imperium-mobile-layout-v414 body.no-auth main.imperium-mobile-main-v414,
  body.no-auth main.container{
    padding:8px 8px 18px!important;
  }

  body.no-auth .login426-shell{
    width:100%!important;
    padding:0 5px!important;
    gap:9px!important;
  }

  body.no-auth .login426-brand{
    width:190px!important;
    max-width:54vw!important;
  }

  body.no-auth .login426-brand img{
    width:175px!important;
    max-width:100%!important;
  }

  body.no-auth .login426-card{
    padding:15px 14px!important;
    border-radius:19px!important;
  }

  body.no-auth .login426-card h1{
    font-size:2rem!important;
  }

  body.no-auth .login426-card>p{
    margin-bottom:12px!important;
    font-size:.9rem!important;
  }

  body.no-auth .login426-card form{
    gap:9px!important;
  }

  body.no-auth .login426-card input[type="text"],
  body.no-auth .login426-card input[type="email"],
  body.no-auth .login426-card input[type="password"],
  body.no-auth .login426-card input[name="username"],
  body.no-auth .login426-card .primary.full{
    min-height:52px!important;
    border-radius:15px!important;
  }

  body.no-auth .shared-device input[type="checkbox"]{
    flex-basis:21px!important;
    width:21px!important;
    min-width:21px!important;
    max-width:21px!important;
    height:21px!important;
    min-height:21px!important;
    max-height:21px!important;
  }

  body.no-auth .shared-device span,
  body.no-auth .shared-device strong{
    font-size:.88rem!important;
  }

  body.no-auth details.login426-detail{
    border-radius:17px!important;
  }

  body.no-auth details.login426-detail>summary{
    padding:12px 14px!important;
    font-size:.91rem!important;
  }

  body.no-auth .login426-install-actions{
    grid-template-columns:1fr!important;
  }

  body.no-auth .imperium-programmer-credit-global{
    width:calc(100% - 20px)!important;
    margin-top:11px!important;
    padding:7px 10px!important;
  }

  body.no-auth footer{
    padding-bottom:max(14px,env(safe-area-inset-bottom))!important;
  }
}

@media (max-width:380px){
  body.no-auth .login426-brand{
    width:170px!important;
  }
  body.no-auth .login426-brand img{
    width:155px!important;
  }
  body.no-auth .login426-card{
    padding:14px 12px!important;
  }
}

@media (prefers-reduced-motion:reduce){
  body.no-auth *{
    scroll-behavior:auto!important;
  }
}
