/* =========================================================
   TELAS DE CONTA (Views/Conta): entrar, cadastrar, esqueci/redefinir senha, acesso negado.
   Dupla do kit desenhado: ilha de cor chapada com adesivos (decoração + recado) de um lado
   e o formulário num cartão branco com contorno de nanquim do outro. No celular empilha:
   ilha curtinha em cima (só selo, título e adesivos) e o formulário logo abaixo.
   ========================================================= */

.auth {
  padding-block: clamp(1.25rem, 0.5rem + 2.5vw, 3rem) clamp(1rem, 0.5rem + 2vw, 2.5rem);
}

.auth__par {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  grid-template-areas: "ilha painel";
  gap: clamp(1rem, 0.5rem + 1.5vw, 1.75rem);
  align-items: stretch;
  max-width: 1120px;
  margin-inline: auto;
}

/* ---------- cartão do formulário ---------- */

.auth__painel {
  grid-area: painel;
  align-self: start;
  padding: clamp(1.375rem, 0.8rem + 2.2vw, 2.75rem);
  border-radius: clamp(1.5rem, 1rem + 1.2vw, 2rem);
  background: var(--paper);
  color: var(--navy);
  outline: var(--ink);
  outline-offset: -2.5px;
  box-shadow: 0 6px 0 var(--navy);
}

.auth__titulo {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 1.4rem + 1.6vw, 2.625rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--navy);
}

.auth__titulo:focus {
  outline: none;
}

.auth__lede {
  margin: var(--s2) 0 var(--s5);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--kid-ink-2);
  text-wrap: pretty;
}

.auth__lede b {
  color: var(--navy);
  overflow-wrap: anywhere;
}

.auth__form {
  display: grid;
  gap: var(--s4);
}

.auth__go {
  margin-top: var(--s2);
}

.auth__go .fa-solid {
  font-size: 0.95em;
}

/* "Ainda não tem conta? Criar conta" */
.auth__troca {
  margin: var(--s5) 0 0;
  font-size: 1rem;
  text-align: center;
  color: var(--kid-ink-2);
}

.auth__troca + .auth__troca {
  margin-top: var(--s3);
}

.auth__troca-link,
.auth__alerta a {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--royal-deep);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.auth__troca-link:hover {
  color: var(--navy);
  text-decoration-color: var(--sun-deep);
}

/* ---------- campos ---------- */

.campo {
  display: grid;
  gap: 0.375rem;
  min-width: 0;
}

.campo__dupla {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4);
}

/* rótulo, campo e erro alinhados nas duas colunas (mesmo quando um rótulo quebra a linha) */
.campo__dupla .campo {
  grid-row: span 3;
  grid-template-rows: subgrid;
  align-items: start;
}

.campo__dupla .campo__rotulo {
  align-self: end;
}

.campo__topo {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
}

.campo__rotulo {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy);
}

.campo__opc {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.5rem 0.1rem;
  border-radius: var(--r-pill);
  background: var(--field);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: 0.1em;
  color: var(--royal-deep);
}

.campo__link {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--royal-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.campo__link:hover {
  color: var(--navy);
}

.campo__input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0 1.125rem;
  border: 2.5px solid var(--navy);
  border-radius: var(--r-box);
  background: #fff;
  font-family: var(--font-body);
  font-size: 1.0625rem; /* 16px+ : o iPhone não dá zoom ao focar */
  font-weight: 500;
  color: var(--navy);
  box-shadow: 0 3px 0 rgb(42 23 71 / 0.12);
  transition: box-shadow var(--t1) var(--ease-out), background-color var(--t1) var(--ease-out);
}

.campo__input::placeholder {
  color: #6b7590;
  font-weight: 400;
}

.campo__input:hover {
  background: #fbfcff;
}

.campo__input:focus-visible {
  outline: 3px solid var(--royal);
  outline-offset: 2px;
  box-shadow: 0 3px 0 var(--navy);
}

.campo__input[aria-invalid="true"] {
  border-color: var(--sale);
  background: #fff4ee;
}

.campo__dica {
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--kid-ink-2);
}

/* erro do campo (asp-validation-for): vazio some; com texto ganha o ícone de alerta */
.campo__erro {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--sale);
}

.campo__erro:empty {
  display: none;
}

.campo__erro::before {
  content: "\f06a"; /* fa-circle-exclamation */
  flex: none;
  margin-top: 0.1em;
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.9em;
}

.campo__erro--marca {
  margin-top: calc(var(--s2) * -1);
}

/* senha com o botão de olho dentro do campo */
.campo__senha {
  position: relative;
}

.campo__senha .campo__input {
  padding-right: 3.5rem;
}

.campo__olho {
  position: absolute;
  top: 50%;
  right: 0.375rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--royal-deep);
  font-size: 1.125rem;
  cursor: pointer;
  translate: 0 -50%;
}

.campo__olho:hover {
  background: var(--field);
}

.campo__olho:focus-visible {
  outline: 3px solid var(--royal);
  outline-offset: 0;
}

/* caixinha de marcar (lembrar de mim, termos) */
.marca {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.75rem;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--navy);
  cursor: pointer;
}

.marca input {
  position: absolute;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.marca__caixa {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 2.5px solid var(--navy);
  border-radius: 8px;
  background: #fff;
  color: transparent;
  font-size: 0.9rem;
  box-shadow: 0 2px 0 var(--navy);
  transition: background-color var(--t1) var(--ease-out), color var(--t1) var(--ease-out);
}

.marca input:checked + .marca__caixa {
  background: var(--sun);
  color: var(--navy);
}

.marca input:focus-visible + .marca__caixa {
  outline: 3px solid var(--royal);
  outline-offset: 2px;
}

.marca.is-invalid .marca__caixa {
  border-color: var(--sale);
  background: #fff4ee;
}

.marca__texto small {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.875rem;
  color: var(--kid-ink-2);
}

/* ---------- recados (erro geral / sucesso) ---------- */

.auth__alerta,
.auth__aviso {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: var(--s5);
  padding: 0.875rem 1rem;
  border-radius: var(--r-box);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--navy);
}

.auth__alerta {
  border: 2.5px solid var(--sale);
  background: #fff4ee;
}

.auth__alerta:focus {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

.auth__aviso {
  border: 2.5px solid var(--navy);
  background: var(--mint);
}

.auth__alerta p,
.auth__aviso p {
  margin: 0;
}

.auth__alerta p + p {
  margin-top: 0.375rem;
}

.auth__alerta-ico,
.auth__aviso-ico {
  flex: none;
  font-size: 1.25rem;
  line-height: 1.2;
}

.auth__alerta-ico {
  color: var(--sale);
}

.auth__aviso-ico {
  color: var(--ok);
}

/* contas de teste (só em desenvolvimento) */
.auth__demo {
  margin-top: var(--s5);
  padding: 0.75rem 1rem;
  border: 2px dashed var(--rule-2);
  border-radius: var(--r-box);
  font-size: 0.9375rem;
  color: var(--kid-ink-2);
}

.auth__demo summary {
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
}

.auth__demo dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.375rem 0.75rem;
  margin: 0.75rem 0 0;
}

.auth__demo dt {
  font-weight: 600;
}

.auth__demo dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.auth__demo code {
  font-family: var(--font-data);
  font-size: 0.8125rem;
  color: var(--navy);
}

/* ---------- ilha colorida ---------- */

.auth__ilha {
  grid-area: ilha;
  position: sticky;
  top: calc(var(--head-h) + 1rem);
  align-self: start;
  display: flex;
  flex-direction: column;
  min-height: 38rem;
  padding-bottom: 0;
  box-shadow: 0 6px 0 var(--navy);
}

.auth__ilha-texto {
  position: relative;
  max-width: 26rem;
}

.auth__ilha-titulo {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.3rem + 2.2vw, 3.25rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.auth__ilha-lede {
  margin: var(--s4) 0 0;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--kid-ink-2);
  text-wrap: pretty;
}

.auth__vantagens {
  display: grid;
  gap: 0.625rem;
  margin: var(--s5) 0 0;
  padding: 0;
  list-style: none;
  font-weight: 600;
  line-height: 1.35;
}

.auth__vantagens li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.625rem;
}

.auth__check {
  display: grid;
  place-items: center;
  width: 1.625rem;
  height: 1.625rem;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--sun);
  color: var(--navy);
  font-size: 0.75rem;
}

.island--sun .auth__check {
  background: #fff;
}

.island--royal .auth__check,
.island--night .auth__check {
  border-color: #fff;
}

/* adesivos colados tortos no canto de baixo, saindo um pouco da ilha */
.auth__adesivos {
  position: relative;
  flex: 1;
  min-height: 15rem;
  margin-top: var(--s5);
  pointer-events: none;
}

.auth__adesivo {
  position: absolute;
  height: auto;
  filter: drop-shadow(0 6px 0 rgb(42 23 71 / 0.18));
}

.auth__adesivo--a {
  right: 8%;
  bottom: 1.5rem;
  width: clamp(8rem, 5rem + 6vw, 11.5rem);
  rotate: 9deg;
}

.auth__adesivo--b {
  right: 40%;
  bottom: -0.75rem;
  width: clamp(6.5rem, 4rem + 5vw, 9.5rem);
  rotate: -12deg;
}

.auth__adesivo--c {
  left: -0.5rem;
  bottom: 2.75rem;
  width: clamp(4.5rem, 3rem + 3vw, 6.5rem);
  rotate: -6deg;
}

/* a terceira bolinha cairia em cima do texto: nas telas de conta ficam só duas */
.auth__ilha .island__star--c {
  display: none;
}

/* ---------- "e-mail" simulado (esqueci a senha) ---------- */

.correio {
  margin-top: var(--s2);
}

.correio__aviso {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin: 0 0 var(--s4);
  padding: 0.75rem 1rem;
  border-radius: var(--r-box);
  background: var(--sun-soft);
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--navy);
}

.correio__aviso .fa-solid {
  margin-top: 0.15em;
  color: var(--royal-deep);
}

.correio__msg {
  padding: var(--s5);
  border: 2.5px solid var(--navy);
  border-radius: var(--r-box-lg);
  background: #fff;
  box-shadow: 0 4px 0 var(--navy);
}

.correio__msg p {
  margin: 0 0 var(--s3);
  line-height: 1.5;
  color: var(--kid-ink-2);
}

.correio__de {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding-bottom: var(--s3);
  border-bottom: 2px dashed var(--rule-2);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.correio__titulo {
  margin: 0 0 var(--s2);
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--navy);
}

.correio__go {
  margin: var(--s2) 0 var(--s4);
}

.correio__msg .correio__pe {
  margin: 0;
  font-size: 0.875rem;
}

/* ---------- acesso negado ---------- */

.negado {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--s6);
  max-width: 1080px;
  margin-inline: auto;
  box-shadow: 0 6px 0 var(--navy);
}

.negado__titulo {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.3rem + 2.4vw, 3.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.negado__titulo:focus {
  outline: none;
}

.negado__lede {
  margin: var(--s4) 0 0;
  max-width: 38rem;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--kid-ink-2);
  text-wrap: pretty;
}

.negado__acoes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3) var(--s4);
  margin-top: var(--s6);
}

.negado__acoes form {
  display: contents;
}

.negado__trocar {
  min-height: 2.75rem;
  padding: 0 0.25rem;
  border: 0;
  background: none;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  cursor: pointer;
}

.negado__trocar:hover {
  text-decoration-color: var(--royal);
}

.negado__trocar:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
  border-radius: 6px;
}

.negado__arte {
  position: relative;
  min-height: 20rem;
}

.negado__adesivo {
  position: absolute;
  height: auto;
  filter: drop-shadow(0 6px 0 rgb(42 23 71 / 0.18));
}

.negado__adesivo--a {
  right: 4%;
  top: 6%;
  width: clamp(8rem, 5rem + 7vw, 13rem);
  rotate: 10deg;
}

.negado__adesivo--b {
  left: 6%;
  bottom: 4%;
  width: clamp(6.5rem, 4rem + 5vw, 10rem);
  rotate: -10deg;
}

/* cadeado num círculo amarelo com contorno de nanquim, como um adesivo */
.negado__cadeado {
  position: absolute;
  left: 38%;
  top: 34%;
  display: grid;
  place-items: center;
  width: 5.5rem;
  height: 5.5rem;
  border: 3px solid var(--navy);
  border-radius: 50%;
  background: var(--sun);
  color: var(--navy);
  font-size: 2.25rem;
  box-shadow: 0 0 0 4px #fff, 0 5px 0 4px var(--navy);
  rotate: -8deg;
}

/* ---------- tablet e celular ---------- */

@media (max-width: 960px) {
  .auth__par {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "ilha"
      "painel";
    max-width: 40rem;
  }

  /* ilha curtinha em cima: selo, título e adesivos; o formulário logo depois */
  .auth__ilha {
    position: relative;
    top: auto;
  }

  .auth__ilha {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 9.5rem;
    align-items: center;
    min-height: 0;
    padding-bottom: var(--i-pad);
  }

  .auth__ilha-lede,
  .auth__vantagens {
    display: none;
  }

  .auth__ilha-titulo {
    font-size: clamp(1.625rem, 1.2rem + 2vw, 2.25rem);
  }

  .auth__adesivos {
    align-self: stretch;
    min-height: 7.5rem;
    margin: 0;
  }

  .auth__adesivo--a {
    right: -0.25rem;
    bottom: auto;
    top: 50%;
    width: 6.5rem;
    translate: 0 -50%;
  }

  .auth__adesivo--b {
    right: 4.25rem;
    bottom: -0.5rem;
    width: 4.5rem;
  }

  .auth__adesivo--c {
    display: none;
  }

  .auth__ilha .island__star--a,
  .auth__ilha .island__star--c {
    display: none;
  }

  .negado {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s4);
  }

  .negado__arte {
    order: -1;
    min-height: 9rem;
  }

  .negado__adesivo--a {
    top: 0;
    right: 8%;
    width: 7.5rem;
  }

  .negado__adesivo--b {
    left: 4%;
    bottom: 0;
    width: 6rem;
  }

  .negado__cadeado {
    left: 42%;
    top: 18%;
    width: 4.5rem;
    height: 4.5rem;
    font-size: 1.75rem;
  }
}

@media (max-width: 520px) {
  .campo__dupla {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth__ilha {
    grid-template-columns: minmax(0, 1fr) 6.5rem;
  }

  .auth__adesivo--a {
    width: 5.25rem;
    right: -0.5rem;
  }

  .auth__adesivo--b {
    right: 2.75rem;
    width: 3.75rem;
  }

  .auth__ilha .kbadge {
    font-size: 0.9375rem;
  }

  .negado__acoes .kbtn {
    width: 100%;
  }

  .negado__acoes {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .campo__input,
  .marca__caixa {
    transition: none;
  }
}

/* ---------- código do 2FA (/conta/entrar-2fa) ---------- */
.campo__input--codigo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-align: center;
}
.campo__input--codigo::placeholder {
  letter-spacing: 0.2em;
}

/* desenho feito à mão (mascote da loja, img/desenhos/*.svg): o SVG tem folga em volta, então fica maior que os adesivos */
.auth__adesivo.auth__adesivo--desenho {
  width: clamp(7rem, 5rem + 5vw, 9.5rem);
  height: auto;
}
