/* Update 88 — iPhone login optimisation */

html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
  background:#111617;
}

body{
  min-height:100vh;
  min-height:100svh;
  background:#111617;
  overscroll-behavior-y:none;
}

.login-page{
  min-height:100vh;
  min-height:100svh;
  height:auto;
  overflow-x:hidden;
  overflow-y:auto;
  padding:
    max(40px,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));
}

@supports (height:100dvh){
  .login-page{
    min-height:100dvh;
  }
}

.back-button{
  top:max(20px,env(safe-area-inset-top));
  left:max(20px,env(safe-area-inset-left));
  min-width:44px;
  min-height:44px;
  display:inline-flex;
  align-items:center;
  touch-action:manipulation;
}

.login-overlay{
  width:min(420px,calc(100vw - 36px));
  max-width:100%;
}

.login-overlay input{
  min-height:48px;
  font-size:16px; /* prevents Safari's input-focus auto zoom */
  appearance:none;
  -webkit-appearance:none;
}

.login-submit{
  min-height:48px;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}

.nigel-remember-screen{
  min-height:100vh;
  min-height:100svh;
  padding:
    max(20px,env(safe-area-inset-top))
    max(18px,env(safe-area-inset-right))
    max(20px,env(safe-area-inset-bottom))
    max(18px,env(safe-area-inset-left));
  overflow-y:auto;
}

@supports (height:100dvh){
  .nigel-remember-screen{
    min-height:100dvh;
  }
}

.nigel-remember-box{
  max-height:calc(100svh - 40px);
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}

.nigel-remember-actions button{
  min-height:48px;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}

@media(max-width:720px){
  .login-page{
    align-items:center;
    justify-content:center;
    padding:
      max(68px,calc(env(safe-area-inset-top) + 52px))
      max(18px,env(safe-area-inset-right))
      max(24px,env(safe-area-inset-bottom))
      max(18px,env(safe-area-inset-left));
  }

  .login-overlay{
    width:100%;
    padding:26px 22px;
    border-radius:16px;
  }

  .login-overlay h1{
    font-size:25px;
  }

  .login-subtitle{
    margin-bottom:20px;
  }

  .login-brand img{
    width:118vw;
    max-width:none;
  }

  .nigel-remember-box{
    width:100%;
    max-width:430px;
    padding:24px 20px;
    border-radius:16px;
  }

  .nigel-remember-actions{
    grid-template-columns:1fr;
  }
}

/* Short iPhone landscape / keyboard-reduced viewport */
@media(max-height:520px) and (pointer:coarse){
  .login-page{
    align-items:flex-start;
    padding-top:max(58px,calc(env(safe-area-inset-top) + 46px));
    padding-bottom:max(16px,env(safe-area-inset-bottom));
  }

  .login-overlay{
    margin:auto;
    padding:18px 20px;
  }

  .login-overlay h1{
    font-size:21px;
  }

  .login-subtitle{
    margin-bottom:10px;
  }

  .login-overlay label{
    margin-top:8px;
    margin-bottom:4px;
  }

  .login-submit{
    margin-top:14px;
  }

  .login-brand{
    opacity:.20;
  }
}
