/* Axity reset password — design tokens mirrored from apps/mobile/src/theme/tokens.ts.
   Keep in sync if you change the mobile palette. */

:root {
  /* Backgrounds */
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface2: #F2F3F5;

  /* Brand */
  --accent: #2F3E52;
  --accent-soft: rgba(47, 62, 82, 0.12);

  /* Text */
  --text1: #0F1115;
  --text2: rgba(15, 17, 21, 0.62);
  --text3: rgba(15, 17, 21, 0.38);

  /* Separators */
  --sep: rgba(15, 17, 21, 0.10);

  /* Status */
  --green: #2E7D4F;
  --green-text: #1F5E3A;
  --green-soft: rgba(46, 125, 79, 0.10);
  --orange: #B8832A;
  --red: #B23A2F;
  --red-text: #8C2A22;
  --red-soft: rgba(178, 58, 47, 0.08);

  /* Radii */
  --radius-md: 10px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
  font-size: 17px;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  min-height: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: flex;
  flex-direction: column;
}

.brand {
  margin-bottom: 24px;
}

.wordmark {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text1);
}

/* ─── States — only one visible at a time ─────────────────────────────── */
.state { display: none; flex: 1; }
.state.state-visible { display: block; }

.state h1 {
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 32px 0 8px;
}

.subtitle {
  font-size: 17px;
  line-height: 24px;
  color: var(--text2);
  margin: 0 0 28px;
}

/* ─── Form fields ────────────────────────────────────────────────────── */
.field {
  display: block;
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  background: var(--surface);
  border: 1px solid var(--sep);
  border-radius: var(--radius-md);
  font-size: 17px;
  color: var(--text1);
  font-family: inherit;
  transition: border-color 120ms ease;
  appearance: none;
  -webkit-appearance: none;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  border-width: 1.5px;
  padding: 0 15.5px; /* compensate the 0.5px border increase to avoid jitter */
}

/* ─── Strength meter ──────────────────────────────────────────────────── */
.strength {
  margin: -8px 0 16px;
}

.strength-bars {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

.strength-bars .bar {
  flex: 1;
  height: 3px;
  background: var(--accent-soft);
  border-radius: 2px;
  transition: background 120ms ease;
}

.strength-rules {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  font-size: 12px;
  color: var(--text3);
}

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

/* ─── Match message ──────────────────────────────────────────────────── */
.match-msg {
  font-size: 12px;
  margin: -12px 0 16px;
  min-height: 16px;
}

.match-msg.error { color: var(--red); }
.match-msg.ok    { color: var(--green); }

/* ─── Buttons ────────────────────────────────────────────────────────── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.068px;
  cursor: pointer;
  transition: opacity 120ms ease;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary:hover { opacity: 0.92; }
.btn-primary:active { opacity: 0.85; }

.btn-primary:disabled {
  background: rgba(47, 62, 82, 0.28);
  cursor: not-allowed;
}

.btn-primary.as-link {
  text-decoration: none;
}

/* ─── Spinner ────────────────────────────────────────────────────────── */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
  margin: 32px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Success / Error icons ──────────────────────────────────────────── */
.success-icon, .error-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin: 16px 0 8px;
}

.success-icon {
  background: var(--green-soft);
  color: var(--green);
}

.error-icon {
  background: var(--red-soft);
  color: var(--red);
}

/* ─── Footer ─────────────────────────────────────────────────────────── */
footer {
  margin-top: auto;
  padding-top: 32px;
}

.legal {
  font-size: 12px;
  line-height: 17px;
  color: var(--text3);
  margin: 12px 0 0;
  text-align: center;
}
