/* ColloquiTeam · form.css
   Layout autovalutazione: stepper laterale, form-section,
   rating-table (5 livelli), ruota-table (0-10), textarea, submit-bar. */

.autoval-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
}

/* ── Stepper laterale ── */
.stepper {
  position: sticky;
  top: 84px;
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: 14px 12px;
}
.stepper-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 700;
  padding: 6px 12px 12px;
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 8px;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
  text-decoration: none;
  transition: all .15s ease;
  margin-bottom: 2px;
  border-left: 3px solid transparent;
}
.step-item:hover { background: white; color: var(--ink); }
.step-item.active {
  background: white;
  color: var(--accent);
  font-weight: 700;
  border-left-color: var(--accent);
}
.step-num {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  min-width: 22px;
}
.step-tick {
  margin-left: auto;
  color: var(--sage);
  font-weight: 700;
  font-size: 14px;
  display: none;
}
.step-item.completed .step-tick { display: inline; }

/* ── Section card ── */
.form-section {
  background: white;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: 30px 32px;
  margin-bottom: 22px;
  scroll-margin-top: 84px;
}
.section-head {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule-soft);
}
.section-num {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 28px;
  color: var(--accent);
  letter-spacing: -.02em;
}
.section-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  display: inline-block;
  margin-left: 8px;
  letter-spacing: -.01em;
}
.section-desc {
  font-size: 14px;
  color: var(--ink-soft);
  font-style: italic;
  margin-top: 6px;
}

/* ── Rating table (5 livelli) ── */
.rating-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.rating-table thead th {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-mute);
  padding: 10px 6px 12px;
  text-align: center;
  border-bottom: 1.5px solid var(--rule-soft);
  vertical-align: bottom;
  white-space: nowrap;          /* evita il wrap di "Punto di forza" */
}
.rating-table thead th:first-child { text-align: left; padding-left: 4px; }
.rating-table tbody td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: middle;
}
.rating-table tbody tr:last-child td { border-bottom: none; }
.rating-table tbody td:first-child {
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
  padding-left: 4px;
  padding-right: 14px;
}
.rating-cell { text-align: center; width: 120px; min-width: 110px; }

.rating-cell input { position: absolute; opacity: 0; pointer-events: none; }
.rating-cell label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  cursor: pointer;
  transition: all .12s ease;
  background: white;
}
.rating-cell label:hover { border-color: var(--accent); transform: scale(1.05); }
.rating-cell input:checked + label::after {
  content: "\2713";
  font-size: 14px;
  font-weight: 700;
  color: white;
}
.rating-cell[data-rating="1"] input:checked + label { background: var(--rating-1); border-color: var(--rating-1); }
.rating-cell[data-rating="2"] input:checked + label { background: var(--rating-2); border-color: var(--rating-2); }
.rating-cell[data-rating="3"] input:checked + label { background: var(--rating-3); border-color: var(--rating-3); }
.rating-cell[data-rating="4"] input:checked + label { background: var(--rating-4); border-color: var(--rating-4); }
.rating-cell[data-rating="5"] input:checked + label { background: var(--rating-5); border-color: var(--rating-5); }

.rating-table thead th.col-1 { color: var(--rating-1); }
.rating-table thead th.col-2 { color: var(--rating-2); }
.rating-table thead th.col-3 { color: var(--rating-3); }
.rating-table thead th.col-4 { color: var(--rating-4); }
.rating-table thead th.col-5 { color: var(--rating-5); }

/* ── Sezione "letta dall'autovalutazione utente" (modalità valutazione) ── */
.readonly-banner {
  background: linear-gradient(90deg, var(--accent-soft) 0%, transparent 100%);
  border-left: 3px solid var(--accent);
  padding: 9px 14px;
  margin-bottom: 18px;
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 500;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.readonly-banner b { color: var(--accent); }

.field-textarea[disabled],
.field-textarea.readonly {
  background: var(--paper);
  color: var(--ink-soft);
  cursor: default;
  border-style: dashed;
}
.field-textarea[disabled]:focus,
.field-textarea.readonly:focus {
  box-shadow: none;
  border-color: var(--rule-soft);
}

.form-section.section-readonly .field-label {
  color: var(--ink-soft);
}

/* ── Textarea ── */
.field-label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  margin: 22px 0 4px;
}
.field-hint {
  display: block;
  font-size: 13px;
  color: var(--ink-mute);
  font-style: italic;
  margin-bottom: 8px;
}
.field-textarea {
  width: 100%;
  min-height: 90px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.5;
}
.field-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: white;
}

/* ── Ruota delle performance (0-10) ── */
.ruota-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.ruota-table thead th {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--accent);
  padding: 8px 4px;
  text-align: center;
  border-bottom: 1.5px solid var(--rule-soft);
}
.ruota-table thead th:first-child {
  text-align: left;
  padding-left: 6px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 10px;
}
.ruota-table tbody td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--rule-soft);
  text-align: center;
}
.ruota-table tbody tr:last-child td { border-bottom: none; }
.ruota-table tbody td:first-child {
  text-align: left;
  padding: 10px 6px;
  width: 230px;
}
.macro-name b {
  display: block;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink);
}
.macro-name span {
  display: block;
  font-size: 11.5px;
  color: var(--ink-mute);
  font-style: italic;
  margin-top: 2px;
  line-height: 1.3;
}
.ruota-radio { position: absolute; opacity: 0; pointer-events: none; }
.ruota-radio + label {
  display: inline-block;
  width: 18px; height: 18px;
  border: 1.5px solid var(--rule);
  border-radius: 50%;
  cursor: pointer;
  transition: all .12s ease;
  background: white;
}
.ruota-radio + label:hover { border-color: var(--accent); transform: scale(1.15); }
.ruota-radio:checked + label {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ══════════════════════════════════════════════════════════════════
   Anteprima ruota calcolata (modalità autoval/view).
   Layout: radar grande a sinistra · stack di card a destra,
   una card per macro-area con titolo/sub/valore/barra.
   ══════════════════════════════════════════════════════════════════ */

.ruota-preview-layout {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 28px;
}

/* Radar centrato in alto, max-width per non stiracchiarsi */
.ruota-preview-chart {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: 480px;
  margin: 0 auto;
  padding: 8px;
}
.ruota-preview-chart canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Lista card a 2 colonne sotto al radar */
.ruota-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

@media (max-width: 800px) {
  .ruota-preview { grid-template-columns: 1fr; }
  .ruota-preview-chart { height: 380px; }
}

/* ── Card singola macro-area ── */
.ruota-card {
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  border-left: 3px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 12px 16px 14px;
  transition: border-left-color .25s ease, background .25s ease;
}
.ruota-card.tone-low  { border-left-color: var(--rating-1); }
.ruota-card.tone-mid  { border-left-color: var(--rating-3); }
.ruota-card.tone-good { border-left-color: var(--rating-5); }

.ruota-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}
.ruota-card-text {
  min-width: 0;
  flex: 1;
}
.ruota-card-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -.01em;
  line-height: 1.2;
}
.ruota-card-sub {
  display: block;
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 3px;
  line-height: 1.35;
}

.ruota-card-val {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: var(--accent);
  letter-spacing: -.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.ruota-card-val small {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-mute);
  margin-left: 2px;
}
.ruota-card.tone-low  .ruota-card-val { color: var(--rating-1); }
.ruota-card.tone-mid  .ruota-card-val { color: var(--rating-3); }
.ruota-card.tone-good .ruota-card-val { color: var(--rating-5); }

.ruota-card-bar {
  position: relative;
  height: 8px;
  background: white;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--rule-soft);
}
.ruota-card-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  transition: width .35s ease;
}
.ruota-card.tone-low  .ruota-card-fill { background: linear-gradient(90deg, #F3C9BD, var(--rating-1)); }
.ruota-card.tone-mid  .ruota-card-fill { background: linear-gradient(90deg, #E8D8B8, var(--rating-3)); }
.ruota-card.tone-good .ruota-card-fill { background: linear-gradient(90deg, #B6D3BE, var(--rating-5)); }

/* ── Submit bar sticky in fondo ── */
.submit-bar {
  position: sticky;
  bottom: 0;
  margin: 22px -32px -30px;
  padding: 18px 32px;
  background: white;
  border-top: 1px solid var(--rule-soft);
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  z-index: 5;
}
.submit-bar .submit-meta {
  font-size: 12.5px;
  color: var(--ink-mute);
  font-style: italic;
}
.submit-bar .submit-meta b { color: var(--ink); font-style: normal; font-weight: 600; }
.submit-bar .submit-actions { display: flex; gap: 10px; align-items: center; }

.btn-save-draft {
  background: white;
  color: var(--ink);
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  padding: 10px 18px;
  font-family: inherit;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: all .15s ease;
}
.btn-save-draft:hover { border-color: var(--accent); color: var(--accent); }

.btn-submit {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: .03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .15s ease;
}
.btn-submit:hover { background: var(--accent-dark, #6B2A12); transform: translateY(-1px); }
.btn-submit:disabled {
  background: var(--rule);
  color: var(--ink-mute);
  cursor: not-allowed;
  transform: none;
}
