.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
}

.password-field .button {
  align-self: center;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.password-field--icon .button {
  display: inline-grid;
  place-items: center;
  height: 2.75rem;
  width: 2.75rem;
  min-width: 2.75rem;
  padding: 0.55rem;
  overflow: hidden;
  white-space: nowrap;
}

.password-toggle__icon {
  display: block;
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.password-toggle__slash {
  stroke-width: 2.4;
}

.password-toggle__icon[hidden] {
  display: none;
}

.password-card,
.portal-shell .auth-card.password-card {
  width: min(100%, 35rem);
  margin-inline: auto;
}

.password-guidance {
  display: grid;
  gap: var(--space-2);
}

.password-requirements {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: var(--color-surface-alt);
}

.password-requirements__title,
.password-requirements ul,
.password-strength__status {
  margin: 0;
}

.password-requirements__title {
  font-weight: 700;
}

.password-requirements ul {
  padding-inline-start: 1.35rem;
}

.password-strength {
  display: grid;
  gap: var(--space-1);
}

.password-strength__segments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-1);
}

.password-strength__segments span {
  height: 0.45rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-neutral-bg);
}

.password-strength[data-strength='weak'] .password-strength__segments span:first-child {
  border-color: var(--color-danger-text);
  background: var(--color-danger-text);
}

.password-strength[data-strength='medium'] .password-strength__segments span:nth-child(-n + 2) {
  border-color: var(--color-warning-text);
  background: var(--color-warning-text);
}

.password-strength[data-strength='strong'] .password-strength__segments span {
  border-color: var(--color-success-text);
  background: var(--color-success-text);
}

.password-strength[data-strength='weak'] .password-strength__status strong {
  color: var(--color-danger-text);
}

.password-strength[data-strength='medium'] .password-strength__status strong {
  color: var(--color-warning-text);
}

.password-strength[data-strength='strong'] .password-strength__status strong {
  color: var(--color-success-text);
}

@media (forced-colors: active) {
  .password-strength__segments span {
    forced-color-adjust: none;
  }

  .password-strength[data-strength='weak'] .password-strength__segments span:first-child,
  .password-strength[data-strength='medium'] .password-strength__segments span:nth-child(-n + 2),
  .password-strength[data-strength='strong'] .password-strength__segments span {
    border-color: Highlight;
    background: Highlight;
  }
}

@media (max-width: 22rem) {
  .password-field:not(.password-field--icon) {
    grid-template-columns: minmax(0, 1fr);
  }

  .password-field:not(.password-field--icon) .button {
    width: 100%;
  }
}
