* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--rx-font-sans);
  background:
    radial-gradient(900px 520px at 18% 0%, rgba(18,52,68,.08), transparent 60%),
    radial-gradient(860px 520px at 100% 28%, rgba(189,108,70,.10), transparent 60%),
    var(--rx-surface-50);
  color: var(--rx-text-900);
}

.wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 640px;
  background: var(--rx-surface-50);
  border: 1px solid var(--rx-surface-200);
  border-radius: var(--rx-radius-lg);
  padding: 24px;
  box-shadow: var(--rx-shadow-2);
}

.brand {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.brand-img {
  height: 68px;
  width: auto;
  display: block;
}

h1 { margin: 0 0 6px 0; font-size: var(--rx-text-2xl); font-family: var(--rx-font-display); color: var(--rx-brand-900); }
h2 { margin: 0 0 8px 0; font-size: var(--rx-text-xl); font-family: var(--rx-font-display); color: var(--rx-brand-900); }
.sub { margin: 0 0 18px 0; color: var(--rx-text-500); font-size: var(--rx-text-sm); }

fieldset {
  border: 1px solid var(--rx-surface-200);
  border-radius: var(--rx-radius-md);
  padding: 14px;
  margin: 14px 0;
}
legend { color: var(--rx-text-500); padding: 0 8px; font-size: var(--rx-text-xs); }

label { display: block; font-size: var(--rx-text-xs); color: var(--rx-text-500); margin: 10px 0; }
input {
  margin-top: 6px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--rx-radius-md);
  border: 1px solid var(--rx-surface-200);
  background: var(--rx-surface-50);
  color: var(--rx-text-900);
  outline: none;
}
input:focus { border-color: var(--rx-accent-600); box-shadow: 0 0 0 4px rgba(189,108,70,0.14); }

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.actions { margin-top: 16px; }
button {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--rx-radius-md);
  border: 1px solid var(--rx-accent-600);
  background: var(--rx-accent-600);
  color: var(--rx-surface-50);
  font-weight: 700;
  cursor: pointer;
}
button:disabled { opacity: 0.6; cursor: not-allowed; }

.links {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.link {
  color: var(--rx-brand-900);
  text-decoration: none;
  font-size: var(--rx-text-sm);
}

.link:hover {
  text-decoration: underline;
}

.msg {
  margin: 14px 0 0 0;
  padding: 10px 12px;
  border-radius: var(--rx-radius-md);
  border: 1px dashed var(--rx-surface-200);
  background: rgba(18,52,68,0.04);
  white-space: pre-wrap;
  color: var(--rx-text-700);
  min-height: 42px;
}

.mfa-setup {
  margin-top: 14px;
  border: 1px solid var(--rx-surface-200);
  border-radius: var(--rx-radius-md);
  padding: 14px;
  background: rgba(18, 52, 68, 0.03);
}

.mfa-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  align-items: start;
}

.mfa-qr-wrap {
  width: 220px;
  height: 220px;
  border: 1px solid var(--rx-surface-200);
  border-radius: var(--rx-radius-md);
  overflow: hidden;
  background: #fff;
}

.mfa-qr {
  display: block;
  width: 100%;
  height: 100%;
}

.mfa-actions {
  margin-top: 10px;
}

@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; }
  .mfa-grid { grid-template-columns: 1fr; }
  .mfa-qr-wrap { width: 100%; height: auto; }
  .mfa-qr { aspect-ratio: 1 / 1; }
}
