/* ════════════════════════════════════════════════════════════════════
   operatori-risorse-perma.css — Test PERMA-Profiler
   Prefisso: .pm-*
   Scala 0-10 . 8 sottoscale (5 PERMA + N + H + Hap) + Loneliness.
   ════════════════════════════════════════════════════════════════════ */

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

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

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

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

/* ── Meta header ───────────────────────────────────────────── */
.pm-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));
}

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

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

/* ── Card contenitore ──────────────────────────────────────── */
.pm-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);
}

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

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

/* ── Intro page ────────────────────────────────────────────── */
.pm-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);
}

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

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

.pm-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;
}

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

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

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

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

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

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

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

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

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

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

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

.pm-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 ────────────────────────────────────────────── */
.pm-r-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.pm-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;
}

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

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

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

.pm-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 ───────────────────────────────────────────── */
.pm-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
}

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

/* ── Results ───────────────────────────────────────────────── */
.pm-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);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.pm-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;
}

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

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

.pm-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;
}

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

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

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

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

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

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

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

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

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

.pm-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;
}

.pm-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;
}

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

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

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

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

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

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

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

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

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

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

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

/* ── Band badges (Low/Average/High) ──────────────────────── */
.pm-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;
}

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

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

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

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

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

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

/* ── Categoria Keyes (Flourishing / Moderate / Languishing) ───── */
.pm-cat-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 12px;
  margin: 0 0 22px;
  border-left: 5px solid;
}

.pm-cat-banner--flourishing {
  background: #d8efe1;
  color: #0d4a2e;
  border-left-color: var(--color-status-done, #2a7a4a);
}

.pm-cat-banner--moderate {
  background: #fdf3d8;
  color: #6d4f0c;
  border-left-color: #d97706;
}

.pm-cat-banner--languishing {
  background: #fce8e6;
  color: #8a1a0e;
  border-left-color: #C04428;
}

.pm-cat-emoji {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.pm-cat-title {
  font-family: var(--font-heading, 'Fraunces', serif);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 4px;
}

.pm-cat-desc {
  font-size: 0.88rem;
  margin: 0;
  line-height: 1.5;
}

/* ── Loneliness card (separata dalle 8 sottoscale grafiche) ───── */
.pm-loneliness-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-bg, #f8f6f1);
  border: 1px dashed var(--color-border, #e5dfd5);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 0 0 22px;
  gap: 12px;
  flex-wrap: wrap;
}

.pm-loneliness-card-label {
  font-size: 0.88rem;
  color: var(--color-text-muted, #6b6259);
}

.pm-loneliness-card-label strong {
  color: var(--color-text, #1a1815);
}

.pm-loneliness-val {
  font-family: var(--font-heading, 'Fraunces', serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: #C04428;
}

.pm-loneliness-val small {
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.6;
}
