/* ════════════════════════════════════════════════════════════════════
   operatori-risorse-proqol.css — Test ProQOL (Professional Quality of Life)
   Prefisso: .pq-*
   Scala 1-5 . 3 sottoscale . 5 item invertiti.
   ════════════════════════════════════════════════════════════════════ */

.pq-section {
  padding: clamp(28px, 5vw, 56px) 0 clamp(48px, 8vw, 96px);
}

.pq-hero-cross {
  font-size: 0.95rem;
  color: var(--color-text-muted, #6b6259);
  margin-top: 14px;
}

.pq-hero-cross a {
  color: var(--color-primary, #c04428);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pq-container {
  max-width: 720px;
}

/* ── Meta header ───────────────────────────────────────────── */
.pq-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border-subtle, rgba(0, 0, 0, 0.06));
}

.pq-meta-tag {
  font-family: var(--font-heading, 'Fraunces', serif);
  font-size: 0.85rem;
  color: var(--color-text-muted, #6b6259);
  font-style: italic;
}

.pq-meta-num {
  font-size: 0.78rem;
  color: var(--color-text-muted, #a8a09a);
}

/* ── Card contenitore ──────────────────────────────────────── */
.pq-card {
  background: var(--color-bg-card, #fff);
  border: 1px solid var(--color-border, #e5dfd5);
  border-radius: 14px;
  padding: clamp(24px, 4vw, 44px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
}

.pq-screen {
  min-height: 200px;
}

.pq-loading {
  text-align: center;
  color: var(--color-text-muted, #6b6259);
  padding: 40px 0;
}

/* ── Intro page ────────────────────────────────────────────── */
.pq-display {
  font-family: var(--font-heading, 'Fraunces', serif);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 600;
  line-height: 1.18;
  margin: 0 0 8px;
  color: var(--color-text, #1a1815);
}

.pq-cite {
  font-size: 0.82rem;
  color: var(--color-text-muted, #6b6259);
  margin: 0 0 24px;
}

.pq-cite em {
  font-style: italic;
}

.pq-desc {
  background: var(--color-bg, #f8f6f1);
  border: 1px solid var(--color-border-subtle, #ede9e2);
  border-radius: 10px;
  padding: 18px 22px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--color-text-muted, #6b6259);
  margin: 0 0 22px;
}

.pq-desc strong {
  color: var(--color-text, #1a1815);
}

.pq-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 24px;
}

.pq-badge {
  font-size: 0.74rem;
  font-weight: 500;
  padding: 5px 13px;
  border-radius: 999px;
}

.pq-btn-lg {
  font-size: 1rem;
  padding: 12px 22px;
}

/* ── Progress ──────────────────────────────────────────────── */
.pq-prog-track {
  height: 3px;
  background: var(--color-border-subtle, #ede9e2);
  border-radius: 2px;
  margin-bottom: 24px;
  overflow: hidden;
}

.pq-prog-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ── Question ──────────────────────────────────────────────── */
.pq-q-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 8px;
}

.pq-dim-pill {
  font-size: 0.74rem;
  font-weight: 500;
  padding: 5px 13px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pq-rev-tag {
  font-size: 0.6rem;
  opacity: 0.7;
}

.pq-rev-mini {
  font-size: 0.6rem;
  opacity: 0.6;
}

.pq-q-count {
  font-size: 0.82rem;
  color: var(--color-text-muted, #a8a09a);
}

.pq-q-text {
  font-family: var(--font-heading, 'Fraunces', serif);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.5;
  color: var(--color-text, #1a1815);
  margin: 0 0 28px;
  min-height: 66px;
  font-weight: 500;
}

/* ── Rating row ────────────────────────────────────────────── */
.pq-r-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.pq-rb {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border, #e5dfd5);
  background: var(--color-bg-card, #fff);
  color: var(--color-text, #1a1815);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  transition:
    border-color 0.12s,
    background 0.12s,
    color 0.12s,
    transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pq-rb:hover {
  border-color: var(--pq-col, var(--color-primary, #c04428));
  background: var(--pq-bg, rgba(192, 68, 40, 0.05));
  transform: scale(1.06);
}

.pq-rb.is-sel {
  border-color: var(--pq-col, var(--color-primary, #c04428));
  background: var(--pq-col, var(--color-primary, #c04428));
  color: #fff;
}

.pq-rb:focus-visible {
  outline: 2px solid var(--pq-col, var(--color-primary, #c04428));
  outline-offset: 2px;
}

.pq-r-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--color-text-muted, #a8a09a);
  padding: 0 4px;
  margin-bottom: 28px;
}

/* ── Nav buttons ───────────────────────────────────────────── */
.pq-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.pq-nav .hd-btn {
  flex: 1;
  min-width: 120px;
}

/* ── Results ───────────────────────────────────────────────── */
.pq-res-title {
  font-family: var(--font-heading, 'Fraunces', serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--color-text, #1a1815);
}

.pq-res-sub {
  font-size: 0.88rem;
  color: var(--color-text-muted, #6b6259);
  margin: 0 0 22px;
}

.pq-dim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.pq-dim-card {
  background: var(--color-bg, #f8f6f1);
  border: 1px solid var(--color-border-subtle, #ede9e2);
  border-radius: 10px;
  padding: 14px 16px;
}

.pq-dc-name {
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.pq-dc-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.pq-dc-score {
  font-family: var(--font-heading, 'Fraunces', serif);
  font-size: 1.6rem;
  font-weight: 600;
  margin: 6px 0;
}

.pq-dc-bar {
  height: 6px;
  background: var(--color-border-subtle, #ede9e2);
  border-radius: 3px;
  overflow: hidden;
}

.pq-dc-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ── Total card ────────────────────────────────────────────── */
.pq-total-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, var(--color-status-done, #2a7a4a) 0%, #c04428 100%);
  color: #fff;
  border-radius: 14px;
  padding: 20px 24px;
  margin: 0 0 28px;
  gap: 14px;
  flex-wrap: wrap;
}

.pq-total-lbl {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.9;
}

.pq-total-sub-lbl {
  font-size: 0.72rem;
  opacity: 0.7;
}

.pq-total-num {
  font-family: var(--font-heading, 'Fraunces', serif);
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1;
}

.pq-total-denom {
  font-size: 1rem;
  opacity: 0.7;
}

.pq-sect-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--color-text, #1a1815);
}

/* ── Chart tabs ────────────────────────────────────────────── */
.pq-chart-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.pq-ct {
  font-size: 0.82rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--color-border, #e5dfd5);
  background: var(--color-bg-card, #fff);
  color: var(--color-text, #1a1815);
  cursor: pointer;
  font-family: inherit;
  min-height: 44px;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}

.pq-ct:hover {
  border-color: var(--color-primary, #c04428);
  color: var(--color-primary, #c04428);
}

.pq-ct.is-on {
  background: var(--color-primary, #c04428);
  color: #fff;
  border-color: var(--color-primary, #c04428);
}

.pq-chart-box {
  background: var(--color-bg, #f8f6f1);
  border: 1px solid var(--color-border-subtle, #ede9e2);
  border-radius: 10px;
  padding: 18px;
  min-height: 280px;
  margin-bottom: 22px;
}

.pq-svg {
  width: 100%;
  max-width: 380px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ── Ring grid (donut) ────────────────────────────────────── */
.pq-ring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  justify-items: center;
}

.pq-ring-cell {
  text-align: center;
}

.pq-ring-lbl {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 6px;
}

.pq-ring-val {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 2px;
}

/* ── Gauge grid ───────────────────────────────────────────── */
.pq-gauge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  justify-items: center;
}

.pq-gauge-item {
  text-align: center;
}

.pq-gauge-lbl {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 4px;
  color: var(--color-text, #1a1815);
}

/* ── Actions / disclaimer ─────────────────────────────────── */
.pq-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.pq-submit-fb {
  font-size: 0.88rem;
  color: var(--color-text-muted, #6b6259);
  margin: 0 0 18px;
  padding: 10px 14px;
  background: var(--color-bg, #f8f6f1);
  border-radius: 6px;
}

.pq-disc {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--color-text-muted, #6b6259);
  border-top: 1px solid var(--color-border-subtle, #ede9e2);
  padding-top: 14px;
  margin-top: 8px;
}

.pq-disc em {
  font-style: italic;
}

.pq-disc a {
  color: var(--color-primary, #c04428);
  text-decoration: underline;
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  body {
    background: #fff;
  }

  .op-page-hero,
  .op-section,
  .pq-section {
    padding: 0;
  }

  .pq-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .pq-actions,
  .pq-chart-tabs,
  .pq-nav {
    display: none;
  }
}

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 540px) {
  .pq-rb {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .pq-q-text {
    font-size: 1.05rem;
  }

  .pq-total-card {
    flex-direction: column;
    text-align: center;
  }

  .pq-actions {
    flex-direction: column;
  }

  .pq-actions .hd-btn {
    width: 100%;
  }
}

/* ── Band badges (Low/Average/High) ──────────────────────── */
.pq-band {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.pq-band--low {
  background: #fce8e6;
  color: #8a1a0e;
}

.pq-band--average {
  background: #fdf3d8;
  color: #6d4f0c;
}

.pq-band--high {
  background: #d8efe1;
  color: #0d4a2e;
}

/* Per CS (positivo) la scala invertita: high=verde, low=rosso */
.pq-band--cs-low {
  background: #fce8e6;
  color: #8a1a0e;
}

.pq-band--cs-high {
  background: #d8efe1;
  color: #0d4a2e;
}

/* Polarity hint nei risultati */
.pq-polarity-hint {
  font-size: 0.72rem;
  color: var(--color-text-muted, #a8a09a);
  font-style: italic;
  margin-top: 2px;
}
