/* Générateur de mots de passe — feuille propre à l'outil (rien de partagé). */

:root {
  --fond: #0a0c0d;
  --surface: #111517;
  --filet: #1f262a;
  --texte: #d6dde0;
  --discret: #7d898f;
  --accent: #3ddc84;
  --attention: #e5b454;
  --faible: #e5736b;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
          "Liberation Mono", "DejaVu Sans Mono", monospace;
  color-scheme: dark;
}

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

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }

.fil { color: var(--discret); font-size: 0.85rem; }

h1 {
  margin: 12px 0 28px;
  font-size: 1.4rem;
  font-weight: 500;
}

code {
  color: var(--discret);
  font-family: inherit;
  font-size: 0.85em;
  word-break: break-all;
}

/* --- Le mot de passe ----------------------------------------------------- */

.resultat {
  position: relative;
  /* Place réservée à l'infobulle, au-dessus du champ : elle apparaît dans
     cet espace, sans jamais rien pousser. */
  padding-top: 36px;
}

.motdepasse {
  display: block;
  width: 100%;
  min-height: 64px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--filet);
  border-radius: 10px;
  color: var(--texte);
  font-family: inherit;
  font-size: clamp(1.1rem, 4.2vw, 1.45rem);
  letter-spacing: 0.04em;
  text-align: center;
  /* Un mot de passe n'a pas de mots : il se coupe n'importe où. */
  word-break: break-all;
  cursor: copy;
  transition: border-color 0.15s;
}

.motdepasse:hover { border-color: #2e383d; }
.motdepasse:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.motdepasse:disabled {
  cursor: default;
  color: var(--discret);
  font-size: 0.95rem;
  letter-spacing: 0;
}

.bulle {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, 4px);
  padding: 4px 10px;
  background: var(--accent);
  color: var(--fond);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
}

/* La pointe, vers le champ. */
.bulle::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: var(--accent);
}

.bulle.visible { opacity: 1; transform: translate(-50%, 0); }

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

.consigne {
  margin: 8px 0 0;
  color: var(--discret);
  font-size: 0.8rem;
  text-align: center;
}

.lecteur {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- Actions --------------------------------------------------------------- */

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0 28px;
}

.bouton {
  padding: 9px 18px;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.bouton:hover { background: rgba(61, 220, 132, 0.08); }
.bouton:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.force { font-size: 0.85rem; color: var(--discret); }
.force[data-niveau="weak"] { color: var(--faible); }
.force[data-niveau="fair"] { color: var(--attention); }
.force[data-niveau="strong"],
.force[data-niveau="very-strong"] { color: var(--accent); }

/* --- Options --------------------------------------------------------------- */

.options { display: grid; gap: 16px; }

fieldset {
  margin: 0;
  padding: 14px 18px 16px;
  border: 1px solid var(--filet);
  border-radius: 10px;
  display: grid;
  gap: 10px;
}

legend {
  padding: 0 6px;
  color: var(--discret);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  cursor: pointer;
}

input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex: none;
  align-self: center;
  margin: 0;
}

label:has(input:disabled) { color: var(--discret); cursor: not-allowed; }

input[type="number"], input[type="text"] {
  width: 4.5em;
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--filet);
  border-radius: 6px;
  color: var(--texte);
  font-family: inherit;
  font-size: 0.95rem;
  text-align: center;
}

input[type="text"] { width: 2.6em; }

input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.longueur {
  display: flex;
  align-items: center;
  gap: 14px;
}

input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--accent);
}

.groupes {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding-left: 26px;
}

.groupes.inactif { opacity: 0.45; }

.aide {
  margin: 0;
  color: var(--discret);
  font-size: 0.8rem;
}

.alerte { color: var(--attention); }

.lien-outil {
  margin: 32px 0 0;
  color: var(--discret);
  font-size: 0.9rem;
}

/* --- Transparence ---------------------------------------------------------- */

.transparence {
  margin-top: 40px;
  padding: 16px 18px;
  border: 1px solid var(--filet);
  border-radius: 10px;
  font-size: 0.85rem;
}

.transparence h2 {
  margin: 0 0 10px;
  color: var(--discret);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.transparence p { margin: 0 0 12px; }
.transparence dl { margin: 0; }
.transparence dt { margin-top: 12px; color: var(--texte); }
.transparence dd { margin: 2px 0 0; color: var(--discret); }
.transparence .fichiers { margin: 4px 0 0; padding-left: 1.2em; }
