/* Tela de entrada: apresentação do sistema à esquerda (sempre escura) e o
   acesso à direita (segue o tema claro/escuro). */

.auth-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Apresentação ---------- */
.auth-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 48px 40px 32px;
  color: #dfe6f5;
  /* Azul-tinta com leve brilho e uma malha discreta, como papel quadriculado. */
  background:
    linear-gradient(rgb(255 255 255 / 3.5%) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgb(255 255 255 / 3.5%) 1px, transparent 1px) 0 0 / 44px 44px,
    radial-gradient(ellipse at 80% 85%, rgb(80 120 220 / 28%), transparent 55%),
    radial-gradient(ellipse at 10% 5%, rgb(40 70 150 / 45%), transparent 50%),
    linear-gradient(160deg, #0f1733 0%, #142452 55%, #10204a 100%);
}
.showcase-card {
  width: min(440px, 100%);
  padding: 36px 34px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 20px;
  background: rgb(255 255 255 / 5%);
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 60%);
  backdrop-filter: blur(6px);
}
.auth-mark {
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 700;
  letter-spacing: 0.02em;
}
/* Marca do programa (TechDocs) num cartão branco: o logo é azul e sumiria
   sobre o fundo azul-escuro. */
.showcase-logo {
  display: grid;
  place-items: center;
  padding: 22px 24px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 40px -24px rgb(0 0 0 / 70%);
}
.showcase-logo img {
  width: min(240px, 100%);
  height: auto;
}
/* No celular o lado esquerdo some; a marca do programa vai para o topo. */
.auth-program-logo {
  display: none;
}
.auth-mark img {
  width: 100%;
  height: 100%;
  padding: 6%;
  object-fit: contain;
  background: #ffffff;
}
.auth-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.showcase-rule {
  display: block;
  width: 44px;
  height: 3px;
  margin: 26px 0 18px;
  border-radius: 3px;
  background: linear-gradient(90deg, #8fb0ff, transparent);
}
.showcase-text {
  color: rgb(223 230 245 / 82%);
  font-size: 15px;
  line-height: 1.7;
}
.showcase-features {
  display: grid;
  gap: 10px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}
.showcase-features li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 12px;
  background: rgb(8 14 32 / 35%);
  font-size: 14px;
  line-height: 1.45;
}
.feature-icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgb(143 176 255 / 16%);
  color: #b9ccff;
}
.feature-icon svg {
  width: 18px;
  height: 18px;
}
.showcase-footer {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: rgb(223 230 245 / 60%);
  font-size: 12px;
  text-align: center;
}
.auth-showcase .developer-credit {
  color: rgb(223 230 245 / 75%);
}
.auth-showcase .developer-credit strong {
  color: #ffffff;
}

/* ---------- Acesso ---------- */
.auth-access {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 40px 24px;
  background:
    radial-gradient(ellipse at 90% 0%, var(--brand-soft), transparent 60%),
    var(--paper);
}
.auth-panel {
  width: min(430px, 100%);
  padding: 38px 36px 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 24px 50px -32px rgb(16 22 38 / 35%);
  text-align: center;
}
.auth-mark {
  width: 68px;
  height: 68px;
  margin: 0 auto;
  border-radius: 12px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 17px;
}
.auth-mark:has(img) {
  border: 1px solid var(--line);
  background: #ffffff;
}
.auth-eyebrow {
  margin-top: 22px;
  color: var(--brand);
}
.auth-panel h1 {
  margin: 8px 0 8px;
  font-size: 26px;
}
.auth-lead {
  margin-bottom: 26px;
  color: var(--muted);
}
.auth-form {
  display: grid;
  gap: 16px;
  text-align: left;
}
.input-with-icon {
  position: relative;
}
.input-icon {
  position: absolute;
  top: 50%;
  left: 13px;
  z-index: 1;
  width: 18px;
  height: 18px;
  color: var(--faint);
  transform: translateY(-50%);
  pointer-events: none;
}
.field .input-with-icon input {
  min-height: 46px;
  padding-left: 42px;
  border-radius: 10px;
}
.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.auth-options .inline-check {
  font-size: 13px;
}
.auth-options .link-button {
  margin-top: 0;
}
.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  border-radius: 10px;
  font-size: 15px;
}
.auth-status {
  min-height: 20px;
  margin-top: 16px !important;
  color: var(--muted);
  font-size: 13px;
}
.auth-status:empty {
  display: none;
}
.auth-status.error {
  color: var(--overdue);
}
#bootstrap-admin-button,
#restore-backup-button {
  width: 100%;
  margin-top: 12px;
}
.auth-footnote {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.auth-privacy {
  color: var(--brand);
  font-weight: 550;
  text-decoration: none;
}
.auth-privacy:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* No celular, fica só o acesso, com o crédito no rodapé. */
@media (max-width: 900px) {
  .auth-screen {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth-showcase {
    display: none;
  }
  .auth-program-logo {
    display: block;
    box-sizing: content-box;
    width: 132px;
    height: auto;
    padding: 10px 16px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: var(--shadow-card, 0 1px 3px rgb(0 0 0 / 10%));
  }
}
@media (max-width: 720px) {
  .auth-access {
    justify-content: flex-start;
    padding: calc(28px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
  }
  .auth-form input {
    font-size: 16px;
  }
  .auth-panel {
    padding: 30px 22px 26px;
  }
}

/* Escolha do ambiente: uma linha pequena no fim do cartão de entrada. */
.environment-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
}
.environment-picker[hidden] {
  display: none;
}
/* Seta própria, colada ao nome (a nativa reserva a largura da opção mais longa). */
.environment-picker select {
  appearance: none;
  padding: 2px 18px 2px 4px;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent no-repeat right 4px center / 9px 6px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 6'%3E%3Cpath d='M1 1l3.5 3.5L8 1' fill='none' stroke='%238a93a3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color: var(--muted);
  cursor: pointer;
  field-sizing: content;
  font: inherit;
  font-weight: 600;
}
.environment-picker select:hover {
  background-color: var(--surface-2);
  color: var(--ink);
}
.environment-picker select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

/* ---------- Cortexis Ops e os módulos ---------- */
/* O ERP no cartão branco: o símbolo é azul e sumiria no fundo escuro. */
.showcase-logo {
  gap: 2px;
  padding: 24px 24px 22px;
}
.showcase-logo img {
  width: 84px;
  height: 84px;
  margin-bottom: 8px;
}
.showcase-name {
  margin: 0;
  color: #19202c;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.showcase-name strong {
  color: #233a7a;
}
.showcase-tagline {
  margin: 0;
  color: #5d6677;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.showcase-features strong {
  color: #ffffff;
  font-weight: 650;
}
/* O logo de cada módulo num selo branco, no lugar do ícone. */
.feature-module {
  padding: 3px;
  background: #ffffff;
}
.feature-module img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---------- Entrar e recuperar a senha no mesmo cartão ---------- */
.auth-pane[inert] {
  display: none;
}
.auth-pane {
  animation: auth-fade 0.35s ease both;
}
.auth-pane-title {
  margin: 8px 0 8px;
  font-size: 26px;
}
.auth-back {
  margin-top: 18px;
}
@keyframes auth-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-pane { animation: none; }
}

/* No celular, o nome do ERP no topo, no lugar da apresentação. */
@media (max-width: 900px) {
  .auth-program-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    color: #19202c;
    font-size: 18px;
    font-weight: 650;
    letter-spacing: -0.01em;
  }
  .auth-program-logo strong {
    color: #233a7a;
  }
  .auth-program-logo img {
    width: 30px;
    height: 30px;
  }
}

/* ---------- Efeito de troca (vídeo de referência login.mp4) ----------
   Ao abrir "Recuperar senha", o painel escuro desliza para a direita por
   cima do cartão de acesso, que passa por baixo dele para a esquerda e
   troca de conteúdo no meio do caminho. "Voltar para entrar" desfaz. As
   larguras são as das duas colunas (1,1 e 1): cada lado anda a largura do
   outro, medida pelo contêiner. Só no computador (no celular o painel não
   aparece). */
@media (min-width: 901px) {
  .auth-screen {
    container-type: inline-size;
    overflow: hidden;
  }
  .auth-showcase,
  .auth-access {
    position: relative;
    transition: transform 0.8s cubic-bezier(0.7, 0, 0.25, 1);
    will-change: transform;
  }
  .auth-showcase {
    z-index: 2;
    box-shadow: 0 0 60px -10px rgb(4 8 20 / 55%);
  }
  .auth-access {
    z-index: 1;
  }
  .auth-screen[data-auth-mode="reset"] .auth-showcase {
    transform: translateX(calc(100cqw / 2.1));
  }
  .auth-screen[data-auth-mode="reset"] .auth-access {
    transform: translateX(calc(-100cqw * 1.1 / 2.1));
  }
  /* Os dois formulários ficam no mesmo lugar do cartão. O que sai continua
     à vista até o painel passar por cima dele; o que entra aparece depois. */
  .auth-panel {
    display: grid;
  }
  .auth-panel > .auth-pane {
    grid-row: 3;
    grid-column: 1;
    animation: none;
  }
  .auth-panel > .auth-pane[inert] {
    display: block;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease 0.28s, visibility 0s linear 0.43s;
  }
  .auth-panel > .auth-pane:not([inert]) {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease 0.42s;
  }
}
@media (min-width: 901px) and (prefers-reduced-motion: reduce) {
  .auth-showcase,
  .auth-access,
  .auth-panel > .auth-pane[inert],
  .auth-panel > .auth-pane:not([inert]) {
    transition: none;
  }
}

/* Rodapé do acesso: o crédito do desenvolvedor só no celular (no computador
   ele já aparece embaixo da apresentação, à esquerda). */
@media (min-width: 901px) {
  .auth-credit-mobile {
    display: none;
  }
}
