/* ═══ FP-CSAT Module ═══ */

/* ─── Banner ─── */
.csat-banner {
  background: linear-gradient(135deg, #0f3460 0%, #1a4a8a 100%);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  animation: csatPulse 3s ease-in-out infinite;
}
@keyframes csatPulse {
  0%, 100% { box-shadow: 0 2px 12px rgba(15,52,96,0.2); }
  50% { box-shadow: 0 4px 20px rgba(15,52,96,0.4); }
}
.csat-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
}
.csat-banner-icon { font-size: 28px; }
.csat-banner-text { flex: 1; color: #fff; }
.csat-banner-text strong { display: block; font-size: 14px; margin-bottom: 2px; }
.csat-banner-text span { display: block; font-size: 12px; opacity: 0.7; }
.csat-banner-btn {
  background: #fff;
  color: #0f3460;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}
.csat-banner-btn:hover { background: #f0f3ff; transform: scale(1.02); }
.csat-banner-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

/* ─── Modal ─── */
.csat-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.csat-modal-inner {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
}
.csat-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: #636e72;
  cursor: pointer;
  z-index: 1;
}

/* ─── Header ─── */
.csat-header {
  background: linear-gradient(135deg, #0f3460 0%, #1a4a8a 100%);
  padding: 28px 32px 20px;
  border-radius: 16px 16px 0 0;
  color: #fff;
}
.csat-header h2 { font-size: 20px; margin: 0 0 4px; font-weight: 700; }
.csat-header p { font-size: 12px; opacity: 0.7; margin: 0 0 16px; }

.csat-progress {
  height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  overflow: hidden;
}
.csat-progress-bar {
  height: 100%;
  background: #00b894;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.csat-progress-label {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 8px;
}

/* ─── Body ─── */
.csat-body { padding: 24px 32px; }

.csat-question {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f0f0f0;
}
.csat-question:last-child { border-bottom: none; margin-bottom: 0; }

.csat-q-num {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #0f3460;
  margin-bottom: 6px;
}
.csat-q-text {
  font-size: 15px;
  font-weight: 600;
  color: #2d3436;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* ─── Slider ─── */
.csat-slider-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.csat-slider {
  flex: 1;
  min-width: 200px;
  -webkit-appearance: none;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #e74c3c 0%, #f39c12 40%, #00b894 100%);
  outline: none;
}
.csat-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--slider-color, #636e72);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  border: 3px solid #fff;
}
.csat-slider[data-unset="true"]::-webkit-slider-thumb {
  background: #b2bec3;
  opacity: 0.5;
}
.csat-slider-value {
  font-size: 32px;
  font-weight: 800;
  color: #0f3460;
  min-width: 44px;
  text-align: center;
  transition: opacity 0.2s;
}
.csat-slider-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 10px;
  color: #b2bec3;
  margin-top: 4px;
}

/* ─── Comment ─── */
.csat-comment-toggle { margin-top: 10px; }
.csat-comment-toggle a { color: #0f3460; font-size: 12px; text-decoration: none; }
.csat-comment-toggle a:hover { text-decoration: underline; }
.csat-comment-box { margin-top: 8px; }
.csat-comment-box textarea {
  width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
  outline: none;
}
.csat-comment-box textarea:focus { border-color: #0f3460; }
.csat-char-count { font-size: 10px; color: #b2bec3; text-align: right; margin-top: 4px; }

/* ─── Textarea (CS-12, CS-13) ─── */
.csat-textarea {
  width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  min-height: 80px;
  outline: none;
}
.csat-textarea:focus { border-color: #0f3460; }
.csat-required-msg {
  background: rgba(243,156,18,0.1);
  border: 1px solid rgba(243,156,18,0.3);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: #8a6d3b;
  margin-bottom: 10px;
}

/* ─── Radio (CS-14) ─── */
.csat-radio-group { display: flex; gap: 12px; }
.csat-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}
.csat-radio input { display: none; }
.csat-radio input:checked + span { color: #0f3460; }
.csat-radio:has(input:checked) { border-color: #0f3460; background: rgba(15,52,96,0.05); }

/* ─── Navigation ─── */
.csat-nav {
  display: flex;
  justify-content: space-between;
  padding: 16px 32px 24px;
}
.csat-nav-btn {
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  border: none;
  transition: all 0.2s;
}
.csat-btn-back { background: #f0f0f0; color: #636e72; }
.csat-btn-back:hover { background: #e0e0e0; }
.csat-btn-next { background: #0f3460; color: #fff; }
.csat-btn-next:hover { background: #1a4a8a; }
.csat-btn-submit { background: #00b894; color: #fff; }
.csat-btn-submit:hover { background: #00a884; }

/* ─── Confirmation ─── */
.csat-confirm {
  text-align: center;
  padding: 60px 40px;
}
.csat-confirm-icon { font-size: 64px; margin-bottom: 20px; }
.csat-confirm h2 { font-size: 24px; color: #2d3436; margin-bottom: 12px; }
.csat-confirm p { font-size: 14px; color: #636e72; line-height: 1.7; margin-bottom: 28px; max-width: 400px; margin-left: auto; margin-right: auto; }

/* ─── Fondatore Dashboard extras ─── */
.csat-alerts { margin-bottom: 20px; }
.csat-alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 8px;
}
.csat-alert small { color: #636e72; margin-left: 8px; }
.csat-alert-critical { background: rgba(231,76,60,0.08); border-left: 3px solid #e74c3c; }
.csat-alert-warning { background: rgba(243,156,18,0.08); border-left: 3px solid #f39c12; }
.csat-alert-info { background: rgba(0,184,148,0.08); border-left: 3px solid #00b894; }

.csat-detail-sections { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
.csat-detail-sec { display: flex; align-items: center; gap: 12px; }
.csat-sec-label { min-width: 180px; font-size: 13px; font-weight: 500; color: #2d3436; }
.csat-sec-bar-wrap { flex: 1; height: 10px; background: #f0f0f0; border-radius: 5px; overflow: hidden; }
.csat-sec-bar { height: 100%; border-radius: 5px; transition: width 0.5s ease; }
.csat-sec-val { min-width: 80px; font-size: 13px; font-weight: 700; color: #2d3436; }

.csat-history-chart { display: flex; gap: 16px; align-items: flex-end; margin-top: 10px; height: 140px; }
.csat-hist-bar { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.csat-hist-fill { width: 50px; border-radius: 4px 4px 0 0; display: flex; align-items: flex-end; justify-content: center; }
.csat-hist-fill span { color: #fff; font-size: 11px; font-weight: 700; padding-bottom: 4px; }
.csat-hist-bar small { font-size: 10px; color: #636e72; }

.csat-client-status { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 8px; }
.csat-cs-item { font-size: 12px; padding: 6px 0; }

.csat-comments-list { margin-top: 8px; }
.csat-comment-item { font-size: 13px; color: #2d3436; padding: 8px 0; border-bottom: 1px solid #f5f5f5; line-height: 1.5; }
.csat-anon-notice { font-size: 11px; color: #b2bec3; font-style: italic; margin-top: 8px; }

/* ─── Mobile ─── */
@media (max-width: 768px) {
  .csat-modal-inner { width: 95%; max-width: none; }
  .csat-header, .csat-body, .csat-nav { padding-left: 20px; padding-right: 20px; }
  .csat-slider-value { font-size: 24px; }
  .csat-radio-group { flex-direction: column; }
  .csat-banner-content { flex-wrap: wrap; }
  .csat-sec-label { min-width: 120px; font-size: 11px; }
}
