/* PV = nRT · Academia iTalent — 2026-09-24 */
:root {
  --ink: #18154c;
  --ink-2: #34325a;
  --mute: #6b6b85;
  --bg: #f5f6fb;
  --card: #ffffff;
  --line: #e6e8f0;
  --soft: #eef0f5;
  --accent: #fc643f;
  --sky: #0db1cf;
  --yellow: #ffd447;
  --ok: #1d7f45;
  --ok-bg: #e9f7ef;
  --bad: #c2362a;
  --bad-bg: #fdeeec;
  --radius: 20px;
  --shadow: 0 12px 40px rgba(24, 21, 76, .07);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: Nunito, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.wrap { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }

/* ── Capçalera amb partícules ───────────────────────────── */
.top {
  position: relative;
  overflow: hidden;
  background-color: var(--ink);
  background-image: radial-gradient(70% 90% at 85% 0%, rgba(13, 177, 207, .28), transparent 60%),
                    radial-gradient(60% 80% at 0% 100%, rgba(252, 100, 63, .22), transparent 60%);
  color: #fff;
}
.top-gas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.top-in { position: relative; padding: 22px 0 34px; }
.brand {
  display: inline-block;
  margin-bottom: 18px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
  text-decoration: none;
  background-color: rgba(255, 255, 255, .06);
}
.brand:hover { background-color: rgba(255, 255, 255, .14); }
.title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin: 0 0 8px; }
.title-eq { font-size: clamp(44px, 7vw, 72px); font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.title-sub { font-size: clamp(18px, 2.4vw, 24px); font-weight: 700; color: var(--yellow); }
.lead { max-width: 620px; margin: 0; font-size: 17px; color: rgba(255, 255, 255, .82); }

/* ── Disposició ─────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
  padding: 26px 0 40px;
}
.col-main { min-width: 0; }
.col-side { position: sticky; top: 16px; min-width: 0; }

.card {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── Pestanyes i selectors ──────────────────────────────── */
.tabs { display: flex; gap: 4px; margin-bottom: 14px; padding: 4px; border-radius: 999px; background-color: #e7e9f2; }
.tab {
  flex: 1 1 0;
  padding: 11px 12px;
  border: 0; border-radius: 999px;
  background-color: transparent;
  font-size: 15px; font-weight: 800;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.tab:hover { background-color: rgba(24, 21, 76, .06); }
.tab[aria-selected="true"] { background-color: var(--ink); color: #fff; box-shadow: 0 6px 14px rgba(24, 21, 76, .22); }

.controls { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 14px; }
.ctl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ctl-label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.seg { display: flex; flex-wrap: wrap; gap: 3px; padding: 4px; border-radius: 16px; background-color: #e7e9f2; }
.seg button {
  padding: 8px 14px;
  border: 0; border-radius: 12px;
  background-color: transparent;
  font-size: 14.5px; font-weight: 700;
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease;
}
.seg button b { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 4px; border-radius: 50%; background-color: rgba(24, 21, 76, .1); font-size: 12px; }
.seg button:hover { background-color: rgba(24, 21, 76, .06); }
.seg button[aria-pressed="true"] { background-color: #fff; box-shadow: 0 2px 10px rgba(24, 21, 76, .16); }
.seg button[aria-pressed="true"] b { background-color: var(--yellow); }
.tab:focus-visible, .seg button:focus-visible, .btn:focus-visible, .btn-soft:focus-visible, .btn-new:focus-visible, .btn-link:focus-visible, summary:focus-visible {
  outline: 3px solid var(--sky); outline-offset: 2px;
}

/* ── Exercici ───────────────────────────────────────────── */
.ex { padding: 24px 26px 22px; }
.ex-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ex-tag { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.btn-new {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 7px;
  white-space: nowrap;
  padding: 8px 14px;
  border: 2px solid rgba(252, 100, 63, .35); border-radius: 999px;
  background-color: #fff;
  color: var(--accent);
  font-size: 14px; font-weight: 800;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn-new:hover { border-color: var(--accent); background-color: #fff5f2; }
.btn-new svg { width: 16px; height: 16px; }
.ex-text { margin: 0 0 18px; font-size: 19px; line-height: 1.6; }
.d { font-weight: 800; white-space: nowrap; background-image: linear-gradient(transparent 62%, rgba(255, 212, 71, .6) 62%); padding: 0 2px; }
.ask { display: block; margin-top: 6px; font-size: 16px; font-weight: 700; color: var(--ink-2); }

.answer { padding-top: 16px; border-top: 1px solid var(--line); }
.ans-label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.ans-row { display: flex; align-items: center; gap: 10px; }
.ans-sym { flex: 0 0 auto; font-size: 20px; font-weight: 800; white-space: nowrap; }
.ans-row input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px 14px;
  border: 2px solid var(--line); border-radius: 12px;
  background-color: #fff;
  font: inherit; font-size: 20px; font-weight: 700; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ans-row input:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px rgba(13, 177, 207, .15); }
.ans-row input.is-ok { border-color: var(--ok); }
.ans-row input.is-bad { border-color: var(--bad); }
.ans-unit { flex: 0 0 auto; min-width: 52px; font-size: 18px; font-weight: 800; color: var(--ink-2); }
.ans-note { margin: 6px 0 0; font-size: 12.5px; color: var(--mute); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn, .btn-soft {
  padding: 12px 20px;
  border: 0; border-radius: 999px;
  font-size: 15px; font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn { background-color: var(--ink); color: #fff; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(24, 21, 76, .25); }
.btn-soft { background-color: var(--soft); color: var(--ink); }
.btn-soft:hover { background-color: #e2e5ef; }

.feedback:empty { display: none; }
.feedback { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: 14px; font-size: 15.5px; font-weight: 600; line-height: 1.45; }
.feedback svg { flex: 0 0 22px; width: 22px; height: 22px; margin-top: 1px; }
.feedback.ok { background-color: var(--ok-bg); color: var(--ok); }
.feedback.bad { background-color: var(--bad-bg); color: var(--bad); }
.feedback.info { background-color: #eef8fb; color: #0b6f82; }

.hint { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background-color: #eef8fb; font-size: 15.5px; }
.hint h3 { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #0b6f82; }
.hint ul { margin: 0 0 10px; padding-left: 20px; }
.hint ul:last-child { margin-bottom: 0; }
.hint li { margin: 2px 0; }

/* ── Solució ────────────────────────────────────────────── */
.sol { margin-top: 16px; padding: 24px 26px; }
.sol-h { margin: 0 0 14px; font-size: 22px; font-weight: 800; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.steps > li { position: relative; padding: 0 0 18px 44px; counter-increment: st; }
.steps > li:last-child { padding-bottom: 0; }
.steps > li::before {
  content: counter(st);
  position: absolute; left: 0; top: 0;
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background-color: var(--ink); color: var(--yellow);
  font-size: 14px; font-weight: 800;
}
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 34px; bottom: 4px; width: 2px; background-color: var(--line); }
.st-t { display: block; margin-bottom: 6px; font-weight: 800; font-size: 16px; line-height: 30px; }
.m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 6px 0; font-size: 17px; font-variant-numeric: tabular-nums; }
.m small { color: var(--mute); font-size: 14px; }
.fr { display: inline-flex; flex-direction: column; align-items: stretch; vertical-align: middle; text-align: center; line-height: 1.25; margin: 0 2px; }
.fr > span { padding: 1px 6px; white-space: nowrap; }
.fr > span:first-child { border-bottom: 1.6px solid currentColor; }
.x { text-decoration: line-through; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.res { display: inline-block; padding: 3px 10px; border-radius: 10px; background-color: var(--yellow); font-weight: 800; }
.note { display: block; font-size: 14px; color: var(--mute); }

/* ── Marcador ───────────────────────────────────────────── */
.score { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 14px; padding: 0 6px; font-size: 14.5px; color: var(--mute); }
.score b { color: var(--ink); }
.btn-link { margin-left: auto; padding: 4px 2px; border: 0; background: none; color: var(--mute); font-size: 13.5px; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* ── Taula resum ────────────────────────────────────────── */
.sum { overflow: hidden; }
.sum summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  font-size: 17px; font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.sum summary::-webkit-details-marker { display: none; }
.sum summary svg { width: 20px; height: 20px; transition: transform .2s ease; }
.sum[open] summary svg { transform: rotate(180deg); }
.sum-body { padding: 0 20px 18px; }
.sum-sec { padding: 12px 0; border-top: 1px solid var(--line); }
.sum-sec h3 { margin: 0 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.sum-law { margin: 0 0 8px; font-size: 30px; font-weight: 800; letter-spacing: .02em; }
.sum-t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.sum-t th { width: 26px; padding: 3px 0; text-align: left; font-weight: 800; }
.sum-t td { padding: 3px 4px; }
.sum-t td.u { text-align: right; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.sum-conv td { padding: 5px 6px; }
.sum-conv td:first-child { white-space: nowrap; font-weight: 700; }
.sum-conv td:nth-child(2) { width: 16px; text-align: center; color: var(--mute); }
.sum-conv small { display: block; font-size: 12px; color: var(--mute); }
.sum-conv tr { transition: background-color .25s ease; }
.sum-conv tr.is-hot { background-color: rgba(255, 212, 71, .45); }
.sum-conv tr.is-hot td:first-child { border-radius: 8px 0 0 8px; }
.sum-conv tr.is-hot td:last-child { border-radius: 0 8px 8px 0; }
.sum-desp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-top: 10px; font-size: 15px; font-weight: 700; }
.sum-desp > span { display: flex; align-items: center; gap: 4px; }
.sum-steps { margin: 0; padding-left: 20px; font-size: 14.5px; }
.sum-steps li { margin: 3px 0; }
.sum-tips ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); }
.sum-tips li { margin: 4px 0; }

/* ── Peu ────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); background-color: #fff; font-size: 14px; color: var(--mute); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding: 18px 0 22px; }
.foot a { color: var(--ink); font-weight: 700; }

/* ── Mòbil ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .col-side { position: static; }
}
@media (max-width: 560px) {
  .top-in { padding: 16px 0 26px; }
  .lead { font-size: 15.5px; }
  .tab { font-size: 14px; padding: 10px 8px; }
  .ctl { flex: 1 1 100%; }
  .seg button { flex: 1 1 auto; padding: 7px 10px; font-size: 14px; }
  .ex-head { align-items: flex-start; }
  .ex, .sol { padding: 20px 16px; }
  .ex-text { font-size: 17.5px; }
  .ans-row input { font-size: 18px; padding: 10px 12px; }
  .ans-sym { font-size: 18px; }
  .actions .btn { flex: 1 1 100%; }
  .actions .btn-soft { flex: 1 1 0; }
  .steps > li { padding-left: 38px; }
  .m { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ── Com es resol (sota els exercicis; abans era al lateral) ── */
.how { margin-top: 16px; padding: 22px 26px 24px; }
.how-h { margin: 0 0 14px; font-size: 18px; font-weight: 800; }
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; counter-reset: how; }
.how-steps li { position: relative; padding: 14px 14px 16px; border-radius: 14px; background-color: var(--soft); counter-increment: how; }
.how-steps li::before {
  content: counter(how);
  display: grid; place-items: center;
  width: 28px; height: 28px;
  margin-bottom: 8px;
  border-radius: 50%;
  background-color: var(--ink); color: var(--yellow);
  font-size: 13px; font-weight: 800;
}
.how-steps li:not(:last-child)::after {
  content: "";
  position: absolute; top: 24px; right: -9px;
  width: 6px; height: 6px;
  border-top: 2px solid #c3c6d4; border-right: 2px solid #c3c6d4;
  transform: rotate(45deg);
}
.how-steps b { display: block; font-size: 15px; font-weight: 800; }
.how-steps span { display: block; margin-top: 2px; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.how-tips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.how-tips p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.how-tips b { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
@media (max-width: 900px) {
  .how-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how-steps li::after { display: none; }
}
@media (max-width: 560px) {
  .how { padding: 20px 16px; }
  .how-tips { grid-template-columns: 1fr; }
}
.how-desp { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.how-desp > span { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 8px 6px; border: 1.5px dashed #d7dae6; border-radius: 12px; font-size: 15px; font-weight: 700; }
.sum-sec { padding: 10px 0; }
@media (max-width: 900px) { .how-desp { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.how-lbl { margin: 16px 0 0; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.how-lbl + .how-desp { margin-top: 8px; }
