/*
 * Estils per als components de resultat ampliat (FPResultView).
 * Fa servir només els tokens ja definits al :root de test/index.php
 * (--c1, --c2, --gold, --ok, --bad, --sp-1..6, --r-sm/md/lg/xl, --ease).
 * No es redefineixen aquests tokens aquí.
 */

.fp-dash {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  text-align: left;
  margin-top: var(--sp-5);
}

.fp-section {
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .03);
  padding: var(--sp-4) var(--sp-4);
}

/* ---- Capçalera comuna amb títol + badge + botó "per què?" ---- */
.fp-quad-headrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.fp-quad-title {
  font-size: .88rem;
  font-weight: 900;
  color: #eaf7ff;
  flex: 1;
  min-width: 140px;
}

/* ---- Badges d'etiquetatge obligatori ---- */
.fp-badge {
  display: inline-flex;
  align-items: center;
  font-size: .58rem;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .3rem .6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.fp-badge-real {
  color: #bbf7d0;
  background: rgba(52, 211, 153, .14);
  border: 1px solid rgba(52, 211, 153, .35);
}
.fp-badge-est {
  color: #a8f0ff;
  background: rgba(76, 201, 240, .14);
  border: 1px solid rgba(76, 201, 240, .32);
}
.fp-badge-demo {
  color: #f5d18a;
  background: rgba(245, 209, 138, .16);
  border: 1px solid rgba(245, 209, 138, .4);
}

/* ---- Botó i panell "Per què?" (>=44px tàctil) ---- */
.fp-why-wrap { display: inline-block; }
.fp-why {
  min-height: 44px;
  min-width: 44px;
  padding: .4rem .8rem;
  border-radius: var(--r-sm);
  border: 1.5px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .04);
  color: rgba(255, 255, 255, .8);
  font: 800 .72rem 'Inter', sans-serif;
  cursor: pointer;
  transition: border-color .14s, background .14s;
}
.fp-why:hover { border-color: rgba(76, 201, 240, .45); background: rgba(76, 201, 240, .08); }
.fp-why:focus-visible { outline: 3px solid var(--c1); outline-offset: 2px; }
.fp-explain {
  margin-top: var(--sp-2);
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.55;
  color: rgba(255, 255, 255, .72);
  background: rgba(76, 201, 240, .06);
  border: 1px solid rgba(76, 201, 240, .2);
  border-radius: var(--r-sm);
  padding: .7rem .85rem;
}

/* ---- Bloc de dades reals ---- */
.fp-real-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-2);
}
.fp-real-cell {
  text-align: center;
  padding: var(--sp-3) var(--sp-1);
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
}
.fp-real-cell b {
  display: block;
  font-size: 1.3rem;
  font-weight: 950;
  letter-spacing: -.02em;
  color: #fff;
  line-height: 1;
}
.fp-real-cell span {
  display: block;
  margin-top: .32rem;
  font-size: .62rem;
  font-weight: 800;
  color: rgba(255, 255, 255, .5);
  line-height: 1.3;
}

/* ---- Radar per àmbits ---- */
.fp-radar { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); }
.fp-radar-svg { width: 100%; max-width: 280px; height: auto; }
.fp-radar-grid { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 1; }
.fp-radar-axis { stroke: rgba(255, 255, 255, .14); stroke-width: 1; }
.fp-radar-data {
  fill: rgba(76, 201, 240, .22);
  stroke: var(--c1);
  stroke-width: 2;
  stroke-linejoin: round;
  transition: opacity .5s var(--ease);
}
.fp-radar-dot { fill: var(--c1); stroke: #03060a; stroke-width: 1.2; }
.fp-radar-label { font-size: 8px; font-weight: 800; fill: rgba(255, 255, 255, .75); font-family: 'Inter', sans-serif; }
.fp-radar-label-pct { font-size: 8px; font-weight: 950; fill: #a8f0ff; }
.fp-radar-svg.fp-no-anim .fp-radar-data { transition: none; }

.fp-radar-alt {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .68);
}
.fp-radar-alt li {
  padding: .45rem .7rem;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
}

/* ---- Barres d'habilitat ---- */
.fp-bars { display: flex; flex-direction: column; gap: var(--sp-3); }
.fp-bar-row {}
.fp-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: .82rem;
  font-weight: 900;
  margin-bottom: .3rem;
  color: #fff;
}
.fp-bar-head b { color: #a8f0ff; }
.fp-bar-track {
  height: 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}
.fp-bar-fill {
  display: block;
  height: 100%;
  border-radius: 99px;
  width: 0;
  background: linear-gradient(90deg, var(--c1), var(--c2));
  transition: width .9s var(--ease);
}
.fp-bar-sub {
  margin-top: .25rem;
  font-size: .68rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .45);
}

/* ---- Matriu velocitat-precisió ---- */
.fp-quad {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  aspect-ratio: 1 / 1;
  max-width: 260px;
  margin: 0 auto;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1);
}
.fp-quad-cell {
  background: rgba(255, 255, 255, .03);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: .4rem;
}
.fp-quad-cell span {
  font-size: .62rem;
  font-weight: 800;
  color: rgba(255, 255, 255, .5);
  line-height: 1.3;
}
.fp-q-tr { background: rgba(52, 211, 153, .08); }
.fp-q-tr span { color: rgba(187, 247, 208, .85); }
.fp-q-tl, .fp-q-br { background: rgba(245, 209, 138, .06); }
.fp-q-bl { background: rgba(248, 113, 113, .07); }
.fp-q-bl span { color: rgba(254, 202, 202, .8); }
.fp-quad-axis-x, .fp-quad-axis-y {
  position: absolute;
  font-size: .58rem;
  font-weight: 800;
  color: rgba(255, 255, 255, .38);
  text-align: center;
  letter-spacing: .02em;
}
.fp-quad-axis-x { bottom: -1.3rem; left: 0; right: 0; }
.fp-quad-axis-y { top: 0; bottom: 0; left: -3.4rem; width: 3.1rem; display: flex; align-items: center; justify-content: center; line-height: 1.3; }
.fp-quad-marker {
  position: absolute;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  margin-top: -8px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #03060a;
  box-shadow: 0 0 0 4px rgba(245, 209, 138, .28);
  transition: left .8s var(--ease), top .8s var(--ease);
}
.fp-quad-marker.fp-no-anim { transition: none; }
.fp-quad-wrap { padding-left: 3.4rem; }
.fp-quad-note {
  margin-top: var(--sp-5);
  font-size: .8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .68);
  line-height: 1.55;
}

/* ---- Ruta d'estudi ---- */
.fp-path {
  list-style: none;
  counter-reset: fp-step;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.fp-path li {
  counter-increment: fp-step;
  position: relative;
  padding: .7rem .9rem .7rem 2.6rem;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
  font-size: .82rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .8);
  line-height: 1.5;
}
.fp-path li::before {
  content: counter(fp-step);
  position: absolute;
  left: .7rem;
  top: .65rem;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  font-size: .74rem;
  color: #001018;
  background: linear-gradient(135deg, var(--c1), var(--c2));
}

/* ---- Timeline de demostració ---- */
.fp-demo-wrap {
  border: 1.5px dashed rgba(245, 209, 138, .4);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  background:
    repeating-linear-gradient(135deg, rgba(245, 209, 138, .05) 0 10px, transparent 10px 20px),
    rgba(245, 209, 138, .03);
}
.fp-demo-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: .7rem .85rem;
  border-radius: var(--r-sm);
  background: rgba(245, 209, 138, .16);
  border: 1px solid rgba(245, 209, 138, .45);
  font-size: .78rem;
  font-weight: 750;
  color: #fff;
  line-height: 1.5;
  margin-bottom: var(--sp-3);
}
.fp-demo-banner b { color: var(--gold); }
.fp-demo-ico { font-size: 1.1rem; flex-shrink: 0; }
.fp-demo-chart { display: flex; justify-content: center; }
.fp-demo-svg { width: 100%; max-width: 340px; height: auto; }
.fp-demo-line {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2;
  stroke-dasharray: 5 4;
}
.fp-demo-dot { fill: var(--gold); stroke: #03060a; stroke-width: 1; }
.fp-demo-dot-current { fill: var(--c1); r: 4.4; }
.fp-demo-alt {
  list-style: none;
  margin-top: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: .2rem;
  font-size: .72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .55);
}
.fp-demo-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px dashed rgba(245, 209, 138, .3);
  font-size: .72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .6);
  line-height: 1.5;
}

/* ---- Responsive: pantalles grans, dues columnes ---- */
@media (min-width: 900px) {
  .fp-dash {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-5);
  }
  .fp-sec-real, .fp-sec-demo { grid-column: 1 / -1; }
}

/* ---- Accessibilitat / prefers-reduced-motion ---- */
@media (prefers-reduced-motion: reduce) {
  .fp-bar-fill, .fp-quad-marker, .fp-radar-data { transition: none !important; }
}
