/* ===========================================================
   MBTI Type Test — styles
   Palette matches the rest of the test-library network
   (indigo #6366f1 on a near-white canvas)
   =========================================================== */

:root {
  --ink: #111827;
  --ink-2: #4b5563;
  --ink-3: #6b7280;
  --ink-4: #9ca3af;
  --line: #e5e7eb;
  --line-2: #eef2ff;
  --bg: #f9fafb;
  --surface: #ffffff;
  --brand: #6366f1;
  --brand-2: #818cf8;
  --brand-soft: #eef2ff;
  --brand-soft-2: #e0e7ff;
  --brand-ink: #4338ca;

  --analyst: #7c5cbf;
  --diplomat: #2f9e6f;
  --sentinel: #3b8fae;
  --explorer: #d09a1f;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 8px 24px -12px rgba(17, 24, 39, .10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial,
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }

p { margin: 0; }

.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------- top bar ---------------- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-in {
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  font-size: 15px;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 700;
}
.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13.5px;
}
.nav a { color: var(--ink-3); }
.nav a:hover { color: var(--ink); text-decoration: none; }

/* ---------------- generic card ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pad { padding: 28px; }

/* ---------------- hero ---------------- */
.hero { text-align: center; padding-top: 44px; padding-bottom: 8px; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--brand-ink);
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-2);
  padding: 6px 13px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 720;
  letter-spacing: -.03em;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}
.hero .lede {
  font-size: 16.5px;
  color: var(--ink-3);
  max-width: 560px;
  margin: 0 auto;
}
.hero-meta {
  display: flex;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
  margin-top: 26px;
  font-size: 13px;
  color: var(--ink-3);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand-2);
  display: inline-block;
}

/* ---------------- section ---------------- */
.section { padding-top: 40px; }
.section-head { margin-bottom: 20px; }
.section-head .eyebrow {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 8px;
}
.section-head h2 {
  font-size: clamp(20px, 3.6vw, 25px);
  font-weight: 700;
  margin-bottom: 8px;
}
.section-head p { color: var(--ink-3); font-size: 14.5px; }

/* ---------------- version picker ---------------- */
.versions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.version {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
  transition: border-color .16s, transform .16s, box-shadow .16s;
  min-width: 0;
}
.version:hover {
  border-color: var(--brand-2);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(17,24,39,.05), 0 16px 32px -16px rgba(99,102,241,.35);
}
.version.featured { border-color: var(--brand-2); }
.version-tag {
  position: absolute;
  top: -9px; left: 16px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #fff;
  background: var(--brand);
  padding: 2px 8px;
  border-radius: 999px;
}
.version-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  display: grid; place-items: center;
  font-size: 16px;
}
.version h3 { font-size: 16px; font-weight: 680; }
.version .v-sub { font-size: 13px; color: var(--ink-3); min-height: 38px; }
.version .v-meta {
  font-size: 12.5px;
  color: var(--ink-3);
  display: flex; flex-direction: column; gap: 3px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: auto;
}
.version .v-meta b { color: var(--ink); font-weight: 640; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 620;
  padding: 13px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s, box-shadow .15s;
  text-align: center;
  min-width: 0;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(17,24,39,.08), 0 8px 18px -10px rgba(99,102,241,.7);
}
.btn-primary:hover { background: #5457e5; }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink-4); }
.btn-block { width: 100%; }
.btn-sm { font-size: 13.5px; padding: 9px 15px; }

/* ---------------- dimension explainer ---------------- */
.dims { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.dim {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  min-width: 0;
}
.dim .dim-code {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--brand-ink);
  margin-bottom: 6px;
}
.dim h4 { font-size: 14.5px; margin-bottom: 6px; }
.dim p { font-size: 13.2px; color: var(--ink-3); }

/* ---------------- 16 types grid ---------------- */
.groups { display: flex; flex-direction: column; gap: 22px; }
.group-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 10px;
}
.group-head h3 { font-size: 14.5px; font-weight: 680; }
.group-head span { font-size: 12.5px; color: var(--ink-4); }
.type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}
.type-chip {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand-2);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  transition: transform .14s, box-shadow .14s;
  min-width: 0;
}
.type-chip:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px -12px rgba(17,24,39,.3);
}
.type-chip .tc-code { font-size: 13px; font-weight: 720; letter-spacing: .02em; }
.type-chip .tc-name { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.type-chip.analyst { border-left-color: var(--analyst); }
.type-chip.analyst .tc-code { color: var(--analyst); }
.type-chip.diplomat { border-left-color: var(--diplomat); }
.type-chip.diplomat .tc-code { color: var(--diplomat); }
.type-chip.sentinel { border-left-color: var(--sentinel); }
.type-chip.sentinel .tc-code { color: var(--sentinel); }
.type-chip.explorer { border-left-color: var(--explorer); }
.type-chip.explorer .tc-code { color: var(--explorer); }

/* ---------------- notice ---------------- */
.notice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 13.5px;
  color: #78350f;
  margin-top: 8px;
}
.notice b { display: block; margin-bottom: 6px; font-size: 13.5px; }
.notice ul { margin: 0; padding-left: 18px; }
.notice li { margin: 3px 0; }

/* ---------------- faq ---------------- */
.faq { display: flex; flex-direction: column; gap: 8px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 16px;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 0;
  font-size: 14.5px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  color: var(--ink-4);
  font-weight: 400;
  font-size: 18px;
  line-height: 1;
}
.faq details[open] summary::after { content: '–'; }
.faq .faq-body {
  font-size: 13.8px;
  color: var(--ink-3);
  padding: 0 0 15px;
}

/* ---------------- pricing ---------------- */
.pricing { text-align: center; }
.price-card {
  max-width: 420px;
  margin: 22px auto 0;
  padding: 30px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.price-tag {
  font-size: 40px;
  font-weight: 750;
  letter-spacing: -.04em;
  line-height: 1;
}
.price-tag span { font-size: 14px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.price-list {
  list-style: none;
  margin: 20px 0;
  padding: 0;
  text-align: left;
  font-size: 13.8px;
  color: var(--ink-2);
}
.price-list li {
  display: flex; gap: 9px;
  padding: 5px 0;
}
.price-list li::before {
  content: '✓';
  color: var(--brand);
  font-weight: 700;
  flex: none;
}
.price-note { font-size: 12px; color: var(--ink-4); margin-top: 12px; }

/* ---------------- footer ---------------- */
.footer {
  margin-top: 56px;
  padding-top: 26px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-4);
}
.footer .f-links {
  display: flex; justify-content: center;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.footer a { color: var(--ink-3); }

/* ===========================================================
   QUIZ
   =========================================================== */
.quiz-shell { padding-top: 26px; padding-bottom: 60px; }

.progress-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.progress-track {
  flex: 1;
  height: 6px;
  background: var(--line-2);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%);
  border-radius: 999px;
  transition: width .28s ease;
}

.q-card { margin-top: 18px; padding: 30px 28px; }
.q-index {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--brand-ink);
  margin-bottom: 12px;
}
.q-text {
  font-size: clamp(19px, 3.4vw, 23px);
  font-weight: 660;
  line-height: 1.4;
  letter-spacing: -.02em;
  margin-bottom: 22px;
  overflow-wrap: anywhere;
}
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 15.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color .14s, background .14s, transform .1s;
}
.opt:hover { border-color: var(--brand-2); background: #fcfcff; }
.opt:active { transform: scale(.995); }
.opt .key {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 12.5px;
  font-weight: 700;
  display: grid; place-items: center;
}
.opt.chosen {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.opt.chosen .key { background: var(--brand); color: #fff; }

.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}
.quiz-nav .hint { font-size: 12.5px; color: var(--ink-4); }
.link-btn {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
}
.link-btn:hover { color: var(--ink); }
.link-btn:disabled { opacity: .4; cursor: default; }

/* keyboard hint */
.kbd-hint {
  text-align: center;
  font-size: 12px;
  color: var(--ink-4);
  margin-top: 16px;
}
.kbd-hint kbd {
  font-family: inherit;
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  margin: 0 2px;
}

/* ===========================================================
   RESULT
   =========================================================== */
.result-hero {
  text-align: center;
  padding: 34px 24px 30px;
}
.result-eyebrow {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 10px;
}
.result-code {
  font-size: clamp(44px, 11vw, 64px);
  font-weight: 780;
  letter-spacing: -.04em;
  line-height: 1;
  margin-bottom: 8px;
}
.result-name { font-size: 20px; font-weight: 650; margin-bottom: 4px; }
.result-nick { font-size: 14px; color: var(--ink-3); }
.result-badge {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  font-weight: 620;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.bars { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }
.bar-head {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 13px; margin-bottom: 6px;
}
.bar-head .bh-l { font-weight: 640; }
.bar-head .bh-r { color: var(--ink-4); font-size: 12.5px; }
.bar-track {
  position: relative;
  height: 9px;
  background: var(--line-2);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%);
  transition: width .5s ease;
}
.bar-scale {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--ink-4);
  margin-top: 4px;
}

.report-block { margin-top: 26px; }
.report-block h3 {
  font-size: 15px;
  font-weight: 680;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.report-block h3::before {
  content: '';
  width: 3px; height: 15px;
  border-radius: 2px;
  background: var(--brand);
  display: inline-block;
}
.report-block p { font-size: 14.5px; color: var(--ink-2); }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.tag {
  font-size: 12.8px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.tag.good { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.tag.warn { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

.result-actions {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 26px;
}
.result-actions .btn { width: 100%; }
@media (min-width: 640px) {
  .result-actions { flex-direction: row; flex-wrap: wrap; }
  .result-actions .btn { flex: 1 1 auto; width: auto; }
}

.share-note {
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--ink-4);
  text-align: center;
}

/* locked / paywall */
.locked {
  position: relative;
  overflow: hidden;
}
.locked-inner { filter: blur(5px); user-select: none; pointer-events: none; }
.lock-cta {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,.1) 0%, rgba(255,255,255,.92) 45%, #fff 100%);
  text-align: center;
  padding: 20px;
}
.lock-cta .lc-box { max-width: 320px; }
.lock-cta .lc-title { font-size: 15px; font-weight: 660; margin-bottom: 6px; }
.lock-cta .lc-sub { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }

/* ===========================================================
   responsive
   =========================================================== */
@media (max-width: 480px) {
  .nav a[href="#types"], .nav a[href="#faq"], .nav a[href="#pricing"] { display: none; }
  .nav { gap: 12px; }
}

@media (max-width: 700px) {
  .versions { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dims { grid-template-columns: 1fr; }
  .pad { padding: 22px 18px; }
  .q-card { padding: 24px 20px; }
  .hero { padding-top: 32px; padding-bottom: 4px; }
  .hero-meta { gap: 16px; }
  .nav { gap: 13px; }
}

@media (max-width: 380px) {
  .type-grid { grid-template-columns: 1fr; }
}

/* print — let people save the report as PDF */
@media print {
  .topbar, .quiz-nav, .result-actions, .footer, .share-note { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ddd; }
}

/* dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f3f4f6;
    --ink-2: #d1d5db;
    --ink-3: #9ca3af;
    --ink-4: #6b7280;
    --line: #2b2f3a;
    --line-2: #242835;
    --bg: #14161c;
    --surface: #1b1e26;
    --brand-soft: #23253a;
    --brand-soft-2: #2d3050;
    --brand-ink: #a5b4fc;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  }
  .topbar { background: rgba(27,30,38,.86); }
  .notice { background: #2a2312; border-color: #4a3c14; color: #fcd34d; }
  .notice b { color: #fcd34d; }
  .tag.good { background: #10261d; border-color: #1c4a37; color: #6ee7b7; }
  .tag.warn { background: #2a1517; border-color: #5b2327; color: #fca5a5; }
  .opt:hover { background: #20242e; }
  .lock-cta {
    background: linear-gradient(180deg, rgba(27,30,38,.1) 0%, rgba(27,30,38,.92) 45%, #1b1e26 100%);
  }
}
