/* Sophyra login — correção de viewport e responsividade.
   Mantém o layout isolado da autenticação sem alterar o restante do CRM. */

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
}

.app-shell,
.main-content.main-content-public {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
}

.auth-page {
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 100svh;
  grid-template-columns: minmax(0, 1fr) !important;
}

.auth-stage,
.auth-visual,
.auth-access,
.auth-bottom-bar {
  min-width: 0;
  max-width: none;
}

.auth-stage,
.auth-bottom-bar {
  width: 100%;
}

.auth-registration {
  color: rgba(220,235,255,.72);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .18px;
  white-space: nowrap;
}

/* Desktop: ocupa 100% do viewport. O reset de grid-template-columns acima
   corrige a grade antiga de app.css que ainda dividia .auth-page em 2 colunas. */
@media (min-width: 901px) {
  .auth-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) 48px !important;
    overflow: hidden;
  }

  .auth-stage {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
    min-height: 0;
  }

  .auth-bottom-bar {
    grid-column: 1;
    grid-row: 2;
    flex-wrap: wrap;
    padding-inline: 20px;
  }
}

/* Notebooks / janelas com pouca altura: preserva a composição sem cortar
   formulário, slogan ou rodapé. */
@media (min-width: 901px) and (max-height: 760px) {
  .auth-page {
    grid-template-rows: minmax(0, 1fr) 40px !important;
  }

  .auth-visual,
  .auth-access {
    min-height: calc(100svh - 40px);
  }

  .auth-visual {
    padding: 24px 42px 28px;
  }

  .auth-brandbar {
    min-height: 52px;
  }

  .auth-brand-logo {
    width: min(360px, 62%);
    max-height: 72px;
  }

  .auth-visual-copy {
    width: min(560px, 92%);
    padding: 8px 0 10px;
  }

  .auth-kicker {
    margin-bottom: 12px;
    font-size: 10px;
  }

  .auth-visual h1 {
    max-width: 550px;
    font-size: clamp(39px, 3.85vw, 58px);
    line-height: .95;
    letter-spacing: -2.2px;
  }

  .auth-copy-line {
    margin: 15px 0 12px;
  }

  .auth-visual-copy p {
    width: min(420px, 94%);
    font-size: 12px;
    line-height: 1.4;
  }

  .auth-network {
    height: 150px;
  }

  .auth-access {
    padding: 18px 36px 18px 24px;
  }

  .auth-access-inner {
    width: min(100%, 510px);
    padding: 24px 30px 22px;
    border-radius: 24px;
  }

  .auth-access-header {
    margin-bottom: 18px;
  }

  .auth-access-label {
    margin-bottom: 10px;
    font-size: 9.5px;
  }

  .auth-shield {
    width: 32px;
    height: 32px;
  }

  .auth-shield svg {
    width: 18px;
    height: 18px;
  }

  .auth-access h2 {
    font-size: clamp(28px, 2.4vw, 38px);
    letter-spacing: -1.4px;
  }

  .auth-access-header p {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.4;
  }

  .auth-form {
    gap: 12px;
  }

  .auth-field {
    gap: 5px;
  }

  .auth-field label {
    font-size: 10.5px;
  }

  .auth-input-wrap input {
    min-height: 48px;
    padding-left: 48px;
  }

  .auth-options,
  .auth-remember,
  .auth-recovery {
    font-size: 10.5px;
  }

  .auth-submit {
    min-height: 50px;
    font-size: 13px;
  }

  .auth-security-note {
    gap: 9px;
    margin-top: 14px;
    padding: 10px 12px;
    font-size: 10.5px;
  }

  .auth-security-icon {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
  }

  .auth-security-icon svg {
    width: 24px;
    height: 24px;
  }

  .auth-bottom-bar {
    min-height: 40px;
    gap: 10px;
  }

  .auth-registration {
    font-size: 9px;
  }
}

/* Tablet e celular: volta ao fluxo vertical. */
@media (max-width: 900px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .auth-page {
    display: block;
    min-height: 100svh;
    overflow: visible;
  }

  .auth-stage {
    display: block;
  }

  .auth-bottom-bar {
    width: 100%;
    min-height: 62px;
    flex-wrap: wrap;
    gap: 7px 10px;
    padding: 9px 14px;
  }

  .auth-registration {
    flex-basis: 100%;
    text-align: center;
    white-space: normal;
    line-height: 1.3;
  }

  .auth-footer-separator {
    display: none;
  }
}

@media (max-width: 520px) {
  .auth-brand-logo {
    width: min(360px, 88%);
  }

  .auth-access-inner {
    width: 100%;
  }

  .auth-registration {
    font-size: 8.5px;
  }
}
