/* ===========================================================
   Painel de código de 6 dígitos (confirmação de cadastro e
   redefinição de senha). Carregar DEPOIS de karameloo-redesign.css.

   Tema claro, igual ao resto do site. Tokens medidos na página no ar,
   não estimados: amarelo #fcbc1d (156 usos), tinta do botão #111418,
   borda de campo rgba(17,24,39,.16), radius 4px, fonte Plus Jakarta Sans.
   O ouro escuro #a98117 é o que o site usa para texto/traço dourado —
   #fcbc1d puro sobre branco dá 1.7:1 e não serve para anel de foco.
   =========================================================== */

/* --- Overlay ---------------------------------------------- */
#kmlCheckEmailOverlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 24, 39, .58);
  z-index: 2147483647;
}
#kmlCheckEmailOverlay.kmlOtpOpen {
  display: flex;
}

/* --- Card ---------------------------------------------------
   Dois ids na frente porque karameloo-redesign.css pinta
   `#kmlCheckEmailCard` de #0d111c com !important. */
#kmlCheckEmailOverlay #kmlCheckEmailCard {
  position: relative;
  box-sizing: border-box;
  width: min(100%, 440px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 0 0 22px;
  background: #ffffff !important;
  border: 1px solid rgba(17, 24, 39, .12) !important;
  border-radius: 4px !important;
  box-shadow: 0 10px 30px rgba(17, 24, 39, .14) !important;
  color: #111827;
  font-family: inherit;
  text-align: left;
  animation: kmlOtpIn 160ms ease-out;
}
@keyframes kmlOtpIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  #kmlCheckEmailOverlay #kmlCheckEmailCard { animation: none; }
}

/* faixa da marca no topo, igual à do e-mail */
#kmlCheckEmailOverlay #kmlCheckEmailCard::before {
  content: "";
  display: block;
  height: 4px;
  background: #fcbc1d;
}

/* --- Antídoto escopado do reset global ---------------------
   karameloo-redesign.css força p/span/label/h1-h6 para #111111
   !important. Aqui o card é claro, então herdar é aceitável — mas
   qualquer cor intencional abaixo precisa de id do card + !important
   para vencer este bloco (ele é (1,0,1); um id sozinho é (1,0,0)). */
#kmlCheckEmailCard p,
#kmlCheckEmailCard span,
#kmlCheckEmailCard strong,
#kmlCheckEmailCard label,
#kmlCheckEmailCard h2 {
  color: inherit !important;
}

#kmlCheckEmailCard #kmlCheckEmailClose {
  position: absolute;
  top: 14px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(17, 24, 39, .14);
  border-radius: 4px;
  color: #4b5563;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
#kmlCheckEmailCard #kmlCheckEmailClose:hover {
  background: #f4f5f7;
  color: #111827;
}

/* --- Cabeçalho -------------------------------------------- */
#kmlCheckEmailCard #kmlOtpTitle {
  margin: 22px 44px 6px 24px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: #111827 !important;
}
#kmlCheckEmailCard #kmlCheckEmailText {
  margin: 0 24px 20px;
  font-size: 14px;
  line-height: 1.55;
  color: #4b5563 !important;
}
#kmlCheckEmailCard #kmlCheckEmailText strong {
  color: #111827 !important;
  font-weight: 600;
  overflow-wrap: anywhere;
}

#kmlCheckEmailCard #kmlOtpForm { padding: 0 24px; }

/* --- Campos ----------------------------------------------- */
.kmlOtpField { margin-bottom: 16px; }
#kmlCheckEmailCard .kmlOtpField label,
#kmlCheckEmailCard .kmlOtpLabel {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #6b7280 !important;
}
#kmlCheckEmailCard .kmlOtpHelp {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #6b7280 !important;
}

/* --- Uma caixa por dígito --------------------------------- */
#kmlOtpDigits {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
/* !important em fundo/borda/cor: o site tem regra global de input com
   !important que pintava a caixa de escuro (visto no ar, caixa preta
   em card branco). */
#kmlCheckEmailCard .kmlOtpDigit {
  width: 100%;
  box-sizing: border-box;
  height: 56px;
  padding: 0;
  background: #ffffff !important;
  border: 1px solid rgba(17, 24, 39, .16) !important;
  border-radius: 4px !important;
  color: #111827 !important;
  font-family: inherit;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: border-color 120ms ease, background 120ms ease;
  -moz-appearance: textfield;
}
#kmlCheckEmailCard .kmlOtpDigit::-webkit-outer-spin-button,
#kmlCheckEmailCard .kmlOtpDigit::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
/* caixa preenchida ganha a borda amarela da marca */
#kmlCheckEmailCard .kmlOtpDigit.kmlOtpCheia {
  border-color: #fcbc1d !important;
  background: #fffdf3 !important;
}

#kmlCheckEmailCard .kmlOtpPass {
  width: 100%;
  box-sizing: border-box;
  height: 42px;
  padding: 0 12px;
  background: #ffffff !important;
  border: 1px solid rgba(17, 24, 39, .16) !important;
  border-radius: 4px !important;
  color: #111827 !important;
  font-family: inherit;
  font-size: 14px;
}
#kmlCheckEmailCard .kmlOtpPass::placeholder { color: #9ca3af; }

/* Foco: o site tem estilo global que pinta borda e sombra de ROXO
   (#7c3aed) — medido no ar, e roxo é proibido pela LEI anti-IA.
   Aqui dentro volta a ser dourado. #a98117 em vez de #fcbc1d porque
   o amarelo puro sobre branco não alcança 3:1. */
#kmlCheckEmailCard .kmlOtpDigit:focus,
#kmlCheckEmailCard .kmlOtpDigit:focus-visible,
#kmlCheckEmailCard .kmlOtpPass:focus,
#kmlCheckEmailCard .kmlOtpPass:focus-visible,
#kmlCheckEmailCard #kmlOtpSubmit:focus-visible,
#kmlCheckEmailCard #kmlOtpResend:focus-visible,
#kmlCheckEmailCard #kmlCheckEmailClose:focus-visible {
  outline: 2px solid #a98117 !important;
  outline-offset: 2px !important;
  border-color: #a98117 !important;
  box-shadow: none !important;
}
#kmlCheckEmailCard [aria-invalid="true"] {
  border-color: #b91c1c !important;
  background: #fef4f4;
}

/* --- Mensagem de estado (nunca só cor: leva glifo + texto) -- */
#kmlCheckEmailCard #kmlOtpMsg {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  display: none;
}
#kmlCheckEmailCard #kmlOtpMsg.kmlOtpShow { display: block; }
#kmlCheckEmailCard #kmlOtpMsg.kmlOtpErr { color: #b91c1c !important; }
#kmlCheckEmailCard #kmlOtpMsg.kmlOtpOk  { color: #15803d !important; }

/* --- Botões ----------------------------------------------- */
#kmlOtpActions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
#kmlCheckEmailCard #kmlOtpSubmit,
#kmlCheckEmailCard #kmlOtpResend {
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
#kmlCheckEmailCard #kmlOtpSubmit {
  background: #fcbc1d;
  border: 1px solid #fcbc1d;
  color: #111418;
  font-weight: 800;
}
#kmlCheckEmailCard #kmlOtpSubmit:hover:not(:disabled) { background: #f0b012; }
#kmlCheckEmailCard #kmlOtpResend {
  background: #ffffff;
  border: 1px solid rgba(17, 24, 39, .16);
  color: #4b5563;
  font-weight: 600;
}
#kmlCheckEmailCard #kmlOtpResend:hover:not(:disabled) { background: #f4f5f7; }
#kmlCheckEmailCard #kmlOtpSubmit:disabled,
#kmlCheckEmailCard #kmlOtpResend:disabled {
  opacity: .55;
  cursor: not-allowed;
}

@media (max-width: 400px) {
  #kmlCheckEmailCard #kmlOtpTitle { margin-left: 18px; margin-right: 40px; }
  #kmlCheckEmailCard #kmlCheckEmailText { margin-left: 18px; margin-right: 18px; }
  #kmlCheckEmailCard #kmlOtpForm { padding: 0 18px; }
  #kmlOtpDigits { gap: 6px; }
  #kmlCheckEmailCard .kmlOtpDigit { height: 50px; font-size: 20px; }
}
