:root {
  /* === Editorial / Trust palette: ivory + deep blue + gold === */
  --paper: #f4efe4;
  --paper-deep: #ece4d4;
  --card: #fffdf8;
  --ink: #16243b;        /* primary deep-navy ink */
  --ink-2: #38465a;
  --ink-soft: #6c7686;   /* muted labels */
  --line: rgba(22, 36, 59, 0.12);
  --line-strong: rgba(22, 36, 59, 0.22);

  --navy: #1c3a5e;       /* primary action */
  --navy-deep: #142c48;
  --gold: #b1873f;       /* single accent — used sparingly */
  --gold-tint: rgba(177, 135, 63, 0.12);

  /* Muted, print-like status colors */
  --success: #3f7d54;
  --error: #a8432f;
  --warning: #9a6b1e;
  --info: #2e5a86;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 18px 40px -24px rgba(22, 36, 59, 0.45);
  --shadow-sm: 0 6px 16px -10px rgba(22, 36, 59, 0.4);
  --transition: all 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);

  --serif: 'Noto Serif SC', Georgia, 'Songti SC', serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Microsoft YaHei', sans-serif;
  background-color: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Subtle paper grain — print texture, very low presence */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(22, 36, 59, 0.05) 0.5px, transparent 0.5px);
  background-size: 5px 5px;
  opacity: 0.5;
}

/* Container */
.container {
  width: 100%;
  max-width: 460px;
  padding: 3rem 1.5rem 2rem;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* === Header / wordmark === */
.header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

/* Monogram seal — replaces the generic ⚡ */
.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--navy);
  box-shadow: inset 0 0 0 3px var(--card), inset 0 0 0 4px var(--gold-tint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
  font-style: normal;
  flex: none;
}

.header h1 {
  font-family: var(--serif);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
}

/* Thin gold rule under the wordmark */
.subtitle {
  position: relative;
  display: inline-block;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  padding-left: 0.32em; /* optical compensation for tracking */
}

.subtitle::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 1.5px;
  background: var(--gold);
}

/* === Stepper === */
.stepper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding: 0 0.25rem;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  position: relative;
  z-index: 1;
  opacity: 1;
  transition: var(--transition);
}

.step-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--line-strong);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  transition: var(--transition);
}

.step.active .step-dot {
  border-color: var(--navy);
  color: var(--navy);
  box-shadow: 0 0 0 4px var(--gold-tint);
}

.step.completed .step-dot {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--card);
}

.step-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

.step.active .step-label { color: var(--ink); }

.step-line {
  flex: 1;
  height: 1.5px;
  background: var(--line);
  margin: 15px 8px 0;
}

/* === Cards === */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.step-panel {
  display: none;
  opacity: 0;
  transform: translateY(8px);
}

.step-panel.active {
  display: block;
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; transform: translateY(0); }
}

.card-header {
  padding: 1.5rem 1.5rem 1.15rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}

/* Gold tick at the card-header start — quiet editorial detail */
.card-header::before {
  content: '';
  position: absolute;
  top: 1.65rem;
  left: 0;
  width: 3px;
  height: 1.15rem;
  background: var(--gold);
  border-radius: 0 2px 2px 0;
}

.card-header h2 {
  font-family: var(--serif);
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
  font-weight: 600;
  color: var(--ink);
}

.card-header p {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.card-body { padding: 1.5rem; }

/* === Forms === */
.input-group { margin-bottom: 1.5rem; }

.input-group label {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

input[type="text"],
textarea {
  width: 100%;
  background: #fffefb;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  outline: none;
}

input::placeholder, textarea::placeholder { color: #aab1bd; }

.input-hint {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.input-hint a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 1px;
  word-break: break-all;
}

.input-hint a:hover { color: var(--gold); }

input[type="text"]:focus,
textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--gold-tint);
  background: #fff;
}

/* === Buttons === */
.btn {
  width: 100%;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--navy);
  color: #fdfbf5;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--navy-deep);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--paper-deep);
  color: var(--ink);
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-row { display: flex; gap: 1rem; }
.btn-row .btn-ghost { flex: 1; }
.btn-row .btn-primary { flex: 2; }

/* Loader */
.btn-loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(253, 251, 245, 0.35);
  border-radius: 50%;
  border-top-color: #fdfbf5;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* === Result area & info rows === */
.result-area {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.info-card, .subscription-card {
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.info-row:last-child { border-bottom: none; }

.info-label {
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.info-value { font-weight: 600; font-size: 0.95rem; color: var(--ink); }

.mono {
  font-family: 'Inter', monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

/* === Badges — muted print chips === */
.badge {
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
}

.badge.type-pro    { background: var(--gold-tint); color: #8a6526; border-color: rgba(177, 135, 63, 0.4); }
.badge.status-ok   { background: rgba(63, 125, 84, 0.12); color: #2f6340; border-color: rgba(63, 125, 84, 0.4); }
.badge.status-warn { background: rgba(154, 107, 30, 0.12); color: #7d560f; border-color: rgba(154, 107, 30, 0.4); }
.badge.status-err  { background: rgba(168, 67, 47, 0.12); color: #8c351f; border-color: rgba(168, 67, 47, 0.4); }
.badge.status-info { background: rgba(46, 90, 134, 0.12); color: #244a6f; border-color: rgba(46, 90, 134, 0.4); }

/* === Summary bar === */
.summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
}

.summary-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.summary-value { font-weight: 600; font-size: 0.95rem; color: var(--ink); }

/* === Order status === */
.order-status-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 0 1.5rem;
}

.pulse-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 1.5rem;
}

.pulse-ring::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--navy);
  opacity: 0.18;
  animation: pulse 2s ease-out infinite;
}

.pulse-core {
  width: 58px;
  height: 58px;
  background: var(--navy);
  color: #fdfbf5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  z-index: 1;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(1.7); opacity: 0; }
}

.pulse-ring.success .pulse-core { background: var(--success); }
.pulse-ring.success::before { background: var(--success); }
.pulse-ring.error .pulse-core { background: var(--error); }
.pulse-ring.error::before { background: var(--error); animation: none; }

.status-text {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.status-detail {
  color: var(--ink-soft);
  font-size: 0.85rem;
  text-align: center;
}

.order-info {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  margin-bottom: 1.5rem;
}

/* === Subscription result === */
.sub-plan {
  text-align: center;
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1.5rem;
  letter-spacing: 0.01em;
}

/* === Toast === */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--ink);
  color: #fdfbf5;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 14px 30px -12px rgba(22, 36, 59, 0.55);
  border-left: 3px solid var(--error);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* === Footer === */
.footer {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
}
