/* 
  Auteur : Venance Kaou
  Projet : Vérificateur de mot de passe
  Date : Avril 2026
*/

@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600&family=Instrument+Serif:ital@0;1&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7f4ef;
  font-family: 'Instrument Sans', sans-serif;
  padding: 2rem;
}

/* Card */
.card {
  background: #ffffff;
  border-radius: 24px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  border: 1px solid #e8e4dd;
}

/* Header */
.card-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #b0a898;
  font-weight: 500;
}

h1 {
  font-family: 'Instrument Serif', serif;
  font-size: 30px;
  font-weight: 400;
  color: #1a1814;
  line-height: 1.1;
}

.card-sub {
  font-size: 14px;
  color: #9c9488;
}

/* Champ */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: #6b6458;
  text-transform: uppercase;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

input[type="password"],
input[type="text"] {
  width: 100%;
  background: #f7f4ef;
  border: 1px solid #e0dbd3;
  border-radius: 12px;
  padding: 0.85rem 3rem 0.85rem 1rem;
  font-size: 16px;
  font-family: 'Instrument Sans', sans-serif;
  color: #1a1814;
  outline: none;
  transition: border-color 0.2s;
  letter-spacing: 0.04em;
}

input:focus {
  border-color: #1a1814;
}

#btn-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  opacity: 0.5;
  transition: opacity 0.2s;
  line-height: 1;
}

#btn-toggle:hover {
  opacity: 1;
}

/* Barre de force */
.strength-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.strength-track {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.strength-seg {
  height: 5px;
  border-radius: 99px;
  background: #ede9e3;
  transition: background 0.3s;
}

/* Classes à activer depuis JS sur les segments */
.seg-weak    { background: #e05555; }
.seg-fair    { background: #f0a030; }
.seg-good    { background: #4fbe8a; }
.seg-strong  { background: #1a9e6a; }

.strength-label {
  font-size: 12px;
  font-weight: 500;
  color: #b0a898;
  min-width: 52px;
  text-align: right;
  transition: color 0.3s;
}

/* Couleurs du label force — à appliquer via JS */
.label-weak    { color: #e05555; }
.label-fair    { color: #f0a030; }
.label-good    { color: #4fbe8a; }
.label-strong  { color: #1a9e6a; }

/* Critères */
.criteria-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.criterion {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #b0a898;
  transition: color 0.25s;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ddd8d0;
  flex-shrink: 0;
  transition: background 0.25s, transform 0.2s;
}

/* Classe à ajouter sur .criterion depuis JS quand le critère est rempli */
.criterion.valid {
  color: #1a1814;
}

.criterion.valid .dot {
  background: #1a9e6a;
  transform: scale(1.2);
}

/* Bouton valider */
#btn-submit {
  width: 100%;
  background: #1a1814;
  border: none;
  border-radius: 12px;
  color: #f7f4ef;
  font-size: 15px;
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 500;
  padding: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.02em;
}

#btn-submit:hover {
  background: #2e2a24;
}

#btn-submit:active {
  transform: scale(0.98);
}

/* Message final */
#final-msg {
  font-size: 13px;
  text-align: center;
  min-height: 18px;
  transition: color 0.3s;
}

/* Classes utilitaires pour le message final */
.msg-success { color: #1a9e6a; font-weight: 500; }
.msg-error   { color: #e05555; font-weight: 500; }