/*
 * Form pieces the sign-in pages and the account screens share: fields with messages, the
 * password reveal, the rules list and strength bars, notes and alerts. Linked after auth.css.
 */

/* Fields with messages, and the password reveal ------------------------------------------ */

.field-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-msg {
  padding-left: 4px;
  font-size: 13px;
  color: var(--muted);
}

.field-msg--bad {
  color: var(--red);
}

.field--invalid .field__input {
  color: var(--ink);
}

.field--password {
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 8px 6px 16px;
}

.field__stack {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 2px;
}

.field__input--code {
  letter-spacing: 0.08em;
}

.field-aside {
  display: flex;
  justify-content: flex-end;
}

.reveal {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.reveal__slash {
  opacity: 0;
}

.reveal[aria-pressed="true"] .reveal__slash {
  opacity: 1;
}

/* Password rules and strength ------------------------------------------------------------ */

.pw-rules {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 4px;
}

.pw-rules__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.strength {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.strength__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.strength--1 {
  color: var(--red);
}

.strength--2 {
  color: var(--amber);
}

.strength--3,
.strength--4 {
  color: var(--green);
}

.bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.bar {
  height: 6px;
  border-radius: 3px;
  background: var(--hairline);
  transition: background 0.25s ease;
}

.bar--on {
  background: currentColor;
}

.rules {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rule {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.rule__mark {
  flex: 0 0 22px;
  height: 22px;
  border: 1px solid var(--border-field);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rule--ok {
  color: var(--green);
}

.rule--ok .rule__mark {
  border-color: var(--green-border);
}

.rule--no {
  color: var(--red);
}

.rule--no .rule__mark {
  border-color: var(--red-border);
}

/* Notes and alerts ---------------------------------------------------------------------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--red-border);
  border-radius: var(--radius-inner);
  background: #fff7f6;
  color: var(--red);
  font-size: 14px;
}

.alert span {
  color: var(--ink);
}

.alert svg {
  flex: 0 0 auto;
  margin-top: 2px;
}

.note-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--green-border);
  border-radius: var(--radius-inner);
  font-size: 13px;
  color: var(--green);
}

.note-line span {
  color: var(--ink);
}

.note-line svg {
  flex: 0 0 auto;
  margin-top: 2px;
}

.note-line--bad {
  border-color: var(--red-border);
  color: var(--red);
}

.note--row {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
