/* Reset password page — Issue #632 */

:root {
  --bg:           #EFE9DF;
  --surface:      #FFFFFF;
  --surface-2:    #FBF7F0;
  --ink:          #1A1714;
  --ink-2:        #3A332D;
  --muted:        #7A716A;
  --line:         #E7DFD3;
  --line-2:       #D6CDBE;
  --accent:       #B26A3A;
  --accent-ink:   #97582E;
  --accent-soft:  #F2E6DB;
  --success:      #5B7A52;
  --danger:       #B6432B;
  --warn:         #C28A2E;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  --f-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --f-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(ellipse 80% 60% at 15% -10%, rgba(178, 106, 58, .06), transparent 60%),
    radial-gradient(ellipse 80% 60% at 90% 110%, rgba(26, 23, 20, .04), transparent 60%);
}

.topbar {
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand .mark {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--f-display);
  font-style: italic;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
}
.brand .wordmark { font-family: var(--f-display); font-size: 18px; letter-spacing: .01em; }
.brand .wordmark em { font-style: italic; color: var(--accent-ink); margin-left: 2px; font-weight: 500; }
.topbar .help {
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
}
.topbar .help:hover { color: var(--ink); }

main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px 20px 64px;
}

.card {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 48px 44px 40px;
  box-shadow: 0 1px 2px rgba(26, 23, 20, .04), 0 20px 60px -30px rgba(26, 23, 20, .25);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent) 35%, var(--accent-ink) 65%, transparent);
  opacity: .9;
}

@media (max-width: 520px) {
  .card { padding: 36px 24px 32px; border-radius: var(--r-lg); }
  .topbar { padding: 18px 20px; }
}

.eyebrow {
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .16em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  display: inline-block;
}
.eyebrow .dot.success-dot { background: var(--success); }

.glyph {
  width: 64px;
  height: 64px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  position: relative;
}
.glyph svg { width: 28px; height: 28px; }

h1 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -.01em;
  margin: 0 0 14px;
  color: var(--ink);
}
h1 em { font-style: italic; color: var(--accent-ink); font-weight: 400; }

.lead {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 24px;
  max-width: 44ch;
}
.lead b { font-weight: 500; color: var(--ink); }

/* ---------- Form ---------- */
.form { display: flex; flex-direction: column; gap: 14px; margin: 0 0 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.input-wrap:focus-within {
  border-color: var(--accent-ink);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input-wrap.has-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(182, 67, 43, .18);
}
.input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--f-sans);
  font-size: 15px;
  color: var(--ink);
  padding: 14px;
  min-height: 24px;
  letter-spacing: .02em;
}
.input-wrap input::placeholder { color: var(--muted); opacity: .6; }
.input-wrap .reveal {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 8px 14px 8px 8px;
  display: grid;
  place-items: center;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.input-wrap .reveal:hover { color: var(--ink); }
.field-hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
.field-hint.error { color: var(--danger); }
.field-hint.match {
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 6px;
}
.field-hint.match svg { width: 14px; height: 14px; }

/* ---------- Strength meter ---------- */
.strength { margin-top: 2px; }
.strength-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  height: 4px;
  margin-bottom: 6px;
}
.strength-bar span { background: var(--line); border-radius: 2px; transition: background .2s; }
.strength[data-level="1"] .strength-bar span:nth-child(-n+1) { background: var(--danger); }
.strength[data-level="2"] .strength-bar span:nth-child(-n+2) { background: var(--warn); }
.strength[data-level="3"] .strength-bar span:nth-child(-n+3) { background: var(--accent); }
.strength[data-level="4"] .strength-bar span { background: var(--success); }
.strength-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.strength-label b { font-weight: 500; color: var(--ink-2); }

.requirements {
  margin: 6px 0 4px;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
}
.requirements li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.requirements li .check {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1.2px solid var(--line-2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.requirements li .check svg { width: 9px; height: 9px; color: #fff; opacity: 0; transition: opacity .15s; }
.requirements li.ok { color: var(--ink-2); }
.requirements li.ok .check { background: var(--success); border-color: var(--success); }
.requirements li.ok .check svg { opacity: 1; }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 24px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--f-sans);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .01em;
  padding: 14px 24px;
  min-height: 50px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s, transform .05s;
  text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover:not(:disabled) { background: var(--accent-ink); }
.btn-link {
  background: transparent;
  color: var(--accent-ink);
  padding: 0;
  min-height: 0;
  border: none;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(151, 88, 46, .3);
  text-decoration-thickness: 1px;
}
.btn-link:hover { text-decoration-color: var(--accent-ink); }

/* ---------- Account chip + meta ---------- */
.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  width: fit-content;
  max-width: 100%;
}
.account-chip .av {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
}
.account-chip .em {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.security {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}
.security b { color: var(--ink-2); font-weight: 500; }
.security a { color: var(--accent-ink); }

footer {
  padding: 18px 28px 32px;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--muted);
}
footer .links {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
footer .links a { color: var(--muted); text-decoration: none; text-transform: uppercase; }
footer .links a:hover { color: var(--ink); }

/* ---------- Loading / success / error glyphs ---------- */
.spinner {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2.5px solid var(--line);
  border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.glyph--loading { background: var(--surface); border-color: var(--line-2); }
.progress {
  margin: 8px 0 22px;
  height: 3px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress::after {
  content: '';
  position: absolute;
  inset: 0 70% 0 0;
  background: var(--accent);
  border-radius: 999px;
  animation: slide 1.6s ease-in-out infinite;
}
@keyframes slide {
  0% { left: -30%; right: 100%; }
  50% { left: 30%; right: 30%; }
  100% { left: 100%; right: -30%; }
}

.glyph--success {
  background: rgba(91, 122, 82, .12);
  border-color: rgba(91, 122, 82, .35);
}
.glyph--success svg { color: var(--success); }
.check-anim {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: draw .5s .15s ease forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.glyph--error {
  background: rgba(182, 67, 43, .10);
  border-color: rgba(182, 67, 43, .35);
}
.glyph--error svg { color: var(--danger); }
.warn-strip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--danger);
  background: rgba(182, 67, 43, .10);
  border: 1px solid rgba(182, 67, 43, .35);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  margin-bottom: 18px;
}
.warn-strip .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--danger);
}

.state { display: none; }
.state.is-visible { display: block; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(26, 23, 20, .25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 50;
  max-width: calc(100% - 40px);
  text-align: center;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
