/* FORGED N FITNESS Build 48 — mobile account/auth accessibility */

/* Keep the member account entry point visible on phones. The legacy stylesheet hid
   the first header action, which is now Join / Sign In. Admin stays desktop-only
   on small screens so the header has enough room. */
@media(max-width:760px){
  .header-actions [data-account]{
    display:inline-flex!important;
    min-height:40px;
    white-space:nowrap;
  }
  .header-actions [data-admin-login]{
    display:none!important;
  }
}

/* Keep the dialog inside the actual mobile viewport, including when browser chrome
   or the on-screen keyboard reduces the available height. */
dialog.modal{
  width:min(680px,calc(100vw - 20px));
  max-width:calc(100vw - 20px);
  max-height:calc(100dvh - 20px);
  padding:0;
  overflow:hidden;
}

.modal-shell.live-modal{
  max-height:calc(100dvh - 24px);
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  padding-bottom:0;
}

/* The auth buttons should never disappear below the fold. */
.modal-shell.live-modal .modal-actions{
  position:sticky;
  bottom:0;
  z-index:5;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px;
  margin-top:18px;
  padding:14px 0 max(14px,env(safe-area-inset-bottom));
  background:linear-gradient(180deg,rgba(12,12,12,.72) 0%,#0c0c0c 24%,#0c0c0c 100%);
  border-top:1px solid #292929;
}

.modal-shell.live-modal .modal-actions .btn{
  width:100%;
  min-height:46px;
  white-space:normal;
  text-align:center;
}

@media(max-width:640px){
  dialog.modal{
    width:calc(100vw - 14px);
    max-width:calc(100vw - 14px);
    max-height:calc(100dvh - 14px);
    margin:auto;
  }

  .modal-shell.live-modal{
    max-height:calc(100dvh - 18px);
    padding-left:18px;
    padding-right:18px;
  }

  .modal-shell.live-modal .modal-actions{
    grid-template-columns:1fr;
    margin-left:-18px;
    margin-right:-18px;
    padding-left:18px;
    padding-right:18px;
  }

  .modal-shell.live-modal .modal-actions .btn{
    min-height:50px;
    font-size:.92rem;
  }

  /* Prevent iOS/Android zooming an auth field and pushing actions off-screen. */
  .modal-shell.live-modal input,
  .modal-shell.live-modal select,
  .modal-shell.live-modal textarea{
    font-size:16px;
  }
}
