/* =========================================================
   TOE BEANS DESIGN SYSTEM
   PASSWORD STRENGTH

   Canonical live password requirements and strength meter.
   ========================================================= */

.ds-password-strength {
  display: grid;
  gap: 9px;
  margin-top: 7px;
  padding: 11px 13px 12px;
  border: 1px solid var(--ds-border);
  border-radius: 11px;
  background: var(--ds-surface-alt);
  color: var(--ds-text);
}

.ds-password-strength-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ds-password-strength-title,
.ds-password-strength-label {
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
}

.ds-password-strength-title {
  color: var(--ds-heading);
}

.ds-password-strength-label {
  color: var(--ds-muted);
}

.ds-password-strength-meter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.ds-password-strength-segment {
  height: 6px;
  border-radius: 999px;
  background: var(--ds-border-strong);
  transition: background-color 160ms ease;
}

.ds-password-strength[data-strength="weak"]
  .ds-password-strength-segment:nth-child(-n + 1) {
  background: var(--ds-danger);
}

.ds-password-strength[data-strength="fair"]
  .ds-password-strength-segment:nth-child(-n + 2) {
  background: var(--ds-warning);
}

.ds-password-strength[data-strength="good"]
  .ds-password-strength-segment:nth-child(-n + 3) {
  background: var(--ds-primary);
}

.ds-password-strength[data-strength="strong"]
  .ds-password-strength-segment:nth-child(-n + 4) {
  background: var(--ds-success);
}

.ds-password-requirements {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ds-password-requirement {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--ds-muted);
  font-size: 11px;
  line-height: 1.35;
}

.ds-password-requirement-icon {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border: 1px solid var(--ds-border-strong);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

.ds-password-requirement-icon .ds-icon {
  width: 11px;
  height: 11px;
  stroke-width: 2.6;
}

.ds-password-requirement[data-complete="true"] {
  color: var(--ds-success);
}

.ds-password-requirement[data-complete="true"]
  .ds-password-requirement-icon {
  border-color: var(--ds-success);
  background: var(--ds-success-soft);
  color: var(--ds-success);
}





@media (prefers-reduced-motion: reduce) {
  .ds-password-strength-segment,
  .ds-password-requirement-icon {
    transition: none;
  }
}
