/* =========================================================
   Venda+ — página de login do lojista (/login)
   Reaproveita tokens, fontes, base e botões de css/styles.css.
   ========================================================= */

.auth-page {
  /* Erro: único tom fora da paleta institucional, só para estados de erro.
     6,2:1 sobre branco e 5,7:1 sobre o branco mineral. */
  --erro: #A3362B;
  --erro-fundo: #FBF1EF;
  background: var(--mineral);
}

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

/* ---------- Coluna institucional ---------- */

.auth__brand {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding: clamp(2rem, 4vw, 3.5rem) clamp(2rem, 5vw, 5rem);
  background: var(--azul);
  color: var(--branco);
  overflow: hidden;
  isolation: isolate;
}

/* Arcos de 1px: eco discreto do "+" e do arco da marca, sem efeito luminoso */
.auth__arc {
  position: absolute;
  right: -12%;
  bottom: -8%;
  z-index: -1;
  width: min(78%, 620px);
  height: auto;
  fill: none;
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.auth__logo {
  display: inline-flex;
  align-self: flex-start;
}
.auth__logo img { height: 30px; width: auto; }

.auth__pitch {
  margin-top: auto;
  max-width: 34rem;
}
.auth__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--dourado);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.auth__eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: currentColor;
}
.auth__headline {
  margin-top: 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 3.6vw, 3.375rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.auth__lede {
  margin-top: 1.25rem;
  max-width: 28rem;
  color: var(--claro-2);
  font-size: 1.0625rem;
  line-height: 1.55;
}

.auth__features {
  margin-top: clamp(2.25rem, 4vw, 3rem);
  list-style: none;
  border-top: 1px solid var(--linha-escura);
}
.auth__features li {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--linha-escura);
  color: var(--claro-2);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.auth__features strong {
  display: block;
  color: var(--branco);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.auth__icon {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: var(--dourado);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.auth__icon--sm { width: 1.125rem; height: 1.125rem; }

.auth__seal {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--claro-2);
  font-size: 0.8125rem;
}

/* ---------- Coluna de autenticação ---------- */

.auth__panel {
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 3vw, 2.25rem) clamp(1.25rem, 4vw, 3.5rem) clamp(2rem, 4vw, 3rem);
  background: var(--mineral);
}
.auth__top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 44px;
}
.auth__logo--light { display: none; }
.auth__logo--light img { height: 26px; }

.auth__back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0;
  color: var(--texto-2);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--t-fast);
}
.auth__back:hover { color: var(--azul); }
.auth__back:hover .icon-arrow { transform: translateX(-3px); }

.auth__body {
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: clamp(2rem, 6vh, 4rem) 0;
}

.auth__title {
  font-size: clamp(1.875rem, 2.6vw, 2.375rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.auth__subtitle {
  margin-top: 0.6rem;
  color: var(--texto-2);
  font-size: 1rem;
}

.auth__form {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.25rem;
}

/* ---------- Campos ---------- */

.field { display: grid; gap: 0.5rem; }
/* Senha: rótulo e "Esqueceu a senha?" na mesma linha, campo e mensagens abaixo */
.field--password {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 1rem;
}
.field--password > :not(.field__label):not(.field__aside) { grid-column: 1 / -1; }
.field--password .field__label { grid-row: 1; }
.field--password .field__aside { grid-row: 1; grid-column: 2; justify-self: end; }
.field__label {
  color: var(--azul);
  font-size: 0.875rem;
  font-weight: 600;
}
.field__control { position: relative; }

.field__input {
  width: 100%;
  height: 50px;
  padding: 0 0.95rem;
  background: var(--branco);
  border: 1px solid var(--linha-forte);
  border-radius: var(--r-control);
  color: var(--azul);
  font: inherit;
  font-size: 1rem; /* 16px: o iOS não amplia a página ao focar */
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field__input::placeholder { color: #637480; opacity: 1; } /* cinza azulado oficial: 4,84:1 no branco */
.field__input:hover { border-color: rgba(19, 35, 47, 0.42); }
.field__input:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 1px var(--azul);
}
.field__input:disabled {
  background: var(--mineral);
  color: var(--texto-2);
  cursor: not-allowed;
}
.field__input--reveal { padding-right: 3.25rem; }

/* Remove o botão de senha próprio do Edge, para não duplicar o nosso */
.field__input::-ms-reveal,
.field__input::-ms-clear { display: none; }

.is-invalid .field__input { border-color: var(--erro); }
.is-invalid .field__input:focus { box-shadow: 0 0 0 1px var(--erro); }

.field__error {
  color: var(--erro);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
}
.field__note {
  color: var(--texto-2);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.field__reveal {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--r-control);
  color: var(--texto-2);
  cursor: pointer;
  transition: color var(--t-fast);
}
.field__reveal:hover { color: var(--azul); }
.field__reveal svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.field__reveal .icon-eye-off,
.field__reveal[aria-pressed="true"] .icon-eye { display: none; }
.field__reveal[aria-pressed="true"] .icon-eye-off { display: block; }

.field__aside {
  padding: 0.25rem 0;
  background: none;
  border: 0;
  color: var(--azul);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--linha-forte);
  text-underline-offset: 0.22em;
  cursor: pointer;
  transition: text-decoration-color var(--t-fast);
}
.field__aside:hover { text-decoration-color: currentColor; }

/* ---------- Alerta, envio e cadastro ---------- */

.auth__alert {
  padding: 0.8rem 0.95rem;
  background: var(--erro-fundo);
  border-left: 2px solid var(--erro);
  color: var(--erro);
  font-size: 0.875rem;
  line-height: 1.45;
}
/* Aviso informativo (ex.: acesso ainda indisponível): não é erro do usuário */
.auth__alert[data-tone="info"] {
  background: var(--branco);
  border-left-color: var(--azul);
  color: var(--grafite);
}

.auth__submit {
  width: 100%;
  height: 52px;
  margin-top: 0.25rem;
  font-size: 1rem;
}
.auth__submit:disabled {
  background: var(--grafite);
  cursor: progress;
  transform: none;
}
.auth__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--branco);
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}
.is-busy .auth__spinner { display: block; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth__divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0 1.25rem;
  color: var(--texto-2);
  font-size: 0.8125rem;
  white-space: nowrap;
}
.auth__divider::before,
.auth__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--linha-forte);
}

.auth__signup {
  width: 100%;
  height: 50px;
  background: transparent;
  border-color: var(--linha-forte);
  color: var(--azul);
}
.auth__signup:hover { border-color: var(--azul); background: var(--branco); }

@media (prefers-reduced-motion: reduce) {
  .auth__spinner { animation-duration: 2.4s; }
}

/* ---------- Tablet ---------- */

@media (max-width: 1100px) {
  .auth { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr); }
  .auth__headline { font-size: clamp(2rem, 3.8vw, 2.5rem); }
  .auth__features li { padding: 0.85rem 0; }
}

/* ---------- Celular: o formulário vem primeiro ---------- */

@media (max-width: 860px) {
  .auth { display: block; }
  .auth__brand { display: none; }
  .auth__panel {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--branco);
  }
  .auth__top { justify-content: space-between; }
  .auth__logo--light { display: inline-flex; }
  .auth__body { margin: 0 auto; padding: clamp(2rem, 7vh, 3.5rem) 0 1rem; }
}

