/* Reauth modal -sensitive-action re-authentication */
/* Visual layer for the wedge in static/ui/js/auth-reauth.js. */

.reauth-scrim {
  position: fixed;
  inset: 0;
  background: var(--scrim-overlay);
  z-index: 500;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-emphasized);
}

/* Respect the `hidden` HTML attribute -without this rule the
   `.reauth-scrim` class's `display: grid` overrides the browser's
   `[hidden]{display:none}` (lower specificity), leaving an invisible
   but pointer-blocking overlay across the page. */
.reauth-scrim[hidden] {
  display: none;
}

.reauth-scrim.is-open {
  opacity: 1;
}

.reauth-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: min(420px, 100%);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transform: translateY(8px);
  transition: transform var(--duration-slow) var(--ease-emphasized);
}

.reauth-scrim.is-open .reauth-modal {
  transform: translateY(0);
}

.reauth-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.reauth-head .ic {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.reauth-title {
  font-size: var(--font-size-prominent-lg);
  font-weight: 800;
  letter-spacing: var(--letter-spacing-prominent);
  margin: 0;
  line-height: 1.2;
}

.reauth-action {
  font-size: var(--font-size-caption);
  color: var(--muted);
  margin-top: var(--space-1);
}

.reauth-body label {
  display: block;
  font-size: var(--font-size-micro);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-micro-label);
  color: var(--muted);
  margin-bottom: var(--space-1);
}

/* PIN variant -single masked input, centred + letter-spaced so each
   masked dot reads as its own slot. Inherits the canonical
   .password-input-field height + chrome from components/37-password-input.css;
   the difference here is purely typographic (centred, monospaced digits,
   wider tracking) plus a soft surface tint that lifts the field on focus. */
.password-input-field.reauth-pin {
  text-align: center;
  font-size: var(--font-size-prominent-lg);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  background: var(--surface-soft);
  caret-color: var(--primary);
}

.password-input-field.reauth-pin:hover:not(:focus-visible) {
  background: var(--surface);
}

.password-input-field.reauth-pin:focus-visible {
  background: var(--primary-light);
}

.password-input-field.reauth-pin::placeholder {
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  color: var(--muted);
  opacity: 0.4;
}

.reauth-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-small);
  font-weight: 600;
  display: none;
}

.reauth-error.is-visible {
  display: block;
}

.reauth-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.reauth-actions .btn {
  flex: 1 1 0;
}

/* Locked-out variant -swap warning swatch for error triad, hide input */
.reauth-modal.is-locked .reauth-head .ic {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error);
}

.reauth-modal.is-locked .password-input,
.reauth-modal.is-locked .reauth-body label {
  display: none;
}
