/* ============================================================
   NewParts Assessment — premium design system
   Palette: Dark Blue #252A49 · Light Sky Blue #1482FF · Light Grey #F4F5F6 · White
   Type: Fira Sans. No pure black.
   ============================================================ */
:root {
  --brand: #252A49;
  --brand-2: #323a63;
  --accent: #1482FF;
  --accent-600: #0f6fe0;
  --accent-050: #eaf3ff;
  --ink: #232842;
  --ink-soft: #5b6379;
  --grey: #8a92a6;
  --light: #F4F5F6;
  --surface: #ffffff;
  --line: #e7eaf0;
  --line-soft: #eef1f6;
  --good: #16875a;
  --good-050: #e9f8f1;
  --warn: #b45309;
  --warn-050: #fef6e7;
  --bad: #c02637;
  --bad-050: #fdeef0;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --sh-1: 0 1px 2px rgba(37,42,73,.06), 0 1px 3px rgba(37,42,73,.05);
  --sh-2: 0 4px 12px rgba(37,42,73,.08), 0 2px 4px rgba(37,42,73,.04);
  --sh-3: 0 12px 34px rgba(37,42,73,.12), 0 4px 10px rgba(37,42,73,.06);
  --sh-accent: 0 8px 22px rgba(20,130,255,.28);

  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --dur: .28s;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Fira Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 480px at 100% -10%, #eef5ff 0%, rgba(238,245,255,0) 60%),
    radial-gradient(900px 420px at -10% 0%, #f0f3f8 0%, rgba(240,243,248,0) 55%),
    var(--light);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-050); }

/* ---- scrollbar ---- */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: #cdd4e0; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #b4bdcd; background-clip: content-box; }

/* ============================================================
   Keyframes
   ============================================================ */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes swapIn { from { opacity: 0; transform: translateY(10px) scale(.995); } to { opacity: 1; transform: none; } }
@keyframes popCheck { 0% { transform: scale(0); opacity: 0; } 55% { transform: scale(1.18); opacity: 1; } 100% { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .55; } }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes shimmer { 100% { background-position: 200% 0; } }

.reveal { animation: fadeInUp .5s var(--ease-out) both; }
.stagger > * { animation: fadeInUp .5s var(--ease-out) both; }
.stagger > *:nth-child(1){animation-delay:.03s}.stagger > *:nth-child(2){animation-delay:.08s}
.stagger > *:nth-child(3){animation-delay:.13s}.stagger > *:nth-child(4){animation-delay:.18s}
.stagger > *:nth-child(5){animation-delay:.23s}.stagger > *:nth-child(6){animation-delay:.28s}
.stagger > *:nth-child(7){animation-delay:.33s}.stagger > *:nth-child(8){animation-delay:.38s}
.stagger > *:nth-child(n+9){animation-delay:.42s}

/* ============================================================
   Layout
   ============================================================ */
.wrap { max-width: 860px; margin: 0 auto; padding: 30px 20px 72px; }
.wrap.admin { max-width: 1120px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--sh-2);
  padding: 30px 32px;
  animation: fadeInUp .5s var(--ease-out) both;
}

h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; color: var(--brand); font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 17px; color: var(--brand); margin: 0 0 12px; font-weight: 700; letter-spacing: -.005em; }
.sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 22px; }
p { margin: 0 0 12px; }
code { background: var(--light); padding: 1px 6px; border-radius: 6px; font-size: .9em; color: var(--brand); }

/* ============================================================
   Brand bar
   ============================================================ */
.np-logo { display: inline-flex; align-items: center; gap: 12px; }
.np-emblem { width: 36px; height: 33px; flex: 0 0 auto; }
.np-word { font-weight: 600; font-size: 23px; letter-spacing: -.2px; color: var(--brand); }
.np-word b { font-weight: 800; }
.np-logo.on-dark .np-word { color: #fff; }
.brandbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 26px;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brandbar .tag { color: var(--grey); font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

/* ============================================================
   Forms
   ============================================================ */
label { font-weight: 600; display: block; margin: 15px 0 7px; font-size: 13.5px; color: var(--brand); letter-spacing: .01em; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 12px 13px; font-size: 15px; color: var(--ink);
  border: 1.5px solid #d6dce6; border-radius: var(--radius-sm); font-family: inherit; background: #fff;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
input::placeholder, textarea::placeholder { color: #aab2c2; }
textarea { min-height: 112px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(20,130,255,.14);
}
select {
  appearance: none; -webkit-appearance: none; background-repeat: no-repeat; background-position: right 12px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a92a6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  padding-right: 36px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--accent); color: #fff; border: 0; border-radius: var(--radius-sm);
  padding: 12px 22px; font-size: 14.5px; font-weight: 600; cursor: pointer; font-family: inherit;
  box-shadow: var(--sh-accent);
  transition: transform .16s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), opacity .2s;
}
.btn:hover { background: var(--accent-600); transform: translateY(-1px); box-shadow: 0 12px 26px rgba(20,130,255,.34); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.secondary { background: #eef1f7; color: var(--brand); box-shadow: none; border: 1px solid var(--line); }
.btn.secondary:hover { background: #e6ebf3; }
.btn.ghost { background: transparent; color: var(--accent); box-shadow: none; padding-left: 6px; padding-right: 6px; }
.btn.ghost:hover { background: var(--accent-050); transform: none; }

/* ============================================================
   Test top bar + progress
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(100deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 13px 22px; gap: 16px; box-shadow: var(--sh-2);
}
.topbar .left { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.topbar .left .dot { color: #7f8bc0; }
.timer {
  font-variant-numeric: tabular-nums; font-weight: 800; font-size: 18px; letter-spacing: .02em;
  background: rgba(255,255,255,.14); padding: 7px 14px; border-radius: var(--radius-sm);
  transition: background .3s var(--ease);
}
.timer.warning { background: var(--warn); }
.timer.danger { background: var(--bad); animation: pulse 1s infinite; }

.progress { height: 5px; background: #e4e8ef; overflow: hidden; }
.progress > div { height: 100%; width: 0; border-radius: 0 99px 99px 0;
  background: linear-gradient(90deg, var(--accent), #4aa0ff);
  transition: width .45s var(--ease-out); }

/* ============================================================
   Question UI
   ============================================================ */
.qmeta { color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.qtext { font-size: 20px; line-height: 1.4; font-weight: 600; margin: 0 0 22px; color: var(--brand); letter-spacing: -.01em; }
.qinstr {
  background: var(--accent-050);
  border: 1px solid #d5e6ff; border-left: 3px solid var(--accent);
  padding: 12px 15px; border-radius: var(--radius-sm); font-size: 13.5px; color: #35507a; margin-bottom: 20px;
}
.swap { animation: swapIn .32s var(--ease-out) both; }

/* likert */
.likert { display: flex; gap: 10px; flex-wrap: wrap; }
.likert .opt {
  flex: 1 1 0; min-width: 118px; border: 1.5px solid #d6dce6; border-radius: 12px;
  padding: 15px 10px; text-align: center; cursor: pointer; background: #fff;
  transition: border-color .16s var(--ease), background .16s var(--ease), transform .12s var(--ease), box-shadow .16s var(--ease);
}
.likert .opt:hover { border-color: #a9c8ff; transform: translateY(-2px); box-shadow: var(--sh-1); }
.likert .opt .num { font-size: 23px; font-weight: 800; color: var(--brand); transition: color .16s; }
.likert .opt .lbl { font-size: 12px; color: var(--grey); margin-top: 5px; font-weight: 500; }
.likert .opt.selected { border-color: var(--accent); background: var(--accent-050); box-shadow: 0 0 0 3px rgba(20,130,255,.12); }
.likert .opt.selected .num { color: var(--accent); }

/* choice list */
.choices { display: flex; flex-direction: column; gap: 11px; }
.choice {
  border: 1.5px solid #d6dce6; border-radius: 12px; padding: 15px 16px; cursor: pointer;
  display: flex; gap: 13px; align-items: flex-start; background: #fff;
  transition: border-color .16s var(--ease), background .16s var(--ease), transform .12s var(--ease), box-shadow .16s var(--ease);
}
.choice:hover { border-color: #a9c8ff; transform: translateY(-1px); box-shadow: var(--sh-1); }
.choice.selected { border-color: var(--accent); background: var(--accent-050); box-shadow: 0 0 0 3px rgba(20,130,255,.12); }
.choice .badge {
  flex: 0 0 auto; width: 27px; height: 27px; border-radius: 50%; background: var(--light);
  color: var(--brand); font-weight: 800; display: grid; place-items: center; font-size: 13px;
  transition: background .16s, color .16s, transform .16s;
}
.choice:hover .badge { transform: scale(1.06); }
.choice.selected .badge { background: var(--accent); color: #fff; }
.choice > div:last-child { font-size: 14.5px; padding-top: 2px; }

/* ranked */
.ranked .rankrow {
  display: flex; gap: 12px; align-items: center; border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 15px; margin-bottom: 11px; background: #fff;
  transition: border-color .16s, box-shadow .16s;
}
.ranked .rankrow:hover { border-color: #c9d5e6; box-shadow: var(--sh-1); }
.ranked .rankrow.ranked-set { border-color: var(--accent); background: var(--accent-050); }
.ranked .rankrow .txt { flex: 1; font-size: 14.5px; }
.ranked .rankrow select { width: 74px; flex: 0 0 auto; font-weight: 700; text-align: center; }
.ranked .rankrow.ranked-set select { border-color: var(--accent); color: var(--accent); }
.hint { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.err { color: var(--bad); font-size: 13.5px; margin-top: 12px; min-height: 18px; font-weight: 500; }

.navrow { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; gap: 12px; }
.center { text-align: center; }
.big-num { font-size: 44px; font-weight: 800; color: var(--brand); letter-spacing: -.02em; }
.muted { color: var(--grey); }

/* done check */
.done-check {
  width: 88px; height: 88px; border-radius: 50%; margin: 6px auto 14px;
  background: var(--good-050); color: var(--good); display: grid; place-items: center;
  font-size: 44px; font-weight: 800; animation: popCheck .5s var(--ease-out) both;
}

/* ============================================================
   Pills / badges
   ============================================================ */
.pill { display: inline-block; padding: 3px 11px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; letter-spacing: .01em; }
.pill.good { background: var(--good-050); color: var(--good); }
.pill.warn { background: var(--warn-050); color: var(--warn); }
.pill.bad { background: var(--bad-050); color: var(--bad); }

/* ============================================================
   Intake
   ============================================================ */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 20px; }
@media (max-width: 580px) { .grid2 { grid-template-columns: 1fr; } }
.phone-row { display: flex; gap: 8px; }
.phone-row #ccode { width: 118px; flex: 0 0 auto; }
.phone-row #phone { flex: 1; }
.filedrop {
  border: 1.5px dashed #b9c3d4; border-radius: 12px; padding: 20px; text-align: center;
  background: #fbfcfe; cursor: pointer; transition: border-color .18s, background .18s, transform .12s;
  margin-top: 4px;
}
.filedrop:hover { border-color: var(--accent); background: var(--accent-050); }
.filedrop.has-file { border-style: solid; border-color: var(--good); background: var(--good-050); }
.filedrop .fname { font-weight: 700; color: var(--brand); }
.filedrop .up-ic { display:block; font-size: 22px; margin-bottom: 4px; opacity:.75 }

/* ============================================================
   AI fit hero
   ============================================================ */
.fit-hero {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(135deg, #e9f3ff 0%, #f6fbff 55%, #ffffff 100%);
  border: 1px solid #d3e5ff; border-radius: var(--radius); padding: 22px 26px; margin: 4px 0 4px;
  animation: fadeInUp .5s var(--ease-out) both;
}
@property --pct { syntax: "<number>"; inherits: false; initial-value: 0; }
.fit-ring {
  --pct: 0; --col: var(--accent);
  width: 116px; height: 116px; border-radius: 50%; flex: 0 0 auto;
  background: conic-gradient(var(--col) calc(var(--pct) * 1%), #dde7f4 0);
  display: grid; place-items: center; position: relative; box-shadow: var(--sh-1);
  transition: --pct 1.1s var(--ease-out);
}
.fit-ring::before { content: ""; position: absolute; inset: 11px; background: #fff; border-radius: 50%; box-shadow: inset 0 1px 3px rgba(37,42,73,.08); }
.fit-ring .val { position: relative; font-size: 29px; font-weight: 800; letter-spacing: -.02em; }
.fit-ring .cap { position: relative; font-size: 11px; color: var(--grey); margin-top: -5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

.dim-row { margin-bottom: 12px; }
.dim-row .top { display: flex; justify-content: space-between; font-size: 14px; font-weight: 500; margin-bottom: 5px; }
.section-note { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

/* ============================================================
   Meters / bars
   ============================================================ */
.score-bar { height: 9px; background: #eaeef4; border-radius: 99px; overflow: hidden; width: 130px; }
.score-bar > div { height: 100%; border-radius: 99px; transform-origin: left center; animation: barGrow .7s var(--ease-out) both; }

/* ============================================================
   Table
   ============================================================ */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { color: var(--grey); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; background: #fbfcfd; }
th:first-child { border-top-left-radius: 12px; } th:last-child { border-top-right-radius: 12px; }
tbody tr { transition: background .14s var(--ease); }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--accent-050); }
tbody tr:last-child td { border-bottom: 0; }
.card.table-card { padding: 8px 10px; }

/* stat chips */
.statline { display:flex; gap:22px; flex-wrap:wrap; font-size:13.5px; }
.statline .k { color: var(--grey); }

/* ============================================================
   Typography hierarchy (h1/h2/h3 + p1/p2/p3)
   ============================================================ */
h3 { font-size: 14px; font-weight: 700; color: var(--brand); margin: 0 0 8px; letter-spacing: .01em; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
.p1 { font-size: 16px; line-height: 1.6; color: var(--ink); }         /* lead */
.p2 { font-size: 14px; line-height: 1.6; color: var(--ink); }         /* body */
.p3 { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); }  /* caption */
.section-title { display: flex; align-items: center; gap: 9px; }
.section-title .h-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-050); color: var(--accent); flex: 0 0 auto; }
.ic { vertical-align: -3px; }

/* ============================================================
   KPI stat cards
   ============================================================ */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .kpis { grid-template-columns: 1fr; } }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px;
  box-shadow: var(--sh-1); position: relative; overflow: hidden;
  animation: fadeInUp .5s var(--ease-out) both;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--sh-3); }
.kpi .kic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 12px; }
.kpi .kv { font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: var(--brand); line-height: 1; }
.kpi .kl { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; font-weight: 500; }
.kpi .kbadge { position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.kic.blue { background: var(--accent-050); color: var(--accent); }
.kic.navy { background: #eaecf5; color: var(--brand); }
.kic.green { background: var(--good-050); color: var(--good); }
.kic.amber { background: var(--warn-050); color: var(--warn); }

/* ============================================================
   Panels + chart layout
   ============================================================ */
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.overview-grid.three { grid-template-columns: 1.2fr 1fr 1fr; }
@media (max-width: 860px) { .overview-grid, .overview-grid.three { grid-template-columns: 1fr; } }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px;
  box-shadow: var(--sh-1); animation: fadeInUp .5s var(--ease-out) both;
}
.panel .phead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel .phead .section-title h3 { margin: 0; }
.chart-wrap { display: flex; align-items: center; justify-content: center; min-height: 40px; }

/* chart text (SVG) */
.npc-big { font-size: 30px; font-weight: 800; font-family: inherit; }
.npc-big2 { font-size: 26px; font-weight: 800; fill: var(--brand); font-family: inherit; }
.npc-sub { font-size: 11px; fill: var(--grey); font-family: inherit; letter-spacing: .06em; text-transform: uppercase; }
.npc-axis { font-size: 11px; fill: var(--ink-soft); font-family: inherit; font-weight: 600; }
.npc-barval { font-size: 12px; fill: var(--brand); font-weight: 700; font-family: inherit; }
.npc-barlbl { font-size: 11px; fill: var(--grey); font-family: inherit; font-weight: 600; }

/* donut */
.npc-donut { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; }
.npc-legend { display: flex; flex-direction: column; gap: 7px; min-width: 130px; }
.npc-leg { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.npc-leg .dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.npc-leg .lg-l { flex: 1; color: var(--ink); }
.npc-leg .lg-v { font-weight: 700; color: var(--brand); }

/* horizontal bars */
.npc-hbar { display: flex; align-items: center; gap: 12px; margin-bottom: 11px; }
.npc-hbar-l { width: 168px; font-size: 13.5px; flex: 0 0 auto; }
.npc-hbar-track { flex: 1; height: 10px; background: #eaeef4; border-radius: 99px; overflow: hidden; }
.npc-hbar-fill { height: 100%; border-radius: 99px; transition: width 1s var(--ease-out); }
.npc-hbar-v { width: 52px; text-align: right; font-weight: 700; font-size: 13.5px; flex: 0 0 auto; }

.hidden { display: none !important; }
.spinner { width:15px;height:15px;border:2px solid #fff;border-top-color:transparent;border-radius:50%;display:inline-block;animation:spin .7s linear infinite;vertical-align:-2px; }
input.small { width: 92px; display: inline-block; }

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
