/* auth.css — shared bits for the login / register forms */

/* Password row: input + reveal toggle + generate button laid out as flex so the
   controls can never overlap each other or sit on top of the typed value.
   The buttons stay direct children of .pw-field because js/auth.js looks up the
   input via `btn.parentElement`. */
.pw-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pw-field > input[type='password'],
.pw-field > input[type='text'] {
  flex: 1 1 auto;
  min-width: 0;
}

.pw-toggle {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: var(--text-tertiary);
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.pw-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.pw-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.pw-gen {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

.pw-gen:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
  color: var(--text);
}

.pw-gen:active {
  transform: translateY(1px);
}

.pw-gen:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.pw-gen svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

@media (max-width: 420px) {
  .pw-gen span {
    display: none;
  }
  .pw-gen {
    padding: 0.5rem 0.6rem;
  }
}
