:root {
  --bv-recovery-ink: #111827;
  --bv-recovery-paper: #fffdf4;
  --bv-recovery-panel: #f7f4e9;
  --bv-recovery-blue: #315de8;
  --bv-recovery-blue-dark: #153594;
  --bv-recovery-mint: #e8f8ef;
  --bv-recovery-yellow: #fff6bf;
  --bv-recovery-red: #a51d2d;
  --bv-recovery-shadow: 7px 7px 0 var(--bv-recovery-ink);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.bv-password-reset-page {
  min-height: 100vh;
  margin: 0;
  color: var(--bv-recovery-ink);
  background:
    linear-gradient(rgba(17, 24, 39, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, 0.08) 1px, transparent 1px),
    #e9e6db;
  background-size: 32px 32px;
  font-family: "Spectral", Georgia, serif;
}

.bv-password-reset-shell {
  width: min(100% - 32px, 720px);
  margin: 0 auto;
  padding: clamp(28px, 7vh, 76px) 0 40px;
}

.bv-password-reset-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  color: var(--bv-recovery-ink);
  font: 700 15px/1 "Courier Prime", monospace;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.bv-password-reset-brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 3px solid var(--bv-recovery-ink);
  border-radius: 10px;
  background: var(--bv-recovery-blue);
  color: white;
  box-shadow: 4px 4px 0 var(--bv-recovery-ink);
  letter-spacing: 0;
}

.bv-password-reset-card {
  border: 4px solid var(--bv-recovery-ink);
  border-radius: 18px;
  padding: clamp(24px, 5vw, 48px);
  background: var(--bv-recovery-paper);
  box-shadow: var(--bv-recovery-shadow);
}

.bv-password-reset-kicker,
.bv-password-reset-state-label {
  margin-bottom: 12px;
  color: var(--bv-recovery-blue-dark);
  font: 700 13px/1.2 "Courier Prime", monospace;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.bv-password-reset-card h1,
.bv-password-reset-card h2 {
  margin: 0 0 14px;
  font-family: "Special Elite", "Courier Prime", monospace;
  line-height: 1.15;
}

.bv-password-reset-card h1 {
  font-size: clamp(30px, 6vw, 48px);
}

.bv-password-reset-card h2 {
  font-size: clamp(23px, 4vw, 31px);
}

.bv-password-reset-intro,
.bv-password-reset-state p {
  margin: 0 0 24px;
  font-size: 18px;
  line-height: 1.55;
}

.bv-password-reset-form,
.bv-password-reset-resend {
  display: grid;
  gap: 10px;
}

.bv-password-reset-form label,
.bv-password-reset-resend label {
  margin-top: 8px;
  font: 700 14px/1.2 "Courier Prime", monospace;
  text-transform: uppercase;
}

.bv-password-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.bv-password-reset-form input,
.bv-password-reset-resend input {
  width: 100%;
  min-height: 50px;
  border: 3px solid var(--bv-recovery-ink);
  border-radius: 8px;
  padding: 10px 13px;
  background: white;
  color: var(--bv-recovery-ink);
  font: 18px/1.2 "Courier Prime", monospace;
}

.bv-password-reset-form input:focus-visible,
.bv-password-reset-resend input:focus-visible,
.bv-password-reset-page button:focus-visible,
.bv-password-reset-page a:focus-visible,
.bv-auth-text-link:focus-visible {
  outline: 4px solid #f5bf33;
  outline-offset: 3px;
}

.bv-password-visibility {
  min-width: 70px;
  border: 3px solid var(--bv-recovery-ink);
  border-radius: 8px;
  background: #eaf0ff;
  color: var(--bv-recovery-ink);
  font: 700 12px/1 "Courier Prime", monospace;
  cursor: pointer;
}

.bv-password-reset-hint {
  margin: 2px 0 10px;
  color: #536071;
  font-size: 14px;
  line-height: 1.45;
}

.bv-password-reset-primary,
.bv-password-reset-secondary {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--bv-recovery-ink);
  border-radius: 8px;
  padding: 12px 18px;
  font: 700 14px/1.2 "Courier Prime", monospace;
  letter-spacing: 0.05em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.bv-password-reset-primary {
  margin-top: 8px;
  background: var(--bv-recovery-blue);
  color: white;
  box-shadow: 4px 4px 0 var(--bv-recovery-ink);
}

.bv-password-reset-primary:hover {
  background: var(--bv-recovery-blue-dark);
}

.bv-password-reset-primary:disabled {
  cursor: wait;
  opacity: 0.65;
}

.bv-password-reset-secondary {
  margin-top: 18px;
  background: white;
  color: var(--bv-recovery-ink);
}

.bv-password-reset-message {
  border: 2px solid var(--bv-recovery-red);
  border-radius: 8px;
  padding: 12px;
  background: #fff0f2;
  color: #7d1421;
  font: 700 14px/1.4 "Courier Prime", monospace;
}

.bv-password-reset-message[data-tone="success"],
.bv-auth-reset-status[data-tone="success"] {
  border-color: #166534;
  background: var(--bv-recovery-mint);
  color: #14532d;
}

.bv-password-reset-state {
  border-top: 2px solid #a4acb6;
  padding-top: 24px;
}

.bv-password-reset-invalid {
  border: 3px solid var(--bv-recovery-ink);
  border-radius: 12px;
  padding: 24px;
  background: var(--bv-recovery-yellow);
}

.bv-password-reset-resend {
  border-top: 2px solid rgba(17, 24, 39, 0.28);
  padding-top: 16px;
}

.bv-password-reset-success {
  border: 3px solid var(--bv-recovery-ink);
  border-radius: 12px;
  padding: 24px;
  background: var(--bv-recovery-mint);
}

.bv-password-reset-continue {
  width: 100%;
}

.bv-password-reset-loader {
  display: block;
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  border: 4px solid #bac4dc;
  border-top-color: var(--bv-recovery-blue);
  border-radius: 50%;
  animation: bv-password-spin 0.8s linear infinite;
}

.bv-password-reset-security-note {
  margin: 22px 8px 0;
  color: #3f4856;
  font: 14px/1.5 "Courier Prime", monospace;
  text-align: center;
}

/* Forgot-password request panel inside the existing sign-in gate. */
.bv-auth-text-link {
  display: inline-flex;
  width: fit-content;
  border: 0;
  padding: 7px 0;
  background: transparent;
  color: #244ea8;
  font: 700 13px/1.2 "Courier Prime", monospace;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.bv-auth-reset-request {
  border: 3px solid var(--bv-recovery-ink);
  border-radius: 10px;
  padding: 18px;
  background: var(--bv-recovery-paper);
}

.bv-auth-reset-request h4 {
  margin: 5px 0 8px;
  font: 700 22px/1.2 "Special Elite", "Courier Prime", monospace;
}

.bv-auth-reset-request p {
  margin: 0 0 14px;
}

.bv-auth-reset-submit {
  width: 100%;
  margin-top: 12px;
}

.bv-auth-reset-status {
  margin-top: 12px;
  border: 2px solid var(--bv-recovery-red);
  border-radius: 7px;
  padding: 10px;
  background: #fff0f2;
  color: #7d1421;
  font: 700 13px/1.4 "Courier Prime", monospace;
}

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

@media (max-width: 560px) {
  .bv-password-reset-shell {
    width: min(100% - 20px, 720px);
    padding-top: 18px;
  }

  .bv-password-reset-card {
    border-width: 3px;
    border-radius: 12px;
    padding: 22px 18px;
    box-shadow: 4px 4px 0 var(--bv-recovery-ink);
  }

  .bv-password-input-row {
    grid-template-columns: 1fr;
  }

  .bv-password-visibility {
    min-height: 44px;
  }

  .bv-password-reset-invalid,
  .bv-password-reset-success {
    padding: 18px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bv-password-reset-loader {
    animation-duration: 1.8s;
  }
}
