/* Career Development Profiler - AJCE */
:root {
  --navy: #0a2a66; --blue: #1546b8; --blue-2: #eaf0fc; --blue-3: #d6e1f8;
  --red: #c8102e; --gold: #f4b400; --ink: #18213a; --muted: #5f6b85;
  --line: #e2e8f3; --bg: #f3f6fb; --card: #fff; --ok: #12805c; --okbg: #e3f6ee; --warn: #b54708; --warnbg: #fff1e0;
  --r: 16px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 72, .06), 0 8px 24px rgba(16, 32, 72, .06);
  --shadow-lg: 0 12px 40px rgba(16, 32, 72, .14);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 16px/1.55 var(--font); color: var(--ink);
  background: radial-gradient(1200px 500px at 85% -10%, #dfe8fb 0%, transparent 60%), var(--bg);
  min-height: 100vh;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
h2, h3 { margin-top: 0; color: var(--navy); }
a { color: var(--blue); }
.muted, .hint { color: var(--muted); }
.hint { font-size: .88rem; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  color: var(--ink); border-bottom: 1px solid var(--line);
}
.top::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--navy), var(--blue) 60%, var(--gold)); }
.top-in { display: flex; justify-content: space-between; align-items: center; gap: 12px; height: 58px; }
.brandbox { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.logo {
  flex: none; height: 34px; padding: 0 10px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  background: var(--navy); color: #fff; font-weight: 800; font-size: .9rem; letter-spacing: .3px;
}
.logo i { font-style: normal; color: var(--gold); }
.brand { display: block; font-weight: 700; font-size: .86rem; color: var(--navy); white-space: nowrap; line-height: 1.2; }
.brand .short { display: none; }
.sub { display: block; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.userbox { display: flex; align-items: center; gap: 8px; }
.userchip {
  display: flex; align-items: center; gap: 8px; max-width: 240px; padding: 3px 12px 3px 3px;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; font: inherit; font-weight: 600; font-size: .84rem; cursor: pointer; transition: border-color .15s, background .15s;
}
.userchip:hover { border-color: var(--blue-3); background: var(--blue-2); }
.avatar {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-weight: 700; font-size: .74rem;
}
.uname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn {
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: .82rem; cursor: pointer;
}
.iconbtn:hover { color: var(--red); border-color: #f3c6cd; background: #fff5f6; }
.demo { background: #fff4d6; color: #7a5200; text-align: center; padding: 6px 12px; font-size: .85rem; }

main { padding-top: 28px; padding-bottom: 28px; }
.view { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Cards, forms, buttons ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
details.card > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--navy); }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "+"; font-size: 1.4rem; font-weight: 400; color: var(--blue); line-height: 1; }
details.card[open] > summary::after { content: "\2212"; }
details.card[open] > summary { margin-bottom: 8px; }

.eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); background: var(--blue-2); padding: 4px 10px; border-radius: 999px; }
.eyebrow.light { background: rgba(255, 255, 255, .16); color: #fff; }

.form { display: grid; gap: 14px; margin-top: 12px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--ink); }
input:not([type=checkbox]) {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm); font: inherit; background: #fbfcfe; transition: border-color .15s, box-shadow .15s;
}
input:not([type=checkbox]):focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(21, 70, 184, .12); background: #fff; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
fieldset { border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 12px; margin: 0; }
legend { font-weight: 600; font-size: .9rem; padding: 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: .86rem; background: var(--bg);
  padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line); cursor: pointer; transition: all .15s; user-select: none;
}
.chips label:has(input:checked) { background: var(--blue-2); border-color: var(--blue); color: var(--navy); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .88rem; color: var(--muted); }

.btn {
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--blue); color: #fff; border: 0; padding: 12px 22px; border-radius: 999px;
  font: inherit; font-weight: 700; cursor: pointer; transition: transform .1s, box-shadow .15s, background .15s;
  box-shadow: 0 4px 14px rgba(21, 70, 184, .28);
}
.btn:hover { background: #0f3a9e; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.btn.ghost { background: #fff; color: var(--blue); border: 1.5px solid var(--blue-3); box-shadow: none; }
.btn.ghost:hover { border-color: var(--blue); background: var(--blue-2); }
.btn.small { padding: 7px 14px; font-size: .85rem; }
.btn.light { background: #fff; color: var(--navy); box-shadow: 0 4px 14px rgba(0, 0, 0, .15); }
.btn.light:hover { background: #f2f5fc; }
.btn.outline-light { background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, .6); box-shadow: none; }
.link { background: none; border: 0; color: var(--blue); cursor: pointer; font: inherit; font-weight: 600; padding: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.msg { padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 16px; font-size: .92rem; border: 1px solid transparent; }
.msg.err { background: #fdecec; color: #9b1c1c; border-color: #f7cccc; }
.msg.ok { background: var(--okbg); color: var(--ok); border-color: #bfe7d6; }

/* ---------- Landing / auth ---------- */
.auth-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: start; }
.hero { padding-top: 12px; }
.hero h1 { font-size: 2.6rem; color: var(--navy); margin: 14px 0 12px; }
.hero h1 em { font-style: normal; color: var(--red); }
.lead { font-size: 1.1rem; color: #3b4766; max-width: 34em; }
.features { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 12px; }
.features li { display: flex; gap: 14px; align-items: center; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.features .fi { flex: none; width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; font-weight: 800; font-size: .95rem; }
.features li span:last-child { font-size: .9rem; color: var(--muted); line-height: 1.4; }
.features b { color: var(--ink); display: block; }
.features small { display: block; font-size: inherit; }
.card.auth { padding: 26px; box-shadow: var(--shadow-lg); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border-radius: 999px; margin-bottom: 8px; }
.tab { padding: 10px; border: 0; background: transparent; border-radius: 999px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; transition: all .15s; }
.tab.active { background: #fff; color: var(--navy); box-shadow: 0 2px 8px rgba(16, 32, 72, .12); }

/* ---------- Dashboard ---------- */
.welcome {
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--navy) 0%, var(--blue) 70%, #3a6fe0 100%); color: #fff;
  border-radius: var(--r); padding: 28px; margin-bottom: 18px; box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.welcome::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.welcome h2 { color: #fff; font-size: 1.7rem; margin: 10px 0 6px; }
.welcome p { margin: 0; opacity: .9; max-width: 34em; }
.stats { display: flex; gap: 12px; position: relative; z-index: 1; }
.stat { min-width: 110px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); border-radius: 14px; padding: 14px 16px; text-align: center; }
.stat .num { display: block; font-size: 1.7rem; font-weight: 800; letter-spacing: 1px; }
.stat .cap { font-size: .78rem; opacity: .85; }

.attempts { display: grid; gap: 10px; }
.att { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fcfdff; transition: border-color .15s, box-shadow .15s; }
.att:hover { border-color: var(--blue-3); box-shadow: var(--shadow); }
.tbadge { flex: none; min-width: 64px; text-align: center; padding: 10px 8px; border-radius: 12px; background: #fdeaed; color: var(--red); font-weight: 800; letter-spacing: 1px; }
.ainfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ainfo .muted { font-size: .84rem; }
.att .btns { display: flex; gap: 6px; flex: none; }

/* ---------- Test ---------- */
.card.test { max-width: 720px; margin: 0 auto 18px; padding: 28px; box-shadow: var(--shadow-lg); }
.progress { height: 8px; background: var(--blue-2); border-radius: 8px; overflow: hidden; }
#bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), #3a6fe0); border-radius: 8px; transition: width .25s; }
.qmeta { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 6px; color: var(--muted); font-size: .88rem; }
.qtext { font-size: 1.4rem; font-weight: 700; color: var(--navy); min-height: 3.6em; margin: 14px 0 18px; }
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 13px 16px; border: 1.5px solid var(--line);
  border-radius: 12px; background: #fff; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; transition: all .12s;
}
.opt .k { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--bg); color: var(--muted); font-size: .85rem; }
.opt:hover { border-color: var(--blue); background: var(--blue-2); }
.opt.sel { background: var(--blue); color: #fff; border-color: var(--blue); }
.opt.sel .k { background: rgba(255, 255, 255, .2); color: #fff; }

/* ---------- Result ---------- */
#resultBox > .card:first-child { border-top: 5px solid var(--red); }
.typehead { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.typecode { font-size: 3.2rem; font-weight: 800; color: var(--red); letter-spacing: 3px; background: #fdeaed; border-radius: 16px; padding: 4px 18px; }
.typelabel { font-size: 1.35rem; font-weight: 800; color: var(--navy); }
.typehead > div:last-child { flex: 1; min-width: 220px; }
.dim { margin: 14px 0; }
.dim .about { font-size: .85rem; text-align: center; color: var(--muted); }
.dim .lbl { display: flex; justify-content: space-between; font-size: .86rem; font-weight: 600; margin-top: 2px; }
.dim .track { position: relative; height: 12px; background: var(--blue-2); border-radius: 8px; margin-top: 4px; }
.dim .fill { position: absolute; top: 0; bottom: 0; background: linear-gradient(90deg, var(--blue), #3a6fe0); border-radius: 8px; }
.dim .mid { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: .25; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; margin-top: 8px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg); color: var(--navy); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
th:first-child { border-radius: 10px 0 0 10px; } th:last-child { border-radius: 0 10px 10px 0; }
tbody tr:hover td { background: #fafcff; }
tr.me td { background: #fff6e0; font-weight: 700; }
tr.dim-row td { opacity: .65; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; margin: 4px 0; }
.pill.ok { background: var(--okbg); color: var(--ok); }
.pill.warn { background: var(--warnbg); color: var(--warn); }
.matchbar { display: inline-block; width: 64px; height: 7px; background: var(--blue-2); border-radius: 4px; vertical-align: middle; margin-right: 6px; }
.matchbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); border-radius: 4px; }
td .matchbar + * { white-space: nowrap; }
details.more { margin-top: 8px; font-size: .88rem; }
details.more summary { color: var(--blue); cursor: pointer; font-weight: 700; }
details.more p { margin: 6px 0; }
.m-only { display: none; margin-top: 6px; }

/* ---------- Footer ---------- */
.foot { color: var(--muted); font-size: .82rem; padding-bottom: 36px; }
.foot summary { cursor: pointer; font-weight: 600; }
.foot li { margin-bottom: 4px; }

/* ---------- Tablet ---------- */
@media (max-width: 860px) {
  .auth-grid { grid-template-columns: 1fr; gap: 18px; }
  .hero h1 { font-size: 2rem; }
}

/* ---------- Mobile ---------- */
@media (max-width: 560px) {
  .wrap { padding: 0 14px; }
  .top-in { height: 52px; gap: 8px; }
  .logo { height: 30px; padding: 0 8px; font-size: .8rem; }
  .brand { font-size: .78rem; }
  .sub { display: none; }
  .userchip { padding: 2px; max-width: none; }
  .uname { display: none; }
  .avatar { width: 30px; height: 30px; }
  .iconbtn { width: 34px; height: 34px; padding: 0; justify-content: center; }
  .iconbtn .lbl { display: none; }
  main { padding-top: 16px; }
  .msg { padding: 9px 12px; font-size: .86rem; margin-bottom: 12px; }

  .hero { padding-top: 0; }
  .hero h1 { font-size: 1.6rem; margin: 10px 0 8px; }
  .lead { font-size: .98rem; }
  .features { grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 6px; }
  .features li { flex-direction: column; text-align: center; padding: 10px 6px; gap: 6px; }
  .features .fi { width: 40px; height: 40px; font-size: .8rem; }
  .features li span:last-child { font-size: .74rem; }
  .features small { display: none; }
  .hero > .hint { display: none; }
  .card { padding: 16px; border-radius: 14px; }
  .card.auth { padding: 18px; }
  .row2 { grid-template-columns: 1fr; }

  .welcome { padding: 20px; gap: 16px; }
  .welcome h2 { font-size: 1.35rem; }
  .welcome .actions { flex-direction: column; margin-top: 14px; }
  .welcome .actions .btn { width: 100%; }
  .welcome p { font-size: .92rem; }
  .stats { width: 100%; }
  .stat { flex: 1; padding: 10px; }
  .stat .num { font-size: 1.35rem; }

  .att { flex-wrap: wrap; gap: 10px; }
  .att .btns { width: 100%; }
  .att .btns .btn { flex: 1; }
  .tbadge { min-width: 56px; padding: 8px 6px; }

  .card.test { padding: 18px; }
  .qtext { font-size: 1.15rem; min-height: 4.2em; }
  .opt { padding: 12px; }
  .actions .btn { flex: 1; }

  .typecode { font-size: 2.4rem; padding: 2px 14px; }
  .typelabel { font-size: 1.15rem; }
  th, td { padding: 9px 6px; }
  .m-only { display: block; } .d-only { display: none; }
}

/* ---------- v2: parts, interest profile, graduate attributes ---------- */
.qpart { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--navy); font-size: .95rem; }
.code-chip { display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: 8px; background: var(--navy); color: #fff; font-size: .95rem; letter-spacing: 2px; vertical-align: middle; }
.code-chip.sm { font-size: .72rem; padding: 1px 7px; letter-spacing: 1px; margin-left: 4px; }
.hbar { height: 8px; background: var(--blue-2); border-radius: 6px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #3a6fe0); border-radius: 6px; }
.kv { display: grid; grid-template-columns: 180px 1fr 46px; align-items: center; gap: 10px; margin: 8px 0; font-size: .88rem; }
.kv b { text-align: right; }
.riasec { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.rcell { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fcfdff; }
.rcell.rtop { border-color: var(--blue-3); background: var(--blue-2); }
.rcell.rtop .hbar i { background: linear-gradient(90deg, var(--gold), var(--red)); }
.rhead { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.rhead b { font-size: 1.2rem; color: var(--navy); }
.rhead span { font-weight: 700; font-size: .9rem; }
.rhead em { margin-left: auto; font-style: normal; font-weight: 800; color: var(--navy); }
.rcell small { display: block; color: var(--muted); font-size: .78rem; margin-top: 6px; line-height: 1.35; }
.reasons { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--gold); background: #fffaf0; border-radius: 0 8px 8px 0; font-size: .84rem; }
.reasons > span { font-weight: 700; color: var(--navy); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }
.reasons ul { margin: 4px 0 0; padding-left: 18px; }
.po-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px; margin-top: 12px; }
.po { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); }
.po.strong { border-color: #bfe7d6; background: var(--okbg); }
.po.strong .hbar i { background: linear-gradient(90deg, #22a06b, var(--ok)); }
.po.grow { border-color: #fbd9b0; background: var(--warnbg); }
.po.grow .hbar i { background: linear-gradient(90deg, var(--gold), var(--warn)); }
.po-h { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; font-size: .88rem; }
.po-h b { color: var(--navy); min-width: 38px; }
.po-h span { font-weight: 600; }
.po-h em { margin-left: auto; font-style: normal; font-weight: 800; }
.po small { display: block; color: var(--muted); font-size: .78rem; margin-top: 5px; }
.legend { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.legend .sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.sw.strong { background: var(--okbg); border: 1px solid #bfe7d6; }
.sw.grow { background: var(--warnbg); border: 1px solid #fbd9b0; margin-left: 10px; }
@media (max-width: 860px) { .riasec { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .riasec { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .rcell { padding: 10px; min-width: 0; } .rcell small { display: none; }
  .rhead { gap: 5px; } .rhead b { font-size: 1rem; } .rhead span { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .rhead em { font-size: .85rem; }
  .po-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 120px 1fr 40px; font-size: .8rem; }
}
.staff-link { text-align: right; margin-top: 10px; font-size: .78rem; }
.staff-link a { color: var(--muted); }

.pref { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: #e7f9ee; color: #128c4b; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; vertical-align: middle; }
label small.hint { font-weight: 400; font-size: .78rem; }
