/*
 * Password field and field errors of the simplified registration page (templates/register.tpl).
 * Theme-neutral: colours follow the text colour where possible; the strength
 * states also carry their name as text, never colour alone.
 */
.dla-password {
  position: relative;
  display: flex;
  align-items: stretch;
}

.dla-password .form-control {
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 3.25rem;
}

.dla-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  transform: translateY(-50%);
  cursor: pointer;
}

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

.dla-password-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
}

.dla-password-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.dla-password-toggle[aria-pressed="false"] .dla-password-icon-hide,
.dla-password-toggle[aria-pressed="true"] .dla-password-icon-show {
  display: none;
}

.dla-password-hint {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
}

.dla-password-strength {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

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

.dla-password-meter {
  display: inline-grid;
  grid-template-columns: repeat(3, 2.25rem);
  gap: 0.25rem;
}

.dla-password-meter > span {
  height: 0.375rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.14);
}

.dla-password-strength[data-strength="short"] .dla-password-meter > span:nth-child(1),
.dla-password-strength[data-strength="weak"] .dla-password-meter > span:nth-child(1) {
  background: #b42318;
}

.dla-password-strength[data-strength="medium"] .dla-password-meter > span:nth-child(-n + 2) {
  background: #b54708;
}

.dla-password-strength[data-strength="strong"] .dla-password-meter > span {
  background: #067647;
}

.dla-register-note {
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

/*
 * Server-side errors under their field (A11Y-01): the message is text, linked
 * to the field with aria-describedby; the red edge only repeats it.
 */
.dla-register .dla-field-error {
  margin: 0.35rem 0 0;
  color: #b42318;
  font-size: 0.9rem;
  font-weight: 600;
}

.dla-register .form-control[aria-invalid="true"] {
  border-color: #b42318;
}
