/* ═══════════ JUBDEE จับดี — Design System ═══════════ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700;800&display=swap');

:root {
  --action: #8E44AD;
  --influence: #E67E22;
  --connection: #2980B9;
  --thinking: #27AE60;
  --ink: #1d2733;
  --ink-soft: #5a6b7d;
  --bg: #f6f8fb;
  --card: #ffffff;
  --line: #e4eaf1;
  --brand: #6C3FC9;
  --brand2: #F5A623;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(29, 39, 51, .08);
}

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

body {
  font-family: 'Noto Sans Thai', 'Sukhumvit Set', 'Thonburi', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 24px 20px 64px; }
a { color: var(--brand); }

/* ── Header ── */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; margin-bottom: 8px;
}
.logo { font-weight: 800; font-size: 1.35rem; text-decoration: none; color: var(--ink); }
.logo span { background: linear-gradient(135deg, var(--brand), var(--brand2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.topbar a.small { font-size: .85rem; color: var(--ink-soft); text-decoration: none; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #6C3FC9 0%, #9B59B6 45%, #F5A623 120%);
  color: #fff; border-radius: 24px; padding: 48px 36px; text-align: center;
  box-shadow: var(--shadow); margin-bottom: 28px;
}
.hero h1 { font-size: 2.4rem; font-weight: 800; margin-bottom: 10px; }
.hero p { font-size: 1.1rem; opacity: .95; max-width: 560px; margin: 0 auto 24px; }
.btn {
  display: inline-block; background: #fff; color: var(--brand); font-weight: 700;
  padding: 14px 36px; border-radius: 999px; text-decoration: none; font-size: 1.05rem;
  border: none; cursor: pointer; font-family: inherit; transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.22); }
.btn.solid { background: var(--brand); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink-soft); box-shadow: none; border: 1.5px solid var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ── Cards / grid ── */
.card { background: var(--card); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); margin-bottom: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } .hero h1 { font-size: 1.8rem; } }

.domain-chip { display: inline-block; padding: 3px 12px; border-radius: 999px; color: #fff; font-size: .78rem; font-weight: 600; }

.section-title { font-size: 1.35rem; font-weight: 800; margin: 34px 0 14px; }
.muted { color: var(--ink-soft); font-size: .92rem; }

/* ── Assessment ── */
.progress-track { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 12px 0 4px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand2)); border-radius: 999px; transition: width .3s; }

.q-item { padding: 20px 0; border-bottom: 1px solid var(--line); }
.q-item:last-child { border-bottom: none; }
.q-text { font-weight: 600; font-size: 1.06rem; margin-bottom: 12px; }

/* ── มาตรวัด 1-5 แบบแถวเดียว (เหมาะกับมือถือ) ── */
.scale-ends { display: flex; justify-content: space-between; font-size: .78rem; color: var(--ink-soft); margin-bottom: 8px; }
.scale-opts { display: flex; justify-content: space-between; gap: 6px; }
.opt { flex: 1; text-align: center; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; padding: 4px 0; }
.opt input { display: none; }
.opt .dot {
  display: flex; align-items: center; justify-content: center;
  width: 100%; max-width: 60px; aspect-ratio: 1; margin: 0 auto;
  border-radius: 50%; border: 2px solid #cfd8e3; background: #fff;
  color: var(--ink-soft); font-weight: 700; font-size: 1.05rem; transition: all .12s;
}
.opt .optlabel { display: block; font-size: .72rem; color: var(--ink-soft); margin-top: 5px; line-height: 1.3; }
.opt:has(input:checked) .dot, .opt.on .dot {
  background: var(--brand); border-color: var(--brand); color: #fff;
  transform: scale(1.14); box-shadow: 0 3px 10px rgba(108, 63, 201, .35);
}
.opt:has(input:checked) .optlabel, .opt.on .optlabel { color: var(--brand); font-weight: 700; }
.scale-picked { text-align: center; font-size: .85rem; font-weight: 600; color: var(--brand); min-height: 1.5em; margin-top: 8px; }
@media (max-width: 640px) {
  .opt .optlabel { display: none; }
  .opt .dot { max-width: 54px; }
  .q-text { font-size: 1rem; }
}
.nav-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }

input[type=text], input[type=password], select, textarea {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: 1rem; background: #fff; color: var(--ink);
}
.field { margin-bottom: 16px; }
.field label.fl { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }

/* ── Report ── */
.report-head { text-align: center; padding: 34px 20px; border-radius: 24px; color: #fff; margin-bottom: 24px;
  background: linear-gradient(135deg, #2c1a52, #6C3FC9 70%, #9B59B6); }
.report-head h1 { font-size: 1.9rem; font-weight: 800; }
.report-head .who { font-size: 1.15rem; margin-top: 6px; opacity: .95; }

.dna { display: flex; gap: 4px; margin: 18px 0 6px; }
.dna div { flex: 1; height: 42px; border-radius: 4px; }
.dna div.dim { opacity: .22; }

.rank-list { counter-reset: rk; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; }
.rank-row:nth-child(odd) { background: #fafbfd; }
.rank-num { font-weight: 800; width: 30px; text-align: right; color: var(--ink-soft); font-size: .95rem; }
.rank-bar-track { flex: 1; height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.rank-bar { height: 100%; border-radius: 999px; }
.rank-name { width: 240px; font-weight: 600; font-size: .95rem; }
.rank-name small { color: var(--ink-soft); font-weight: 400; }
@media (max-width: 640px) { .rank-name { width: 150px; } .rank-name small { display: none; } }

.top-card { border-left: 6px solid; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); padding: 26px; margin-bottom: 22px; }
.top-card h3 { font-size: 1.4rem; font-weight: 800; }
.top-card .tag { font-style: italic; color: var(--ink-soft); margin: 4px 0 14px; }
.top-card h4 { font-size: .95rem; font-weight: 700; margin: 16px 0 6px; letter-spacing: .02em; }
.top-card ul { padding-left: 22px; }
.top-card li { margin-bottom: 5px; }
.qbox { background: #f4f0fc; border-radius: 12px; padding: 14px 18px; margin-top: 14px; }
.qbox li { margin-bottom: 4px; }

.dom-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dom-bar-name { width: 140px; font-weight: 700; font-size: .92rem; }
.dom-bar-track { flex: 1; height: 20px; background: var(--line); border-radius: 999px; overflow: hidden; }
.dom-bar-fill { height: 100%; border-radius: 999px; color: #fff; font-size: .78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; min-width: 36px; }

/* ── Coach table ── */
table.list { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.list th, table.list td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
table.list th { color: var(--ink-soft); font-weight: 600; font-size: .82rem; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; color: #fff; margin: 1px 2px; }

footer.note { text-align: center; color: var(--ink-soft); font-size: .82rem; margin-top: 40px; }

/* ── Print ── */
@media print {
  body { background: #fff; }
  .wrap { max-width: 100%; padding: 0; }
  .no-print { display: none !important; }
  .card, .top-card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .report-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .dna div, .rank-bar, .dom-bar-fill, .domain-chip, .pill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
