/* ==========================================================================
   「深邃暗金 VIP」component language — landing / login / register / reset /
   pricing / account. Depends on tokens.css. Chat page keeps site.css.
   ========================================================================== */

/* ---- Page scaffold ------------------------------------------------------ */
.saas-page {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(198, 161, 91, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

.saas-wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px calc(32px + var(--safe-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.saas-page.center {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---- Top bar (SaaS pages) — dark glass, gold hairline ------------------- */
.saas-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.saas-topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--brand-hi);
  text-decoration: none;
}

.saas-topbar .brand .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand-grad);
  box-shadow: 0 0 0 1px rgba(198, 161, 91, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.saas-topbar .brand .brand-mark svg { width: 18px; height: 18px; fill: var(--on-brand); }

.saas-topbar .bar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--brand-hi);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.icon-btn:active { background: var(--surface-2); }

/* ---- Cards -------------------------------------------------------------- */
.s-card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: 22px;
}

.s-card + .s-card { margin-top: 0; }

.s-card-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
  color: var(--text);
}

/* ---- Buttons ------------------------------------------------------------ */
.s-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s, opacity .15s, border-color .15s, background .15s;
  color: var(--text);
  background: transparent;
}
.s-btn:active { opacity: .9; }
.s-btn-block { width: 100%; }

.s-btn-primary {
  background: var(--brand-grad);
  color: var(--on-brand);
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: var(--glow-gold);
}
.s-btn-primary:active { filter: brightness(0.94); }

.s-btn-ghost {
  background: transparent;
  border-color: var(--brand);
  color: var(--brand-hi);
}
.s-btn-ghost:active { background: var(--brand-soft); }

.s-btn-danger {
  background: transparent;
  border-color: var(--border);
  color: var(--danger);
}
.s-btn-danger:active { background: var(--surface-2); }

.s-btn-link {
  min-height: auto;
  padding: 4px 2px;
  background: none;
  color: var(--brand-hi);
  font-weight: 500;
  font-size: 14px;
}

.s-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ---- Forms -------------------------------------------------------------- */
.s-form { display: flex; flex-direction: column; gap: 14px; }

.s-field { display: flex; flex-direction: column; gap: 6px; }

.s-label { font-size: 13px; font-weight: 600; color: var(--text-sub); }

.s-input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  font-family: inherit;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.s-input::placeholder { color: var(--text-sub); opacity: .7; }
.s-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.s-error {
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
}

.s-hint { font-size: 13px; color: var(--text-sub); line-height: 1.5; }

.s-form-head { text-align: center; margin-bottom: 4px; }
.s-form-head h1 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}
.s-form-head p { font-size: 14px; color: var(--text-sub); }

.s-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

/* ---- Landing ------------------------------------------------------------ */
.landing-hero { text-align: center; padding: 32px 0 8px; }
.landing-hero .hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  border: 1px solid var(--border);
  color: var(--brand-hi);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}
.landing-hero h1 {
  font-family: var(--font-serif);
  font-size: 32px;
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}
.landing-hero .hero-sub {
  font-size: 15px;
  color: var(--text-sub);
  line-height: 1.7;
  max-width: 340px;
  margin: 0 auto 24px;
}
.landing-cta { display: flex; flex-direction: column; gap: 12px; }

.feature-list { display: flex; flex-direction: column; gap: 12px; }
.feature-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.feature-item .f-ic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-soft);
  border: 1px solid var(--border);
  color: var(--brand-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.feature-item .f-ic svg { width: 20px; height: 20px; fill: currentColor; }
.feature-item .f-body h3 { font-size: 15px; font-weight: 700; margin-bottom: 3px; color: var(--text); }
.feature-item .f-body p { font-size: 13px; color: var(--text-sub); line-height: 1.55; }

/* ---- Pricing ------------------------------------------------------------ */
.pricing-hero { text-align: center; padding: 10px 0; }
.pricing-hero h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}
.pricing-hero p { font-size: 14px; color: var(--text-sub); }

/* The plan card should read like a physical gold membership card. */
.plan-card {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(198, 161, 91, 0.12), transparent 70%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--brand);
  border-radius: var(--radius-lg);
  box-shadow: var(--glow-gold);
  padding: 30px 22px 26px;
  text-align: center;
  position: relative;
}
.plan-card .plan-tag {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-grad);
  color: var(--on-brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 16px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.plan-card .plan-name { font-size: 14px; font-weight: 600; color: var(--text-sub); letter-spacing: 0.02em; }
.plan-card .plan-price {
  font-family: var(--font-serif);
  font-size: 52px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brand-hi);
  letter-spacing: 0.01em;
  margin: 10px 0 2px;
}
.plan-card .plan-price .cur { font-size: 24px; font-weight: 600; margin-right: 3px; vertical-align: 6px; }
.plan-card .plan-period { font-size: 14px; color: var(--text-sub); margin-bottom: 22px; }
.plan-feats {
  list-style: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.plan-feats li {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  color: var(--text);
}
.plan-feats li svg { width: 18px; height: 18px; fill: var(--brand-hi); flex-shrink: 0; }

/* ---- Account ------------------------------------------------------------ */
.acct-hero {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.acct-hero .acct-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--brand-grad);
  color: var(--on-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(198, 161, 91, 0.35);
}
.acct-hero .acct-id { min-width: 0; }
.acct-hero .acct-name { font-size: 18px; font-weight: 700; color: var(--text); }
.acct-hero .acct-role { font-size: 13px; color: var(--brand-hi); margin-top: 3px; }

/* Membership status as a gold-edged card. */
.member-panel {
  border-radius: var(--radius-lg);
  padding: 22px;
  color: var(--text);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(198, 161, 91, 0.12), transparent 70%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--brand);
  box-shadow: var(--glow-gold);
}
.member-panel.inactive {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border-color: var(--border);
  box-shadow: var(--shadow-1);
}
.member-panel .mp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.member-panel .mp-label { font-size: 13px; color: var(--text-sub); }
.member-panel .mp-state {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand-hi);
  margin: 8px 0 2px;
}
.member-panel.inactive .mp-state { color: var(--text); }
.member-panel .mp-meta { font-size: 13px; color: var(--text-sub); }
.member-panel .mp-cta {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  background: var(--brand-grad);
  color: var(--on-brand);
  box-shadow: var(--glow-gold);
}
.member-panel .mp-cta.ghost {
  background: transparent;
  border-color: var(--brand);
  color: var(--brand-hi);
  box-shadow: none;
}
.member-panel .mp-cta:active { filter: brightness(0.94); }

/* ---- Orders ------------------------------------------------------------- */
.order-list { display: flex; flex-direction: column; gap: 10px; }
.order-item {
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--surface-2);
}
.order-item .oi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.order-item .oi-product { font-size: 15px; font-weight: 600; color: var(--text); }
.order-item .oi-meta {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.6;
}
.order-item .oi-meta .oi-no { font-family: var(--font-mono); word-break: break-all; }

/* Low-saturation outline badges. */
.badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  border: 1px solid transparent;
  background: transparent;
}
.badge.paid { border-color: var(--brand); color: var(--brand-hi); background: var(--brand-soft); }
.badge.pending { border-color: var(--divider); color: var(--text-sub); }
.badge.other { border-color: var(--divider); color: var(--text-sub); }

.s-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-sub);
  font-size: 14px;
}

/* ---- Recovery-code save step ------------------------------------------- */
.rc-code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  margin: 14px 0;
  word-break: break-all;
  color: var(--brand-hi);
  box-shadow: inset 0 0 0 1px var(--brand-soft);
}
.rc-warn {
  font-size: 13px;
  line-height: 1.6;
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 28%, transparent);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.rc-confirm {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  margin: 14px 0;
  cursor: pointer;
  user-select: none;
}
.rc-confirm input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---- Toast — dark glass, gold hairline ---------------------------------- */
.s-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-2);
}
.s-toast.show { opacity: 1; }

/* ---- Desktop refinement ------------------------------------------------- */
@media (min-width: 600px) {
  .landing-hero h1 { font-size: 36px; }
}
