/* Dark mode */
[data-theme="dark"]{--primary:#4a7fbf;--accent:#d4a017;--accent2:#e8572a;--bg:#0a0e18;--bg2:#0f1629;--card:#0f1629;--text:#f0f4ff;--sub:rgba(255,255,255,.6);--border:rgba(255,255,255,.1);--success:#4caf7d;--warn:#e8572a}
/* Light mode */
:root{--primary:#1a3a5c;--accent:#d4a017;--accent2:#e8572a;--bg:#f5f3ee;--bg2:#f0ece4;--card:#ffffff;--text:#1c1c1c;--sub:#666;--border:#e0ddd6;--success:#2a7d4f;--warn:#c94b1b}

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

:root {
  --primary: #1a3a5c;
  --accent: #d4a017;
  --accent2: #e8572a;
  --bg: #f5f3ee;
  --card: #ffffff;
  --text: #1c1c1c;
  --sub: #666;
  --border: #e0ddd6;
  --success: #2a7d4f;
  --warn: #c94b1b;
  --tag-green: #e8f5ed;
  --tag-green-txt: #2a7d4f;
  --tag-red: #fdecea;
  --tag-red-txt: #c0392b;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
  background: var(--primary);
  color: white;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-logo { font-size: 16px; font-weight: 700; letter-spacing: 0.5px; }
.header-badge {
  background: var(--accent);
  color: #1a1a1a;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

/* ===== PROGRESS ===== */
.progress-bar {
  background: var(--primary);
  padding: 0 24px 14px;
}
.progress-track {
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  height: 4px;
  overflow: hidden;
}
.progress-fill {
  background: var(--accent);
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}
.progress-labels span {
  font-size: 10px;
  color: rgba(255,255,255,0.6);
}
#progress-step-label { color: rgba(255,255,255,0.9); font-weight: 600; }

/* ===== MODULE STEPS ===== */
.ms { display: none; }
.ms.active { display: block; }

.step-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 100px;
}

/* ===== CARDS ===== */
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.step-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
.step-sub {
  font-size: 14px;
  color: var(--sub);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ===== FORM ELEMENTS ===== */
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  display: block;
}
.field-hint {
  font-size: 12px;
  color: var(--sub);
  margin-bottom: 8px;
}

/* Input + Select */
.inp, .sel-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 15px;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.inp:focus, .sel-input:focus { border-color: var(--primary); }

.field-row { margin-bottom: 20px; }

/* Slider */
.slider-wrap { position: relative; padding-top: 4px; }
input[type=range] {
  width: 100%;
  -webkit-appearance: none;
  height: 5px;
  border-radius: 5px;
  background: var(--border);
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.slider-val {
  text-align: right;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 6px;
}

/* Option buttons */
.opt-group { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.opt {
  padding: 9px 18px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.opt:hover { border-color: var(--primary); }
.opt.sel {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  font-weight: 600;
}
.opt.sel-accent {
  background: var(--accent);
  color: #1a1a1a;
  border-color: var(--accent);
  font-weight: 600;
}

/* Number input with prefix */
.inp-prefix-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: white;
  transition: border-color 0.2s;
}
.inp-prefix-wrap:focus-within { border-color: var(--primary); }
.inp-prefix {
  padding: 11px 12px;
  background: #f5f3ee;
  color: var(--sub);
  font-size: 14px;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}
.inp-prefix-wrap .inp {
  border: none;
  border-radius: 0;
  flex: 1;
}
.inp-prefix-wrap .inp:focus { border: none; }

/* Checkbox toggle row */
.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.check-row:last-child { border-bottom: none; }
.check-row label { flex: 1; font-size: 14px; cursor: pointer; }
.check-box {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.check-box.checked {
  background: var(--primary);
  border-color: var(--primary);
}
.check-box.checked::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: 700;
}

/* Section divider inside card */
.sect-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* Info box */
.info-box {
  background: #eaf2fb;
  border-left: 4px solid #2980b9;
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  font-size: 13px;
  color: #1a5276;
  line-height: 1.6;
  margin-bottom: 16px;
}
.warn-box {
  background: #fdecea;
  border-left: 4px solid var(--warn);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  font-size: 13px;
  color: #7b241c;
  line-height: 1.6;
  margin-bottom: 16px;
}

/* ===== NAVIGATION BUTTONS ===== */
.nav-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: white;
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
}
.btn-back {
  flex: 0 0 80px;
  padding: 13px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: white;
  color: var(--sub);
  cursor: pointer;
  font-weight: 600;
}
.btn-next {
  flex: 1;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.2s;
}
.btn-next:hover { background: #0f2d4a; }
.btn-next.accent {
  background: linear-gradient(135deg, #d4a017 0%, #e8572a 100%);
  color: white;
}

/* ===== COVER ===== */
.cover-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #2563a8 100%);
  color: white;
  padding: 40px 24px 32px;
  text-align: center;
}
.cover-icon { font-size: 52px; margin-bottom: 12px; }
.cover-title { font-size: 24px; font-weight: 800; margin-bottom: 8px; line-height: 1.3; }
.cover-subtitle { font-size: 14px; opacity: 0.85; line-height: 1.6; max-width: 320px; margin: 0 auto; }

.feature-list { list-style: none; margin: 0; }
.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.5;
}
.feature-list li:last-child { border-bottom: none; }
.feature-list .fi { font-size: 20px; flex-shrink: 0; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-box {
  background: #f5f3ee;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.stat-num { font-size: 22px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 11px; color: var(--sub); margin-top: 2px; }

/* ===== REPORT ===== */
.report-header {
  background: linear-gradient(135deg, var(--primary) 0%, #2563a8 100%);
  color: white;
  padding: 28px 24px;
  text-align: center;
}
.report-title { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.report-sub { font-size: 12px; opacity: 0.8; }

.risk-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  margin: 12px 0 4px;
}

.report-section { margin-bottom: 16px; }
.report-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tax-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.tax-row:last-child { border-bottom: none; }
.tax-row .label { color: var(--sub); }
.tax-row .val { font-weight: 700; color: var(--text); }
.tax-row .val.red { color: var(--warn); }
.tax-row .val.green { color: var(--success); }

.saving-item {
  background: #f0f9f4;
  border: 1px solid #b7dfc8;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
}
.saving-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.saving-name { font-size: 14px; font-weight: 700; color: var(--success); }
.saving-amount {
  font-size: 16px;
  font-weight: 800;
  color: var(--warn);
}
.saving-desc { font-size: 12px; color: #4a7a5c; line-height: 1.5; }

/* Locked content */
.locked-section {
  position: relative;
  margin-top: 20px;
}
.locked-overlay {
  background: linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.95) 30%, white 60%);
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 20px;
}
.lock-card {
  background: white;
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 22px;
  text-align: center;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}
.lock-icon { font-size: 36px; margin-bottom: 8px; }
.lock-title { font-size: 17px; font-weight: 800; color: var(--primary); margin-bottom: 6px; }
.lock-desc { font-size: 13px; color: var(--sub); margin-bottom: 16px; line-height: 1.5; }
.lock-list { text-align: left; margin-bottom: 16px; }
.lock-list li {
  font-size: 13px;
  padding: 4px 0;
  display: flex;
  gap: 8px;
}
.lock-list .tick { color: var(--success); font-weight: 700; }

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  justify-content: center;
  margin-bottom: 14px;
}
.price-main { font-size: 32px; font-weight: 900; color: var(--warn); }
.price-orig { font-size: 14px; color: var(--sub); text-decoration: line-through; }
.price-label { font-size: 12px; color: var(--sub); }

.btn-pay {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #d4a017 0%, #e8572a 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.5px;
}
.trust-badges {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
}
.trust-badge { font-size: 11px; color: var(--sub); display: flex; gap: 4px; align-items: center; }

.blurred { filter: blur(5px); user-select: none; pointer-events: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .step-wrap { padding: 20px 16px 100px; }
  .card { padding: 18px; }
  .cover-hero { padding: 32px 20px 24px; }
  .cover-title { font-size: 20px; }
}
