/* ==================================================================
   /reset-password: ask for a link, then choose a new password.

   Loaded after assets/theme.css (tokens) and assets/tools/tool.css (top
   bar, .t-page, .t-card, .t-btn), so the page shares the tools' chrome
   and light/dark toggle.

   One step shows at a time. <html data-rp-view> names it and
   data-rp-notice names a problem with the link; an inline script in
   <head> sets both before first paint, then assets/password-reset.js
   changes them. Driving this from CSS keeps the layout from jumping.
================================================================== */

.rp-main { max-inline-size: 34rem; }

.rp-view { display: none; }
:root[data-rp-view="request"] #rp-request,
:root[data-rp-view="sent"] #rp-sent,
:root[data-rp-view="set"] #rp-set,
:root[data-rp-view="done"] #rp-done { display: block; }

.rp-notice { display: none; }
:root[data-rp-notice="expired"] #rp-notice-expired,
:root[data-rp-notice="failed"] #rp-notice-failed { display: block; }

.rp-title {
  font-size: clamp(1.6rem, 1.35rem + 1.1vw, 2rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.625rem;
}
/* Focus lands on the heading when the step changes, so screen readers
   start there. It isn't a control, so it gets no ring. */
.rp-title:focus { outline: none; }

.rp-lede { color: var(--ink-mid); margin: 0 0 1.25rem; }
.rp-muted { color: var(--ink-soft); font-size: 0.94rem; margin: 0 0 1.25rem; }
.rp-address { overflow-wrap: anywhere; color: var(--ink); }

.rp-notice {
  margin: 0 0 1rem;
  padding: 0.75rem 0.875rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  background: var(--gold-soft);
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.5;
}

/* ---------- Fields ---------- */
.rp-form { display: grid; gap: 1rem; }
.rp-field { display: grid; gap: 0.375rem; }
.rp-field > label { font-weight: 700; font-size: 0.94rem; color: var(--ink); }

.rp-field input {
  inline-size: 100%;
  min-block-size: 48px;
  padding: 0.625rem 0.75rem;
  font: inherit;
  font-size: 1rem;              /* 16px or more: no zoom on focus in iOS */
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink-soft);   /* 3:1 or more against the card */
  border-radius: 8px;
}
.rp-field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.rp-field input[aria-invalid="true"],
.rp-field input:user-invalid { border-color: var(--fail); }

/* The password and its Show button read as one control. */
.rp-password { display: flex; gap: 0.5rem; }
.rp-password input { flex: 1; min-inline-size: 0; }
.rp-reveal {
  flex: none;
  min-inline-size: 4.5rem;
  min-block-size: 48px;
  padding-inline: 0.875rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--ink-soft);
  border-radius: 8px;
  cursor: pointer;
}
.rp-reveal:hover { border-color: var(--accent); }
.rp-reveal:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.rp-hint { margin: 0; color: var(--ink-soft); font-size: 0.88rem; }
.rp-error { margin: 0; color: var(--fail); font-size: 0.92rem; font-weight: 600; }
.rp-error::before { content: "⚠ "; }   /* not colour alone */

.rp-submit { inline-size: 100%; min-block-size: 48px; font-size: 1rem; }
.rp-submit[aria-busy="true"] { cursor: progress; opacity: 0.75; }

.rp-actions { display: flex; flex-wrap: wrap; gap: 0.625rem; }
.rp-actions .t-btn { min-block-size: 44px; display: inline-flex; align-items: center; text-decoration: none; }
.rp-actions .t-btn[aria-disabled="true"] { opacity: 0.55; cursor: default; }

/* Live regions: always rendered, even when empty, or a message added to
   them may not be announced. */
.rp-status { margin: 0; font-size: 0.94rem; color: var(--ink-mid); line-height: 1.5; }
#rp-sent-status { margin-block-start: 0.875rem; }
.rp-status.error { color: var(--fail); font-weight: 600; }
.rp-status a { color: var(--accent); font-weight: 600; }

.rp-alt { margin: 1.25rem 0 0; color: var(--ink-soft); font-size: 0.94rem; }
.rp-alt a { display: inline-block; padding-block: 0.25rem; font-weight: 600; }

/* Visually hidden, still read out. */
.rp-sr {
  position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.rp-hp { position: absolute; inset-inline-start: -10000px; inline-size: 1px; block-size: 1px; overflow: hidden; }

@media (max-width: 30rem) {
  .t-card.rp-view { padding: 1.25rem 1rem 1.125rem; }
}
