/* Model Rewards — redirect page
   Light, mobile-first.
   Pure CSS, no frameworks. */

:root {
  --bg: #ffffff;
  --ink: #0a0a0a;
  --ink-soft: #4a4a4a;
  --ink-muted: #8a8a8a;
  --line: #e6e6e6;
  --surface: #fafafa;
  --accent: #0a0a0a;
  --on-accent: #ffffff;
  --accent-shadow: rgba(10, 10, 10, 0.18);
  --accent-shadow-strong: rgba(10, 10, 10, 0.30);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --focus: 0 0 0 3px rgba(10, 10, 10, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

#redirectBody {
  width: 100%;
  max-width: 440px;
}

/* ---------- Card ---------- */

.mr-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

.mr-logo {
  width: min(100%, 240px);
  height: 110px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  object-fit: contain;
  display: block;
  margin: 0 auto 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.mr-eyebrow {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
  margin: 0 0 14px;
}

.mr-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 28px;
  color: var(--ink);
}

/* ---------- Step buttons (two-step flow) ---------- */

.mr-step {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  margin: 0 0 10px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: transform 80ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 200ms ease, opacity 160ms ease;
}

.mr-step:active { transform: scale(0.99); }
.mr-step:focus-visible { outline: none; box-shadow: var(--focus); }

.mr-step-heading {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.06em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

.mr-step-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.mr-step-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mr-step-code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--ink);
  line-height: 1.1;
}

.mr-step-arrow {
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-muted);
  transition: transform 160ms ease, color 160ms ease;
}

.mr-step-copy-actions {
  position: absolute;
  right: 18px;
  top: 50%;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
}

.mr-step-copy-icon {
  position: relative;
  display: block;
  width: 28px;
  height: 28px;
  transition: opacity 180ms ease, transform 180ms ease;
}

.mr-step-copy-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 5px;
  width: 12px;
  height: 15px;
  border: 2px solid var(--accent);
  border-radius: 3px;
  background: var(--bg);
}

.mr-step-copy-icon::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 8px;
  width: 12px;
  height: 15px;
  border: 2px solid var(--accent);
  border-radius: 3px;
  background: var(--bg);
}

.mr-step-check {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  color: #1f7a3a;
  background: #e7f6ec;
  border: 1px solid #cfe9d6;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 220ms ease, transform 220ms ease;
}

/* Step 1 — Copy code (default state: emphasized, ready to tap) */
.mr-step-copy {
  position: relative;
  justify-content: center;
  min-height: 92px;
  padding-left: 48px;
  padding-right: 48px;
  text-align: center;
  border-color: var(--accent);
  background: var(--surface);
}

.mr-step-copy .mr-step-body {
  align-items: center;
  flex: 0 1 auto;
}

.mr-step-copy:hover { border-color: var(--accent); }

/* Step 1 — done state */
.mr-step-copy.is-done {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-soft);
}

.mr-step-copy.is-done .mr-step-code { color: var(--ink-soft); }

.mr-step-copy.is-done .mr-step-copy-icon {
  opacity: 0;
  transform: scale(0.6);
}

.mr-step-copy.is-done .mr-step-check {
  opacity: 1;
  transform: scale(1);
}

/* Step 2 — Download */
.mr-step-download {
  position: relative;
  justify-content: center;
  min-height: 72px;
  padding-left: 48px;
  padding-right: 48px;
  text-align: center;
}

.mr-step-download .mr-step-body {
  align-items: center;
  flex: 0 1 auto;
}

.mr-step-download .mr-step-arrow {
  position: absolute;
  right: 18px;
}

/* Secondary: present but visually subordinate to Step 1 until code is copied. */
.mr-step-download.is-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong, var(--line));
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.mr-step-download.is-secondary .mr-step-label { color: var(--ink-soft); }
.mr-step-download.is-secondary .mr-step-arrow { color: var(--ink-soft); }

.mr-step-download.is-ready {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 10px 24px var(--accent-shadow);
  animation: mr-pulse 2.4s ease-in-out 0.2s 2;
  transition: background-color 240ms ease, color 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
}

.mr-step-download.is-ready .mr-step-label { color: var(--on-accent); }
.mr-step-download.is-ready .mr-step-arrow { color: var(--on-accent); }
.mr-step-download.is-ready:hover .mr-step-arrow { transform: translateX(3px); }

@keyframes mr-pulse {
  0%, 100% { box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 10px 24px var(--accent-shadow); }
  50%      { box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 14px 36px var(--accent-shadow-strong); }
}

@media (prefers-reduced-motion: reduce) {
  .mr-step-download.is-ready { animation: none; }
  .mr-step, .mr-step-arrow, .mr-step-copy-icon, .mr-step-check { transition: none; }
}

/* ---------- Hint between steps ---------- */

.mr-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 18px;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
}

.mr-hint:empty { display: none; }
.mr-hint.is-done { color: var(--ink-muted); font-weight: 500; }
.mr-hint.is-error {
  flex-direction: column;
  gap: 8px;
}

.mr-code-fallback {
  width: min(100%, 220px);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
}

.mr-code-fallback:focus {
  outline: none;
  box-shadow: var(--focus);
}

/* ---------- Secondary text link ---------- */

.mr-btn-text {
  display: inline-block;
  margin-top: 16px;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 10px 12px;
  cursor: pointer;
}

.mr-btn-text:hover { color: var(--ink); }

/* ---------- Powered by footer ---------- */

.mr-foot {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
}

.mr-foot-logo {
  width: 116px;
  max-width: 52vw;
  height: auto;
  max-height: 34px;
  object-fit: contain;
  opacity: 0.9;
}

/* ---------- Desktop / unsupported state ---------- */

.mr-info {
  text-align: center;
  padding: 32px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.mr-info h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.mr-info p {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
}

.mr-qr {
  display: block;
  margin: 0 auto 16px;
  background: #ffffff;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.mr-url {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--ink-muted);
  word-break: break-all;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  max-width: 100%;
}

/* Visually hidden (for a11y live regions) */
.mr-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
