/* ===================== */
/* Reset básico */
/* ===================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
h1,
h2,
p {
  margin: 0;
  padding: 0;
}

/* Removemos o foco padrão, mas reintroduzimos
   um foco acessível com :focus-visible */
:focus {
  outline: none;
}

/* Mantém foco acessível para teclado */
:focus-visible {
  outline: 2px inset #005fcc;
  outline-offset: 3px;
  /* border-color: #005fcc;
  box-shadow: 0 0 0 2px rgba(0,95,204,0.25); */
}

body {
  font-family: system-ui, sans-serif;
  background-color: #f5f5f5;
  color: #222;
  margin: 0;
  padding: 2rem;
}

/* ===================== */
/* Layout */
/* ===================== */

main {
  max-width: 420px;
  margin: 0 auto;
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
}
/* ===================== */
h1 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #222;
  text-align: center;
}

#titulo-cadastro {
  font-size: 1.2rem;
  font-weight: 400;
  color: #555;
  margin-top: 1.2rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid #eee;
}

#campos-obrigatorios {
  margin-bottom: 1rem;
}

/* ===================== */
/* Campos */
/* ===================== */

.campo {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.obrigatorio {
  color: #c00;
}

/* ===================== */
/* Inputs */
/* ===================== */

input {
  width: 100%;
  padding: 0.6rem;
  font-size: 1rem;
  border: 2px solid #ccc;
  border-radius: 4px;
}

/* ===================== */
/* Estados de validação */
/* ===================== */

/* Campo inválido APÓS interação */
input:invalid:not(:focus) {
  border-color: #c00;
}

/* Campo válido */
/* input:valid {
  border-color: #2e7d32;
} */
input:valid:not(:focus) {
  border-color: #2e7d32;
}

/* ===================== */
/* Mensagens */
/* ===================== */

small {
  display: block;
  margin-top: 0.25rem;
  color: #555;
}

/* ===================== */
/* Botão */
/* ===================== */

#criar {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  background-color: #005fcc;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#criar:hover,
#criar:focus {
  background-color: #004bb5;
}

#criar:disabled {
  background-color: #999;
  cursor: not-allowed;
}

.sucesso {
  margin-top: 1rem;
  padding: 0.75rem;
  background-color: #e6f4ea;
  color: #2e7d32;
  border-radius: 4px;
  font-weight: 600;
}

.erro {
  display: none;
  margin-top: 0.25rem;
  color: #c00;
  font-size: 0.9rem;
}

/* Quando o campo está inválido e já foi tocado */
.campo.erro-ativo .erro {
  display: block;
}

.forca-senha {
  margin-top: 0.5rem;
}

meter {
  width: 100%;
  height: 1rem;
}

#texto-forca {
  display: block;
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.wrapper-senha {
  position: relative;
}

.wrapper-senha input {
  padding-right: 2.5rem;
}

.toggle-senha {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
}

.toggle-senha:focus-visible {
  outline: 2px inset #005fcc;
  outline-offset: 2px;
}

/* ===================== */
/* Autofill do navegador */
/* ===================== */

/* Chrome, Edge, Safari */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: #222;
  box-shadow: 0 0 0px 1000px #fff inset;
  transition: background-color 9999s ease-in-out 0s;
}
