/* ==========================================================================
   PanoramaSat — auth.css
   Páginas de login (Portal do Cliente): formulário à esquerda e imagem
   à direita. No celular, a imagem é ocultada.
   Usa as variáveis de base.css e o botão .pill de components.css.
   ========================================================================== */

/* A página ocupa exatamente a altura da tela (100dvh considera as barras do navegador
   no celular). Espaçamentos verticais usam clamp() com vh para encolher em telas baixas. */
.auth {
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 20px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(12px, 2.2vh, 20px);
}

/* --------------------------------------------------------------------------
   Coluna do login
   -------------------------------------------------------------------------- */
.auth-main {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vh, 32px);
  padding: clamp(8px, 1.6vh, 16px) 28px;
}

.auth-top {
  display: flex;
  align-items: center;
  min-height: 40px;
}

.auth-top .logo img {
  height: 28px;
  width: auto;
}

/* Caixa central */
.auth-box {
  width: 100%;
  max-width: 420px;
  margin: auto;
}

.auth-box h1 {
  margin-top: 8px;
  font-size: clamp(28px, 2.6vw, 36px);
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -.015em;
}

.auth-box .sub {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.55;
}

/* Formulário */
.auth-form {
  display: grid;
  gap: clamp(12px, 1.8vh, 16px);
  margin-top: clamp(20px, 3vh, 28px);
}

.auth-form > label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px var(--green-100);
}

.auth-form input[aria-invalid="true"] {
  border-color: var(--ink);
}

/* Campo de senha com botão mostrar/ocultar */
.pw {
  position: relative;
  display: block;
}

.pw input {
  padding-right: 48px !important;
}

.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.pw-toggle:hover {
  background: var(--soft);
  color: var(--ink);
}

.pw-toggle svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Lembrar de mim / Esqueci minha senha */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13.5px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  cursor: pointer;
}

.check input {
  width: 17px;
  height: 17px;
  accent-color: var(--green-700);
}

.auth-row a,
.auth-help a {
  color: var(--green-700);
  font-weight: 500;
  text-decoration: none;
}

.auth-row a:hover,
.auth-help a:hover {
  text-decoration: underline;
}

/* Botão Entrar: ocupa a largura do formulário */
.auth-submit {
  width: 100%;
  justify-content: space-between;
  height: 48px;
  margin-top: 2px;
  border: 0;
  cursor: pointer;
}

.auth-submit:disabled {
  opacity: .6;
  cursor: wait;
}

.auth-status {
  margin-top: -4px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
}

.auth-status a {
  color: var(--green-700);
  font-weight: 500;
}

.auth-help {
  margin-top: clamp(18px, 2.6vh, 24px);
  padding-top: clamp(14px, 2.2vh, 20px);
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}

.auth-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}

.auth-foot a {
  color: var(--muted);
}

.auth-foot a:hover {
  color: var(--green-700);
}

/* --------------------------------------------------------------------------
   Imagem lateral
   -------------------------------------------------------------------------- */
.auth-media {
  position: relative;
  display: flex;
  align-items: flex-end;
  border-radius: var(--r);
  overflow: hidden;
  background-color: var(--deep);
  background-repeat: no-repeat;
  background-size: cover;
}

/* Imagem de cada portal (gradiente escuro embaixo para a legenda) */
.auth-media--cliente {
  background-image:
    linear-gradient(180deg, rgba(3, 10, 24, .05) 40%, rgba(3, 10, 24, .85) 100%),
    url("../img/portal-cliente.jpg");
  background-image:
    linear-gradient(180deg, rgba(3, 10, 24, .05) 40%, rgba(3, 10, 24, .85) 100%),
    image-set(url("../img/portal-cliente.webp") type("image/webp"), url("../img/portal-cliente.jpg") type("image/jpeg"));
  background-position: center, 42% 30%;
}

.auth-media--colaborador {
  background-image:
    linear-gradient(180deg, rgba(3, 10, 24, .05) 40%, rgba(3, 10, 24, .85) 100%),
    url("../img/portal-colaborador.jpg");
  background-image:
    linear-gradient(180deg, rgba(3, 10, 24, .05) 40%, rgba(3, 10, 24, .85) 100%),
    image-set(url("../img/portal-colaborador.webp") type("image/webp"), url("../img/portal-colaborador.jpg") type("image/jpeg"));
  background-position: center, 45% 30%;
}

.auth-caption {
  padding: 48px;
  color: #fff;
}

.auth-caption .lab {
  color: var(--green-500);
}

.auth-caption p {
  margin-top: 10px;
  max-width: 16em;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -.01em;
}

/* --------------------------------------------------------------------------
   Celular e tablet: só o formulário
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .auth-wrap {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .auth-media {
    display: none;
  }

  .auth-main {
    gap: 12px;
    padding: 12px 22px;
  }

  .auth-top .logo img {
    height: 20px;
  }

  .auth-box h1 {
    font-size: 26px;
  }

  .auth-box .sub {
    font-size: 14px;
  }

  .auth-form {
    margin-top: 18px;
    gap: 12px;
  }

  .auth-help {
    margin-top: 16px;
    padding-top: 12px;
  }
}
