.stack { display: flex; flex-direction: column; gap: 16px; }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card.inset { box-shadow: none; border: 1px solid #dfe4e8; background: #fafbfc; }
.code-block { padding: 14px 16px; border: 1px solid #c9d2da; border-radius: 10px; background: #f5f7f9; overflow-wrap: anywhere; font-size: 1.05rem; letter-spacing: .08em; }
.mfa-qr-wrap { display: flex; align-items: center; justify-content: center; width: fit-content; max-width: 100%; padding: 16px; border: 1px solid #d7dee4; border-radius: 14px; background: #fff; }
.mfa-qr { display: block; width: min(280px, 72vw); height: auto; aspect-ratio: 1 / 1; }
.mfa-manual-setup { max-width: 680px; }
.mfa-manual-setup summary { cursor: pointer; font-weight: 650; }
.mfa-manual-setup[open] summary { margin-bottom: 12px; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 640px; }
.recovery-grid code { display: block; padding: 12px 14px; border: 1px solid #c9d2da; border-radius: 9px; background: #f7f9fa; font-size: 1rem; letter-spacing: .06em; }
.button.danger { background: #9f2d25; color: #fff; border-color: #9f2d25; }
.button.danger:hover { background: #7d211b; }
.auth-card .muted, .muted { color: #60707c; }
.auth-card input[name="code"] { letter-spacing: .08em; font-size: 1.08rem; }

/* Premium challenge page. Login shell styles are reused from login.css and these
   rules only affect the verification step. */
.havren-mfa-challenge .mfa-form-inner { width: min(100%, 430px); }
.havren-mfa-challenge .mfa-heading { margin-bottom: 18px; }
.havren-mfa-challenge .mfa-heading p { max-width: 370px; margin-left: auto; margin-right: auto; }
.havren-mfa-challenge .mfa-challenge-notice {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 11px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #b8e4dd;
  border-radius: 12px;
  background: #eefaf8;
  color: #186b65;
  font-size: 12.5px;
  line-height: 1.4;
}
.havren-mfa-challenge .mfa-notice-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #0b9189;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}
.havren-mfa-challenge .mfa-login-form { gap: 8px; }
.havren-mfa-challenge .mfa-login-form .login-field { margin-bottom: 0; }
.havren-mfa-challenge .mfa-code-wrap { margin-bottom: 10px; }
.havren-mfa-challenge .mfa-code-wrap input {
  letter-spacing: .035em;
  font-variant-numeric: tabular-nums;
}
.havren-mfa-challenge .mfa-attempts {
  margin: 16px 0 0;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.45;
  color: #677f8a;
}
.havren-mfa-challenge .mfa-start-divider {
  height: 1px;
  margin: 23px 0 0;
  background: #dbe6e8;
}
.havren-mfa-challenge .mfa-start-over { margin-top: 16px; }
.havren-mfa-challenge .mfa-start-over a { font-weight: 850; }

@media (max-width: 720px) {
  .grid.two, .recovery-grid { grid-template-columns: 1fr; }
  .mfa-qr-wrap { width: 100%; box-sizing: border-box; }
}

/* Mobile MFA: use the same single-card behavior as login, but remove secondary
   desktop content and give the verification task extra vertical breathing room. */
@media (max-width: 760px) {
  .havren-mfa-challenge .login-form-panel { padding: 32px 24px 28px; }
  .havren-mfa-challenge .login-form-brand { margin-bottom: 22px; }
  .havren-mfa-challenge .mfa-heading h1 { font-size: 29px; }
  .havren-mfa-challenge .mfa-heading p { font-size: 13px; }
  .havren-mfa-challenge .mfa-challenge-notice {
    grid-template-columns: 30px 1fr;
    padding: 11px 12px;
    font-size: 12px;
  }
  .havren-mfa-challenge .mfa-code-wrap input {
    height: 52px;
    font-size: 16px;
    letter-spacing: .025em;
  }
  .havren-mfa-challenge .login-submit { min-height: 52px; }
  .havren-mfa-challenge .mfa-attempts { font-size: 11px; }
  .havren-mfa-challenge .mfa-start-divider { margin-top: 20px; }
}

@media (max-width: 420px) {
  .havren-mfa-challenge { padding-left: 12px; padding-right: 12px; }
  .havren-mfa-challenge .login-form-panel { padding: 27px 20px 24px; }
  .havren-mfa-challenge .mfa-heading h1 { font-size: 27px; }
  .havren-mfa-challenge .mfa-challenge-notice { border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .havren-mfa-challenge .login-submit { transition: none; }
}
