/* MAXPDV V9.50 · Correção definitiva do login no celular
   Mantém desktop intacto e elimina overflow/colunas fixas em seleção de lojas e desafio de dispositivo. */

/* Segurança contra qualquer conteúdo interno forçando largura da viewport. */
body.sales-site:has(.max-auth-login-page){
  overflow-x:clip;
}
.max-auth-login-page,
.max-auth-login-page *{
  box-sizing:border-box;
}
.max-auth-login-page .max-auth-login-stage,
.max-auth-login-page .max-auth-card-login,
.max-auth-login-page .max-auth-form,
.max-auth-login-page .max-auth-input,
.max-auth-login-page .max-auth-choice-list,
.max-auth-login-page .max-auth-choice-form,
.max-auth-login-page .max-auth-choice-button,
.max-auth-login-page .device-login-list,
.max-auth-login-page .device-login-item{
  min-width:0;
}

@media (max-width:980px){
  .max-auth-login-page{
    min-height:100dvh;
    padding:0 max(0px,env(safe-area-inset-right)) 0 max(0px,env(safe-area-inset-left));
    background:linear-gradient(180deg,#f7f9fc 0%,#eef3f7 100%)!important;
  }
  .max-auth-login-page .max-auth-topbar{
    width:min(100% - 28px,620px)!important;
    height:auto!important;
    min-height:68px!important;
    padding:10px 0!important;
    flex:0 0 auto;
  }
  .max-auth-login-page .max-auth-brand img{
    width:132px!important;
    max-width:42vw!important;
    height:auto!important;
  }
  .max-auth-login-page .max-auth-top-actions{min-width:0!important;flex:0 0 auto!important}

  /* Estas classes tinham maior especificidade que o breakpoint antigo e mantinham colunas de 440/520 px no celular. */
  .max-auth-login-page .max-auth-login-stage,
  .max-auth-login-page .max-auth-login-stage.is-store-selection,
  .max-auth-login-page .max-auth-login-stage.is-device-challenge{
    width:min(100% - 28px,560px)!important;
    max-width:560px!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-auto-columns:minmax(0,1fr)!important;
    gap:0!important;
    margin:12px auto 20px!important;
    align-items:start!important;
    justify-content:stretch!important;
  }
  .max-auth-login-page .max-auth-value-v947{display:none!important}
  .max-auth-login-page .max-auth-card-login,
  .max-auth-login-page .is-store-selection .max-auth-card-login,
  .max-auth-login-page .is-device-challenge .max-auth-card-login{
    grid-column:1!important;
    width:100%!important;
    max-width:100%!important;
    min-height:0!important;
    align-self:start!important;
    padding:32px 26px 28px!important;
    border:1px solid #dce5ed!important;
    border-radius:20px!important;
    background:#fff!important;
    box-shadow:0 14px 38px rgba(15,23,42,.09)!important;
    overflow:hidden!important;
  }
  .max-auth-login-page .max-auth-login-brandmark{margin-bottom:14px!important}
  .max-auth-login-page .max-auth-heading-centered{margin-bottom:22px!important}
  .max-auth-login-page .max-auth-heading-centered h1{
    margin-top:4px!important;
    font-size:clamp(1.45rem,6vw,1.75rem)!important;
    line-height:1.16!important;
    overflow-wrap:anywhere;
  }
  .max-auth-login-page .max-auth-heading-centered p{font-size:.79rem!important;line-height:1.5!important}
  .max-auth-login-page .max-auth-form{width:100%!important;gap:15px!important}
  .max-auth-login-page .max-auth-form label{min-width:0!important;width:100%!important}
  .max-auth-login-page .max-auth-input{
    width:100%!important;
    min-height:50px!important;
    height:50px!important;
    padding:0 12px!important;
    border-radius:12px!important;
  }
  .max-auth-login-page .max-auth-input input{
    min-width:0!important;
    width:100%!important;
    font-size:16px!important; /* evita zoom automático no iPhone */
    line-height:1.2!important;
  }
  .max-auth-login-page .max-auth-submit{
    width:100%!important;
    min-height:50px!important;
    height:50px!important;
    border-radius:12px!important;
  }
  .max-auth-login-page .max-auth-register-cta{margin-top:20px!important;padding-top:18px!important}
  .max-auth-login-page .max-auth-register-cta>a{width:100%!important;min-height:46px!important}

  /* Seleção de loja/sistema */
  .max-auth-login-page .max-auth-choice-list{
    width:100%!important;
    max-height:min(52dvh,470px)!important;
    margin:0!important;
    padding:2px 1px 5px!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable;
  }
  .max-auth-login-page .max-auth-choice-button{
    width:100%!important;
    max-width:100%!important;
    min-height:84px!important;
    grid-template-columns:40px minmax(0,1fr) 24px!important;
    gap:10px!important;
    padding:12px!important;
    border-radius:13px!important;
  }
  .max-auth-login-page .max-auth-choice-copy{min-width:0!important;max-width:100%!important}
  .max-auth-login-page .max-auth-choice-copy strong,
  .max-auth-login-page .max-auth-choice-copy small{
    width:100%!important;
    max-width:100%!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
  }
  .max-auth-login-page .max-auth-choice-copy strong{font-size:.91rem!important}
  .max-auth-login-page .max-auth-choice-copy small{font-size:.72rem!important}
  .max-auth-login-page .max-auth-choice-reset{max-width:100%!important}

  /* Liberação de dispositivo */
  .max-auth-login-page .max-auth-heading-device{margin-bottom:20px!important}
  .max-auth-login-page .device-login-account{
    width:100%!important;
    grid-template-columns:auto minmax(0,1fr) auto!important;
    min-width:0!important;
  }
  .max-auth-login-page .device-login-list{
    width:100%!important;
    max-height:min(48dvh,390px)!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
  }
  .max-auth-login-page .device-login-item{
    width:100%!important;
    max-width:100%!important;
  }
  .max-auth-login-page .device-login-copy{min-width:0!important}
  .max-auth-login-page .device-login-copy :is(b,small,em){max-width:100%!important;overflow-wrap:anywhere!important}

  .max-auth-login-page .max-auth-footer{
    width:min(100% - 28px,560px)!important;
    margin:auto auto 0!important;
    padding:15px 0 calc(15px + env(safe-area-inset-bottom))!important;
    flex-wrap:wrap!important;
    gap:8px 16px!important;
    text-align:center!important;
  }
}

@media (max-width:600px){
  .max-auth-login-page .max-auth-topbar{width:calc(100% - 24px)!important;min-height:62px!important;padding:8px 0!important}
  .max-auth-login-page .max-auth-brand img{width:122px!important}
  .max-auth-login-page .max-auth-back-site,
  .max-auth-login-page .max-auth-install{
    width:38px!important;
    height:38px!important;
    min-height:38px!important;
    padding:0!important;
    justify-content:center!important;
    border-radius:10px!important;
  }
  .max-auth-login-page .max-auth-back-site span,
  .max-auth-login-page .max-auth-install span{display:none!important}
  .max-auth-login-page .max-auth-login-stage,
  .max-auth-login-page .max-auth-login-stage.is-store-selection,
  .max-auth-login-page .max-auth-login-stage.is-device-challenge{
    width:calc(100% - 20px)!important;
    margin:6px auto 14px!important;
  }
  .max-auth-login-page .max-auth-card-login,
  .max-auth-login-page .is-store-selection .max-auth-card-login,
  .max-auth-login-page .is-device-challenge .max-auth-card-login{
    padding:25px 18px 22px!important;
    border-radius:17px!important;
  }
  .max-auth-login-page .max-auth-login-brandmark>span{width:46px!important;height:46px!important;border-radius:13px!important}
  .max-auth-login-page .max-auth-heading-centered small{font-size:.62rem!important}
  .max-auth-login-page .max-auth-heading-centered h1{font-size:1.48rem!important}
  .max-auth-login-page .max-auth-heading-centered p{font-size:.76rem!important}
  .max-auth-login-page .max-auth-alert{font-size:.74rem!important}
  .max-auth-login-page .max-auth-choice-list{max-height:min(50dvh,420px)!important}
  .max-auth-login-page .max-auth-choice-button{min-height:80px!important;grid-template-columns:38px minmax(0,1fr) 22px!important;padding:11px 10px!important;gap:9px!important}
  .max-auth-login-page .max-auth-choice-icon{width:38px!important;height:38px!important;border-radius:10px!important;font-size:1rem!important}
  .max-auth-login-page .max-auth-choice-arrow{width:22px!important;height:22px!important}
  .max-auth-login-page .max-auth-footer{width:calc(100% - 20px)!important;font-size:.62rem!important}
}

@media (max-width:390px){
  .max-auth-login-page .max-auth-card-login,
  .max-auth-login-page .is-store-selection .max-auth-card-login,
  .max-auth-login-page .is-device-challenge .max-auth-card-login{padding:22px 14px 20px!important}
  .max-auth-login-page .max-auth-heading-centered h1{font-size:1.38rem!important}
  .max-auth-login-page .max-auth-choice-button{grid-template-columns:36px minmax(0,1fr)!important}
  .max-auth-login-page .max-auth-choice-icon{width:36px!important;height:36px!important}
  .max-auth-login-page .max-auth-choice-arrow{display:none!important}
  .max-auth-login-page .max-auth-footer span{justify-content:center!important}
}

@media (max-height:650px) and (max-width:980px){
  .max-auth-login-page .max-auth-topbar{min-height:56px!important}
  .max-auth-login-page .max-auth-login-stage,
  .max-auth-login-page .max-auth-login-stage.is-store-selection,
  .max-auth-login-page .max-auth-login-stage.is-device-challenge{margin-top:2px!important}
  .max-auth-login-page .max-auth-card-login{padding-top:20px!important;padding-bottom:18px!important}
  .max-auth-login-page .max-auth-login-brandmark{display:none!important}
  .max-auth-login-page .max-auth-heading-centered{margin-bottom:16px!important}
  .max-auth-login-page .max-auth-footer{padding-top:8px!important;padding-bottom:8px!important}
}
