/* =========================================================
   Tests interactius de autoconocimiento — Ilde Psicología
   (usa els tokens de styles.css: --deep, --accent, --cream…)
   ========================================================= */

.test-page{
  background:linear-gradient(180deg,var(--accent-wash) 0%,var(--cream) 38%);
  padding:clamp(2rem,5vw,3.5rem) 0 clamp(3rem,7vw,5rem);
}
.test-shell{width:min(680px,92%);margin:0 auto}
#test-app{position:relative}

.test-card{
  background:var(--paper);border:1px solid var(--border);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:clamp(1.75rem,4vw,2.85rem);text-align:center;
  opacity:0;transform:translateY(14px);
}
.test-card--in{opacity:1;transform:none;transition:opacity .35s ease, transform .35s ease}

.test-eyebrow{display:inline-block;font-weight:600;font-size:.76rem;letter-spacing:.13em;text-transform:uppercase;color:var(--accent-strong);margin-bottom:1rem}
.test-title{font-family:var(--font-head);font-size:clamp(1.6rem,4vw,2.3rem);font-weight:600;line-height:1.12;margin-bottom:1rem}
.test-intro{color:var(--ink-2);font-size:1.05rem;max-width:46ch;margin:0 auto 1.75rem}
.test-btn-start{font-size:1.05rem;padding:.95rem 2.1rem}
.test-disclaimer{color:var(--ink-3);font-size:.82rem;margin-top:1.5rem;max-width:44ch;margin-left:auto;margin-right:auto}

/* Progrés */
.test-progress{height:8px;border-radius:999px;background:var(--cream-2);overflow:hidden;margin-bottom:.6rem}
.test-progress span{display:block;height:100%;background:var(--deep);border-radius:999px;transition:width .4s ease}
.test-progress-label{font-size:.78rem;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--ink-3);margin-bottom:1.3rem}

/* Pregunta */
.test-question{font-family:var(--font-head);font-size:clamp(1.3rem,3vw,1.75rem);font-weight:500;line-height:1.25;margin-bottom:1.6rem}
.test-options{display:grid;gap:.7rem}
.test-option{
  width:100%;text-align:left;padding:1rem 1.25rem;border-radius:14px;border:1.5px solid var(--border-2);
  background:var(--cream);font-family:var(--font-body);font-size:1rem;font-weight:500;color:var(--ink);
  cursor:pointer;transition:transform .15s ease, border-color .18s ease, background .18s ease, color .18s ease;
}
.test-option:hover{border-color:var(--deep);background:#fff;transform:translateY(-1px)}
.test-option.is-selected{border-color:var(--deep);background:var(--deep);color:#fff}
.test-nav{margin-top:1.3rem;min-height:1.4rem;display:flex;justify-content:flex-start}
.test-back{background:none;border:none;color:var(--ink-3);font-weight:600;font-size:.9rem;cursor:pointer;padding:.3rem .2rem}
.test-back:hover{color:var(--accent-strong)}

/* Resultat */
.test-level{display:inline-block;font-family:var(--font-head);font-size:1.05rem;font-weight:600;padding:.4rem 1.15rem;border-radius:999px;margin-bottom:1rem;background:var(--accent-wash);color:var(--accent-strong)}
.test-result--good .test-level{background:#d9ece1;color:#1f6b54}
.test-result--mid  .test-level{background:#fbe7cf;color:#9a6a1e}
.test-result--alert .test-level{background:#f7ddd1;color:#b3502f}
.test-result-title{font-family:var(--font-head);font-size:clamp(1.5rem,3.5vw,2.1rem);font-weight:600;line-height:1.15;margin-bottom:.85rem}
.test-result-text{color:var(--ink-2);font-size:1.05rem;max-width:50ch;margin:0 auto 1.75rem}
.test-result-cta{display:flex;gap:.8rem;justify-content:center;flex-wrap:wrap}
.test-result-link{display:inline-block;margin-top:1.15rem;color:var(--accent-strong);font-weight:600}
.test-result-link:hover{text-decoration:underline}
.test-restart{display:block;margin:1.4rem auto 0;background:none;border:none;color:var(--ink-3);font-weight:600;cursor:pointer;text-decoration:underline;font-size:.92rem}

/* ===== Hub de tests — tarjetas ===== */
.tests-hub__grid{display:grid;grid-template-columns:repeat(2,1fr);gap:1.4rem;margin-top:2.75rem}
.test-card-link{
  position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:.6rem;text-align:left;
  background:var(--paper);border:1px solid var(--border);border-radius:var(--radius);
  padding:1.9rem 1.9rem 1.55rem;overflow:hidden;
  box-shadow:var(--shadow-sm);
  transition:transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.test-card-link::before{
  content:"";position:absolute;left:0;top:0;width:100%;height:3px;
  background:linear-gradient(90deg,var(--accent),var(--accent-2));
  transform:scaleX(0);transform-origin:left;transition:transform .26s ease;
}
.test-card-link:hover{transform:translateY(-5px);box-shadow:var(--shadow);border-color:var(--accent)}
.test-card-link:hover::before{transform:scaleX(1)}

.test-card-link__ic{
  width:56px;height:56px;border-radius:16px;display:grid;place-items:center;
  background:var(--accent-wash);color:var(--accent-strong);margin-bottom:.2rem;
  transition:background .22s ease, color .22s ease, transform .22s ease;
}
.test-card-link__ic svg{width:27px;height:27px}
.test-card-link:hover .test-card-link__ic{background:var(--accent);color:#fff;transform:rotate(-4deg) scale(1.05)}

.test-card-link h3{font-family:var(--font-head);font-size:1.22rem;font-weight:600;line-height:1.2;margin:0}
.test-card-link p{color:var(--ink-2);font-size:.96rem;line-height:1.5;flex:1;margin:0}

.test-card-link__foot{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;width:100%;
  margin-top:.95rem;padding-top:.95rem;border-top:1px solid var(--border);
}
.test-card-link__meta{display:inline-flex;align-items:center;gap:.38rem;font-size:.82rem;font-weight:600;color:var(--ink-3)}
.test-card-link__meta svg{width:15px;height:15px}
.test-card-link__go{display:inline-flex;align-items:center;gap:.4rem;color:var(--accent-strong);font-weight:600;font-size:.96rem;white-space:nowrap}
.test-card-link__go svg{width:17px;height:17px;transition:transform .2s ease}
.test-card-link:hover .test-card-link__go svg{transform:translateX(4px)}

/* Tarjeta CTA destacada (reservar) */
.test-card-link--cta{background:linear-gradient(155deg,var(--deep),#1e423c);border-color:transparent;color:#fff}
.test-card-link--cta h3{color:#fff}
.test-card-link--cta p{color:rgba(255,255,255,.82)}
.test-card-link--cta .test-card-link__ic{background:rgba(255,255,255,.15);color:#fff}
.test-card-link--cta:hover{border-color:transparent;box-shadow:0 20px 42px -20px rgba(30,66,60,.75)}
.test-card-link--cta:hover .test-card-link__ic{background:rgba(255,255,255,.24);color:#fff;transform:rotate(-4deg) scale(1.05)}
.test-card-link--cta::before{background:var(--accent-2)}
.test-card-link--cta .test-card-link__foot{border-top-color:rgba(255,255,255,.18)}
.test-card-link--cta .test-card-link__meta{color:rgba(255,255,255,.72)}
.test-card-link--cta .test-card-link__go{color:var(--accent-2)}

@media (max-width:640px){
  .tests-hub__grid{grid-template-columns:1fr;gap:1rem;margin-top:2rem}
  .test-result-cta{flex-direction:column}
  .test-result-cta .btn{width:100%}
}
