/*
 * Brand shell — the shared visual layer for the WeChat visitor-flow pages
 * (Views/User/Register, NeedToSubscribe, RegisterSuccess, MailInfo,
 * MailInfoSuccess).
 *
 * Every value comes from `brand-tokens.css` (`--bsd-*`). No literal brand
 * hexes live here — those belong to the token file only.
 *
 * Shell API kept stable on purpose, so restyling the five views stays a
 * reviewable diff:
 *   .nx-page .nx-header .nx-header__eyebrow .nx-header__title .nx-header__sub
 *   .nx-card-shell .nx-card .nx-form-group .nx-label .nx-input
 *   .nx-btn .nx-btn--primary .nx-footer .nx-footer__brand
 * Added by this layer: .brand-spectrum .brand-bar .brand-logo .nx-status
 *   .nx-countdown .nx-qr .nx-link .nx-form-actions
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: var(--bsd-root);
  -webkit-text-size-adjust: 100%;
}

@media (max-width: 991px) {
  html {
    font-size: var(--bsd-root-mobile);
  }
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background-color: var(--bsd-surface);
  color: var(--bsd-ink);
  font-family: var(--bsd-font-body);
  font-size: var(--bsd-text-body-mobile);
  line-height: var(--bsd-leading-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ── The 20px spectrum bar — one per surface, at the very top ───────── */

.brand-spectrum {
  height: var(--bsd-spectrum-height);
  width: 100%;
  background-image: var(--bsd-spectrum);
  flex: 0 0 auto;
}

/* ── Brand bar — the logo, on a hairline ───────────────────────────── */

.brand-bar {
  flex: 0 0 auto;
  background: var(--bsd-surface);
  border-bottom: 1px solid var(--bsd-hairline);
}

.brand-bar__inner {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: var(--bsd-container);
  margin: 0 auto;
  padding: var(--bsd-space-15) var(--bsd-space-20);
}

.brand-logo {
  display: block;
  height: 40px;
  width: auto;
}

@media (min-width: 992px) {
  .brand-logo {
    height: 56px;
  }
}

/* ── Page column ───────────────────────────────────────────────────── */

.nx-page {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 var(--bsd-space-20);
}

/* ── Header ────────────────────────────────────────────────────────── */

.nx-header {
  padding: var(--bsd-space-40) 0 var(--bsd-space-20);
}

.nx-header__eyebrow {
  display: inline-block;
  margin: 0 0 var(--bsd-space-10);
  color: var(--bsd-pink);
  font-family: var(--bsd-font-display);
  font-size: var(--bsd-text-overline);
  font-weight: 700;
  line-height: 1;
  letter-spacing: var(--bsd-track-overline);
  text-transform: uppercase;
}

.nx-header__title {
  margin: 0;
  color: var(--bsd-ink);
  font-family: var(--bsd-font-display);
  font-size: var(--bsd-text-h1);
  font-weight: 500;
  line-height: var(--bsd-leading-h1);
  letter-spacing: var(--bsd-track-h1);
}

@media (max-width: 1024px) {
  .nx-header__title {
    font-size: var(--bsd-text-h1-tablet);
    letter-spacing: var(--bsd-track-h1-tablet);
  }
}

@media (max-width: 991px) {
  .nx-header__title {
    font-size: var(--bsd-text-h1-mobile);
    letter-spacing: var(--bsd-track-h1-mobile);
  }
}

.nx-header__sub {
  margin: var(--bsd-space-10) 0 0;
  color: var(--bsd-border-strong);
  font-family: var(--bsd-font-body);
  font-size: var(--bsd-text-body-mobile);
  line-height: var(--bsd-leading-body-tight);
}

/* ── Card ──────────────────────────────────────────────────────────── */

.nx-card-shell {
  width: 100%;
  margin-bottom: var(--bsd-space-40);
}

.nx-card {
  background: var(--bsd-surface);
  border: 1px solid var(--bsd-hairline);
  border-radius: var(--bsd-radius-card);
  box-shadow: var(--bsd-shadow-card);
  padding: var(--bsd-space-30) var(--bsd-space-20);
}

/* ── Form controls ─────────────────────────────────────────────────── */

.nx-form-group {
  margin: 0 0 var(--bsd-space-20);
}

.nx-form-group:last-of-type {
  margin-bottom: 0;
}

.nx-label {
  display: block;
  margin: 0 0 var(--bsd-space-5);
  color: var(--bsd-ink);
  font-family: var(--bsd-font-display);
  font-size: var(--bsd-text-label);
  font-weight: 400;
}

.nx-label small {
  margin-left: var(--bsd-space-5);
  color: var(--bsd-muted);
  font-family: var(--bsd-font-body);
  font-size: var(--bsd-text-small);
  font-weight: 400;
}

.nx-input {
  display: block;
  width: 100%;
  height: 42px;
  padding: 10px 12px;
  background: var(--bsd-surface);
  border: 1px solid var(--bsd-border-strong);
  border-radius: var(--bsd-radius-input);
  color: var(--bsd-ink);
  font-family: var(--bsd-font-body);
  font-size: var(--bsd-text-input-mobile);
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--bsd-transition);
}

.nx-input::placeholder {
  color: var(--bsd-muted);
  opacity: 1;
}

.nx-input:focus {
  outline: 2px solid var(--bsd-pink);
  outline-offset: 2px;
}

/* ── Actions + buttons ─────────────────────────────────────────────── */

.nx-form-actions {
  padding-top: var(--bsd-space-30);
}

.nx-btn {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 12px var(--bsd-space-30);
  border: 0;
  border-radius: var(--bsd-radius-pill);
  background: var(--bsd-cyan);
  color: var(--bsd-inverse);
  font-family: var(--bsd-font-display);
  font-size: var(--bsd-text-button-small);
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color var(--bsd-transition);
}

.nx-btn:active,
.nx-btn:focus-visible {
  background: var(--bsd-pink);
  color: var(--bsd-inverse);
}

@media (hover: hover) and (pointer: fine) {
  .nx-btn:hover {
    background: var(--bsd-pink);
    color: var(--bsd-inverse);
  }
}

/* ── Status block — the two success states + the QR state ──────────── */

.nx-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.nx-status__icon {
  width: 56px;
  height: 56px;
  margin: 0 0 var(--bsd-space-20);
  color: var(--bsd-pink);
}

.nx-status__title {
  margin: 0 0 var(--bsd-space-10);
  color: var(--bsd-ink);
  font-family: var(--bsd-font-display);
  font-size: var(--bsd-text-h4-mobile);
  font-weight: 600;
  line-height: var(--bsd-leading-h4);
  letter-spacing: var(--bsd-track-h4);
}

.nx-status__text {
  margin: 0;
  color: var(--bsd-border-strong);
  font-family: var(--bsd-font-body);
  font-size: var(--bsd-text-body-mobile);
  line-height: var(--bsd-leading-body-tight);
}

.nx-status .nx-btn {
  margin-top: var(--bsd-space-30);
}

.nx-status__note {
  margin: var(--bsd-space-20) 0 0;
  color: var(--bsd-muted);
  font-family: var(--bsd-font-body);
  font-size: var(--bsd-text-overline-sm);
  line-height: var(--bsd-leading-body-tight);
}

/* ── Framed QR plate ───────────────────────────────────────────────── */

.nx-qr {
  display: inline-block;
  margin: var(--bsd-space-30) 0 0;
  padding: 12px;
  background: var(--bsd-surface);
  border: 1px solid var(--bsd-hairline);
  border-radius: var(--bsd-radius-input);
}

.nx-qr img {
  display: block;
  width: 180px;
  max-width: 100%;
  height: auto;
}

/* ── Countdown pill ────────────────────────────────────────────────── */

.nx-countdown {
  display: inline-block;
  margin: var(--bsd-space-15) 0 0;
  padding: 5px var(--bsd-space-15);
  background: var(--bsd-blue-wash);
  color: var(--bsd-teal);
  border-radius: var(--bsd-radius-pill);
  font-family: var(--bsd-font-display);
  font-size: var(--bsd-text-small);
  font-weight: 600;
  line-height: 1.25;
}

/* ── Text link ─────────────────────────────────────────────────────── */

.nx-link {
  color: var(--bsd-pink);
  font-family: var(--bsd-font-display);
  font-size: var(--bsd-text-link-mobile);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--bsd-transition);
}

.nx-link:active {
  color: var(--bsd-pink-alt);
}

@media (hover: hover) and (pointer: fine) {
  .nx-link:hover {
    color: var(--bsd-pink-alt);
  }
}

/* ── Footer — owned by the layout, full-bleed hairline ─────────────── */

.nx-footer {
  flex: 0 0 auto;
  margin-top: auto;
  border-top: 1px solid var(--bsd-hairline);
}

.nx-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--bsd-space-10);
  max-width: var(--bsd-container);
  margin: 0 auto;
  padding: var(--bsd-space-30) var(--bsd-space-20) calc(var(--bsd-space-30) + env(safe-area-inset-bottom));
}

.nx-footer__brand {
  color: var(--bsd-muted);
  font-family: var(--bsd-font-body);
  font-size: var(--bsd-text-overline-sm);
  line-height: var(--bsd-leading-body-tight);
}

.nx-footer .brand-logo {
  height: 24px;
}
