/* Verge Premium Calculator — light only, same palette and mountain backdrop as entry's light theme. */
:root {
  color-scheme: light;
  --bg: #fafaf9; --text: #171714; --muted: #746e64; --faint: #918a7e;
  --gold: #a47728; --gold-soft: rgba(164, 119, 40, 0.1); --gold-line: rgba(164, 119, 40, 0.45);
  --line: rgba(39, 32, 22, 0.13); --line-strong: rgba(39, 32, 22, 0.26);
  --card: rgba(255, 255, 254, 0.86);
  --field: rgba(255, 255, 255, 0.9); --field-line: rgba(39, 32, 22, 0.16); --field-line-hover: rgba(39, 32, 22, 0.3);
  --seg: rgba(39, 32, 22, 0.05);
  --btn: #171714; --btn-hover: #34302a; --btn-text: #fff;
  --danger: #b4412f; --danger-soft: #fbece9; --ok: #2b8a6e; --ok-soft: #e8f5f0;
  --shadow: 0 24px 60px rgba(60, 45, 20, 0.1);
  --radius: 14px;
  --font: "Helvetica Neue", Helvetica, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.5; }
.backdrop { position: fixed; inset: 0; z-index: -1; background: url("/img/bg-mountain-light.webp?v=20261108-2") center bottom / cover no-repeat, var(--bg); }
.shell { max-width: 880px; margin: 0 auto; padding: 28px 24px 48px; }
button, input, select { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }

/* Top bar: the logo (7 taps shows the staff code under it). */
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; min-height: 40px; }
.brand { display: flex; flex-direction: column; gap: 6px; }
.logo-btn { padding: 0; border: 0; background: none; cursor: default; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.logo { display: block; height: 26px; width: auto; }
.secret { font-size: 12px; letter-spacing: 1.5px; color: var(--faint); font-variant-numeric: tabular-nums; min-height: 18px; }
.secret[hidden] { display: block !important; visibility: hidden; }

.hero { margin: 28px 0 20px; }
.eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--gold); }
h1 { margin: 0; font-size: 34px; font-weight: 600; letter-spacing: -0.5px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.panel-body { padding: 24px; }

/* Inputs */
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 10px; background: var(--seg); border: 1px solid var(--line); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 8px 18px; border-radius: 8px; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg input:checked + span { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.seg input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 1px; }
.products { display: flex; margin-bottom: 20px; }
.products .seg { width: 100%; }
.products .seg label { flex: 1; text-align: center; }
.products .seg span { font-size: 15px; letter-spacing: 1px; }

.grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13px; font-weight: 600; }
.label small { font-weight: 400; color: var(--muted); }
.input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--field-line); border-radius: 10px; background: var(--field); font-size: 17px; }
.input:hover { border-color: var(--field-line-hover); }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.field .seg { height: 46px; align-items: stretch; }
.field .seg label { flex: 1; display: flex; }
.field .seg span { flex: 1; display: grid; place-items: center; padding: 0 10px; }
.hint { font-size: 12px; color: var(--muted); min-height: 18px; }
.field.bad .input { border-color: var(--danger); }
.field.bad .hint { color: var(--danger); }

/* Results: one card per payment term */
.results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.term { border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.7); padding: 16px 16px 14px; }
.term h3 { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--gold); letter-spacing: 1px; }
.term h3 b { font-size: 22px; color: var(--text); letter-spacing: 0; margin-right: 4px; }
.stat { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.stat span { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.stat b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat.main b { font-size: 20px; }
.empty .stat b { color: var(--faint); }

/* PDF */
.export { display: flex; gap: 12px; align-items: flex-end; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.export .field { flex: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border: 0; border-radius: 10px;
  background: var(--btn); color: var(--btn-text); font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--btn-hover); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }
.note { margin: 14px 0 0; font-size: 12px; color: var(--faint); }
.footer { margin-top: 28px; font-size: 12px; color: var(--faint); letter-spacing: 1px; }

@media (max-width: 720px) {
  .shell { padding: 20px 16px 32px; }
  .logo { height: 21px; }
  .hero { margin: 22px 0 16px; }
  h1 { font-size: 28px; }
  .panel-body { padding: 18px 16px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .grid .sex { grid-column: span 2; order: -1; }
  .results { grid-template-columns: 1fr; gap: 10px; }
  .term { padding: 12px 14px 10px; }
  .export { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
}
