/* ============================================================
   ChampStudios — auth pages (login / register / reset)
   Shared dark/gold card design, mobile-first, safe-area aware.
   ============================================================ */
:root {
  --gold: #f4b021;
  --gold-2: #f7c04a;
  --muted: #a9a297;
  --line: rgba(255, 255, 255, 0.12);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  background: #050403;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input { font: inherit; }

.ascreen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-content: safe center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(28px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
  background: radial-gradient(1100px 500px at 50% -10%, rgba(244, 176, 33, 0.10), transparent 60%), #050403;
}

.abrand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: #f4efe6;
  margin-bottom: 22px;
}
.abrand .logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #241704;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(244, 176, 33, 0.2);
}
.abrand .dot { color: var(--gold); }

.acard {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 430px;
  background: linear-gradient(180deg, #0d0a06, #070502);
  border: 1px solid rgba(244, 176, 33, 0.45);
  border-radius: 18px;
  padding: 28px 22px 22px;
  box-shadow: 0 0 0 1px rgba(244, 176, 33, 0.06), 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 44px rgba(244, 176, 33, 0.14);
  animation: acardin 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes acardin { from { opacity: 0; transform: translateY(18px) scale(0.985); } to { opacity: 1; transform: none; } }
.acard h1 { font-size: 26px; font-weight: 700; color: #fff; text-align: center; letter-spacing: -0.3px; }
.atag { margin-top: 7px; text-align: center; color: #8e887e; font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em; }
.asub { margin-top: 8px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.asub a { color: var(--gold); }

.afield {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 14px;
  background: #080603;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 11px;
  padding: 0 12px;
  height: 52px;
  transition: border-color 0.22s, box-shadow 0.22s;
}
.afield:focus-within { border-color: rgba(244, 176, 33, 0.7); box-shadow: 0 0 0 3px rgba(244, 176, 33, 0.09); }
.afield.bad { border-color: rgba(255, 120, 100, 0.75); box-shadow: 0 0 0 3px rgba(255, 120, 100, 0.10); }
.afield > svg { width: 19px; height: 19px; flex: none; color: var(--muted); transition: transform 0.22s, color 0.22s; }
.afield:focus-within > svg { transform: scale(1.08); color: var(--gold); }
.afield input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: #fff;
  font-size: 16px; /* ≥16px prevents iOS input zoom */
  height: 100%;
  padding: 0;
}
.afield input::placeholder { color: rgba(255, 255, 255, 0.42); }

.aeye {
  flex: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.aeye:hover { background: rgba(229, 169, 53, 0.15); }
.aeye svg { width: 19px; height: 19px; color: rgba(255, 255, 255, 0.75); }
.aeye.on svg { color: var(--gold); }

/* live password-rule feedback */
.apw-hint {
  margin-top: 8px;
  padding-left: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: color 0.2s;
}
.apw-hint.done { color: #7ee2a4; }

.aerr {
  display: none;
  margin-top: 10px;
  color: #ff9384;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
}
.aerr.show { display: block; animation: aerrin 0.25s ease both; }
@keyframes aerrin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes ashake { 10%, 90% { transform: translateX(-2px); } 30%, 70% { transform: translateX(4px); } 50% { transform: translateX(-4px); } 100% { transform: none; } }
.acard.shake { animation: ashake 0.4s ease; }

.abtn {
  position: relative;
  overflow: hidden;
  display: block;
  margin-top: 18px;
  text-align: center;
  padding: 16px;
  border-radius: 11px;
  color: #241704;
  font-size: 16.5px;
  font-weight: 700;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  box-shadow: 0 4px 16px rgba(244, 176, 33, 0.22);
  transition: transform 0.12s ease, box-shadow 0.22s;
  -webkit-tap-highlight-color: transparent;
}
.abtn:hover { box-shadow: 0 6px 24px rgba(244, 176, 33, 0.3); }
.abtn:active { transform: scale(0.985); }
.abtn[disabled] { opacity: 0.6; cursor: not-allowed; }
.abtn.loading { color: transparent; pointer-events: none; }
.abtn.loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  border: 2px solid rgba(36, 23, 4, 0.35);
  border-top-color: #241704;
  animation: aspin 0.7s linear infinite;
}
@keyframes aspin { to { transform: rotate(360deg); } }

.aalt {
  display: block;
  margin-top: 14px;
  text-align: center;
  color: var(--gold);
  font-size: 13.5px;
  font-weight: 600;
  transition: color 0.18s;
}
.aalt:hover { color: #ffca62; }

.aterms { margin-top: 18px; text-align: center; color: #8e887e; font-size: 12px; line-height: 1.6; }
.aterms a { color: #e5a935; font-weight: 600; }

.aok {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 11px;
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #7ee2a4;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
.aok.show { display: block; }

.acheck { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); margin-top: 14px; line-height: 1.5; }
.acheck input { accent-color: var(--gold); width: 17px; height: 17px; margin-top: 2px; flex: none; }
.acheck a { color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  .acard, .aerr, .acard.shake { animation: none !important; }
  .afield, .abtn, .aeye, .aalt { transition: none !important; }
}

/* ---------- MFA views (stage #021) ---------- */
.mfa-code {
  display: flex;
  margin-top: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  transition: border-color 0.2s ease;
}
.mfa-code:focus-within {
  border-color: var(--gold);
}
.mfa-code input {
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: none;
  outline: none;
  color: inherit;
  font-size: 20px;
  letter-spacing: 0.35em;
  text-align: center;
}
.mfa-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted, #8a8378);
}
.mfa-steps {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-top: 14px;
}
.mfa-steps .mfa-code {
  margin-top: 0;
}
.mfa-steps .abtn {
  margin-top: 4px;
}
.mfa-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.mfa-qr-wrap .mfa-qr {
  width: 168px;
  height: 168px;
}
.mfa-qr {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #fff;
}
.mfa-qr-fallback {
  font-size: 12px;
  color: var(--muted, #8a8378);
}
.mfa-step {
  font-size: 13px;
  color: var(--muted, #8a8378);
  text-align: center;
  max-width: 340px;
}
.mfa-step-done {
  font-weight: 700;
  color: inherit;
}
.mfa-secret {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
}
.mfa-secret-label {
  grid-column: 1 / -1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #8a8378);
}
.mfa-secret-code {
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.6;
  color: #ffffff; /* near-white on a LIGHTER raised surface — WCAG AAA (~19:1) */
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  overflow-wrap: anywhere;
  word-break: break-all;
  max-width: 100%;
}
.mfa-secret-code:focus-visible {
  outline: 2px solid var(--gold, #f4b021);
  outline-offset: 2px;
}
.mfa-copy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--gold-deep, #c8891a);
  border-radius: 8px;
  background: rgba(244, 176, 33, 0.12);
  color: var(--gold, #f4b021);
  cursor: pointer;
  white-space: nowrap;
}
.mfa-copy svg {
  width: 15px;
  height: 15px;
}
.mfa-copy:focus-visible {
  outline: 2px solid var(--gold, #f4b021);
  outline-offset: 2px;
}
.mfa-copy.copied {
  border-color: rgba(74, 222, 128, 0.5);
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
}
.mfa-recovery-copy {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--gold-deep, #c8891a);
  border-radius: 8px;
  background: rgba(244, 176, 33, 0.12);
  color: var(--gold, #f4b021);
  cursor: pointer;
}
.mfa-recovery-copy.copied {
  border-color: rgba(74, 222, 128, 0.5);
  color: #4ade80;
}
.mfa-recovery {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--gold-deep, #c8891a);
  border-radius: 14px;
  background: rgba(244, 176, 33, 0.08);
}
.mfa-recovery-title {
  display: block;
  font-weight: 800;
  color: var(--gold, #f4b021);
}
.mfa-recovery-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted, #8a8378);
}
.mfa-recovery-list {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  list-style: none;
  padding: 0;
}
.mfa-recovery-list li {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  text-align: center;
}
.mfa-recovery-copy {
  margin-top: 10px;
}
.mfa-loading {
  padding: 20px 0;
  color: var(--muted, #8a8378);
  font-size: 13px;
}
.mfa-done-icon {
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(74, 222, 128, 0.14);
  color: #4ade80;
  font-size: 22px;
}
.mfa-code-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
