/* password-ui.css — Toggle, strength meter, rules checklist, match indicator */

/* ── Field wrapper (inherits flex sizing from .form-group) ── */

.pw-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 calc(100% - 180px);
  width: calc(100% - 180px);
}

.pw-field-wrapper input[type="password"],
.pw-field-wrapper input[type="text"] {
  padding-right: 36px !important;
  width: 100% !important;
  flex: 1 1 auto !important;
}

@media screen and (max-width: 580px) {
  .pw-field-wrapper {
    flex: unset;
    width: 100%;
  }
}

/* ── Toggle button ── */

.pw-toggle-btn {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #999;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.2s;
}

.pw-toggle-btn:hover,
.pw-toggle-btn:focus-visible {
  color: #333;
  outline: 2px solid #6b7e88;
  outline-offset: 1px;
}

/* ── Strength container ── */

.pw-strength-container {
  margin: -0.6rem 0 1.2rem 0;
  padding: 0 0 0 170px;
  font-size: 13px;
  color: #555;
}

@media screen and (max-width: 580px) {
  .pw-strength-container {
    padding-left: 0;
  }
}

/* ── Meter bar ── */

.pw-meter {
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.pw-meter-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.pw-meter-fill.pw-level-1 { background: #e74c3c; }
.pw-meter-fill.pw-level-2 { background: #e67e22; }
.pw-meter-fill.pw-level-3 { background: #f1c40f; }
.pw-meter-fill.pw-level-4 { background: #27ae60; }
.pw-meter-fill.pw-level-5 { background: #1a8c4e; }

.pw-meter-label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.pw-meter-label.pw-level-1 { color: #e74c3c; }
.pw-meter-label.pw-level-2 { color: #e67e22; }
.pw-meter-label.pw-level-3 { color: #c0960a; }
.pw-meter-label.pw-level-4 { color: #27ae60; }
.pw-meter-label.pw-level-5 { color: #1a8c4e; }

/* ── Rules checklist ── */

.pw-rules-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #444;
}

.pw-rules-list {
  list-style: none;
  padding: 0;
  margin: 0 0 6px 0;
}

.pw-rules-list li {
  font-size: 12px;
  line-height: 1.8;
  color: #b33;
  transition: color 0.2s;
}

.pw-rules-list li .pw-rule-icon {
  display: inline-block;
  width: 16px;
  text-align: center;
  font-size: 13px;
}

.pw-rules-list li.pw-rule-met {
  color: #1a8c4e;
}

.pw-tip {
  font-size: 11px;
  color: #888;
  font-style: italic;
  margin: 2px 0 0 0;
}

/* ── Match indicator ── */

.pw-match-indicator {
  font-size: 12px;
  font-weight: 600;
  margin: -0.6rem 0 1.2rem 0;
  padding-left: 170px;
}

@media screen and (max-width: 580px) {
  .pw-match-indicator {
    padding-left: 0;
  }
}

.pw-match-indicator.pw-match-ok   { color: #1a8c4e; }
.pw-match-indicator.pw-match-fail { color: #e74c3c; }

/* ── Noscript fallback (visible only when JS is off) ── */

.pw-noscript-rules {
  margin: -0.6rem 0 1rem 0;
  padding: 8px 0 0 170px;
  font-size: 12px;
  color: #666;
  line-height: 1.7;
}

@media screen and (max-width: 580px) {
  .pw-noscript-rules {
    padding-left: 0;
  }
}
