/* 
 * Choicer v4.2 - Stylesheet
 * Palette "Azione Rapida"
 * Design per decisioni immediate e consapevoli
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* PALETTE AZIONE RAPIDA */
  --blue-electric: #2563EB;
  --blue-light: #3B82F6;
  --orange-vivid: #FF8A3D;
  --orange-light: #FFB84D;
  --white-pure: #FFFFFF;
  --gray-dark: #111827;
  --gray-medium: #6B7280;
  
  /* Alias semantici */
  --primary: var(--blue-electric);
  --primary-medium: var(--blue-light);
  --accent: var(--orange-vivid);
  --accent-light: var(--orange-light);
  --bg-main: #F9FAFB;
  --text-primary: var(--gray-dark);
  --text-secondary: var(--gray-medium);
  --bg-card: rgba(255, 255, 255, 0.98);
}

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--bg-main) 0%, #E8ECF1 50%, var(--bg-main) 100%);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
  padding: 2rem 1rem;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 2rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

.header::before {
  content: '';
  position: absolute;
  top: -150px;
  right: -150px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08), transparent);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.logo-circle {
  width: 120px;
  height: 120px;
  background: white;
  border-radius: 50%;
  padding: 1.2rem;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-text-img {
  height: 100px;
  object-fit: contain;
}

.logo-text {
  font-size: 4rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.tagline {
  color: var(--text-secondary);
  font-size: 1.5rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

/* Progress Bar */
.progress-container {
  max-width: 1200px;
  margin: 0 auto 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.progress-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: white;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
  border: 3px solid transparent;
}

.progress-step.active .progress-circle {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: var(--gray-dark);
  box-shadow: 0 8px 20px rgba(255, 138, 61, 0.3);
  transform: scale(1.15);
  border-color: var(--accent);
}

.progress-step.completed .progress-circle {
  background: var(--primary-medium);
  color: white;
  border-color: var(--primary-medium);
}

.progress-label {
  font-size: 0.8rem;
  margin-top: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

.progress-step.active .progress-label {
  color: var(--accent);
  font-weight: 700;
}

.progress-step.completed .progress-label {
  color: var(--primary-medium);
}

.progress-line {
  height: 4px;
  flex: 1;
  background: #D1D5DB;
  margin: 0 0.5rem;
  border-radius: 2px;
  transition: background 0.4s ease;
  position: relative;
  top: -28px;
}

.progress-step.completed + .progress-line {
  background: var(--primary-medium);
}

/* Main Container */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.app-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: 32px;
  padding: 3rem;
  box-shadow: 0 20px 60px rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Step Content */
.step-content {
  display: none;
}

.step-content.active {
  display: block;
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Centered */
.section-centered {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.section-title-xl {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  font-weight: 400;
}

/* Category Grid Large */
.category-grid-large {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.category-btn {
  padding: 2rem 1.5rem;
  border-radius: 24px;
  border: 3px solid transparent;
  background: white;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
  text-align: center;
}

.category-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
  border-color: var(--primary-medium);
}

.category-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: var(--gray-dark);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(255, 138, 61, 0.3);
  border-color: var(--accent);
}

.category-emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.category-btn div {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.category-btn.active div {
  color: var(--gray-dark);
  font-weight: 700;
}

/* Choices List Large */
.choices-list-large {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.choice-item-large {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: white;
  padding: 1.5rem;
  border-radius: 20px;
  border: 2px solid #D1D5DB;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.05);
}

.choice-item-large:hover {
  border-color: var(--primary-medium);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.12);
}

.choice-item-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-medium), var(--primary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.choice-item-input-large {
  flex: 1;
  background: var(--bg-main);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  border: 2px solid transparent;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.choice-item-input-large:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
}

.choice-item-remove-large {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: none;
  border: 2px solid #EF4444;
  color: #EF4444;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.choice-item-remove-large:hover {
  background: #EF4444;
  color: white;
  transform: rotate(90deg);
}

/* Criteria List Large */
.criteria-list-large {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.criterion-item-large {
  background: white;
  padding: 2rem;
  border-radius: 24px;
  border: 2px solid #D1D5DB;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.05);
}

.criterion-item-large:hover {
  border-color: var(--primary-medium);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.12);
}

.criterion-header-large {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.criterion-name-large {
  flex: 1;
  min-width: 200px;
  background: var(--bg-main);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  border: 2px solid transparent;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.criterion-name-large:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
}

/* Toggle Pro/Contro */
.criterion-polarity-toggle {
  display: flex;
  gap: 4px;
  background: #F3F4F6;
  padding: 4px;
  border-radius: 20px;
  margin: 0 0.75rem;
}

.polarity-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
  color: #6B7280;
}

.polarity-btn:hover {
  background: #E5E7EB;
}

.polarity-btn.active {
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.polarity-btn.active:first-child {
  background: #10B981;
}

.polarity-btn.active:last-child {
  background: #EF4444;
}

.criterion-actions-large {
  display: flex;
  gap: 0.75rem;
}

.icon-btn-large {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: white;
  border: 2px solid #D1D5DB;
  color: var(--primary-medium);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.icon-btn-large:hover {
  background: var(--primary-medium);
  color: white;
  border-color: var(--primary-medium);
  transform: scale(1.1);
}

.icon-btn-large.remove {
  border-color: #EF4444;
  color: #EF4444;
}

.icon-btn-large.remove:hover {
  background: #EF4444;
  color: white;
}

.icon-btn-large.edit {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-btn-large.edit:hover {
  background: var(--accent);
  color: white;
}

/* Weight Slider Large */
.weight-control-large {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.weight-label-large {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 600;
  min-width: 100px;
}

.weight-value-large {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.3rem;
}

.weight-slider-large {
  flex: 1;
  height: 12px;
  background: linear-gradient(to right, #D1D5DB, var(--primary-medium));
  border-radius: 20px;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  position: relative;
}

.weight-slider-large::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 4px 12px rgba(255, 138, 61, 0.35);
  border: 4px solid white;
  transition: all 0.2s ease;
}

.weight-slider-large::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(255, 138, 61, 0.45);
}

.weight-slider-large::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.05);
}

.weight-slider-large::-moz-range-thumb {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 4px 12px rgba(255, 138, 61, 0.35);
  border: 4px solid white;
  transition: all 0.2s ease;
}

.weight-slider-large::-moz-range-thumb:hover {
  transform: scale(1.15);
}

/* Info Box */
.info-box {
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
  border: 2px solid var(--primary-medium);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  text-align: left;
}

.info-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.info-text {
  color: var(--text-primary);
  line-height: 1.6;
}

.info-text strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

/* Evaluation Card */
.evaluation-progress {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-weight: 600;
}

.evaluation-card {
  background: white;
  border-radius: 32px;
  padding: 3rem;
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.1);
  border: 2px solid #D1D5DB;
}

.evaluation-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  margin-bottom: 3rem;
  background: linear-gradient(135deg, var(--primary-medium), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.evaluation-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 3rem;
}

.evaluation-item {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.evaluation-criterion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.evaluation-criterion-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.evaluation-criterion-weight {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.evaluation-criterion-weight .weight-value {
  color: var(--accent);
  font-weight: 700;
}

.evaluation-rating-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.evaluation-rating-btn {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  border: 3px solid #D1D5DB;
  background: white;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.evaluation-rating-btn:hover {
  transform: translateY(-4px);
  border-color: var(--primary-medium);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15);
}

.evaluation-rating-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: var(--gray-dark);
  border-color: var(--accent);
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 8px 24px rgba(255, 138, 61, 0.3);
}

.evaluation-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

/* Buttons */
.btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 16px;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-transform: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn-large {
  padding: 1.25rem 3rem;
  font-size: 1.15rem;
}

.btn-orange {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: var(--gray-dark);
}

.btn-orange:hover {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
}

.btn-blue {
  background: linear-gradient(135deg, var(--primary-medium), var(--primary));
  color: white;
}

.btn-purple {
  background: linear-gradient(135deg, #8B5CF6, #7C3AED);
  color: white;
}

.btn-green {
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
}

.btn-gray {
  background: #E5E7EB;
  color: var(--text-primary);
}

.btn-outline {
  background: white;
  color: var(--primary-medium);
  border: 3px solid var(--primary-medium);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--primary-medium);
  color: white;
}

.step-actions-center {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
}

.step-actions-spaced {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Results */
.results-container {
  background: white;
  border-radius: 32px;
  padding: 3rem;
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.1);
  border: 2px solid #D1D5DB;
  margin-bottom: 3rem;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.section-title-large {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.title-icon {
  color: var(--accent);
  width: 40px;
  height: 40px;
}

/* Chart Toggle */
.chart-toggle {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-main);
  padding: 0.5rem;
  border-radius: 16px;
}

.chart-toggle-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-toggle-btn:hover {
  background: white;
  color: var(--primary-medium);
}

.chart-toggle-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: var(--gray-dark);
  box-shadow: 0 4px 12px rgba(255, 138, 61, 0.3);
}

/* Main Chart */
.main-chart-container {
  margin-bottom: 3rem;
  background: var(--bg-main);
  padding: 2rem;
  border-radius: 24px;
  min-height: 450px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mainChart {
  max-height: 450px;
  width: 100% !important;
  height: auto !important;
}

/* Winner Card */
.winner-card {
  background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
  border: 3px solid #10B981;
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
}

.winner-card p {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.winner-name {
  color: #059669;
}

/* Breakdown */
.breakdown-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin: 3rem 0 2rem;
}

.breakdown-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.breakdown-card {
  background: white;
  border-radius: 24px;
  padding: 2rem;
  border: 2px solid #D1D5DB;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.06);
}

.breakdown-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.12);
}

.breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.breakdown-title-small {
  font-size: 1.3rem;
  font-weight: 700;
}

.breakdown-percentage {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Barra orizzontale segmentata */
.breakdown-bar-container {
  margin-bottom: 1.5rem;
  background: var(--bg-main);
  border-radius: 20px;
  overflow: hidden;
  height: 48px;
  display: flex;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
}

.breakdown-bar-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  position: relative;
}

.breakdown-bar-segment:first-child {
  border-radius: 20px 0 0 20px;
}

.breakdown-bar-segment:last-child {
  border-radius: 0 20px 20px 0;
}

.breakdown-bar-segment:hover {
  filter: brightness(1.1);
  transform: scaleY(1.05);
  z-index: 1;
}

.breakdown-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.breakdown-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-main);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.breakdown-detail-item:hover {
  background: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.breakdown-detail-name {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
}

.breakdown-detail-value {
  color: var(--text-primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Barra racchette (6 livelli) */
.racket-bar {
  display: flex;
  gap: 3px;
  align-items: center;
}

.racket-segment {
  width: 8px;
  height: 24px;
  background: #E5E7EB;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.racket-segment.filled {
  background: currentColor;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.quote {
  text-align: center;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 1.2rem;
  margin-top: 2rem;
  font-weight: 500;
}

/* Feedback */
.section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.feedback-group {
  margin-bottom: 2rem;
}

.feedback-label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.rating-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.feedback-rating-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid #D1D5DB;
  background: white;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.feedback-rating-btn:hover {
  transform: scale(1.1);
  border-color: var(--primary-medium);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.feedback-rating-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: var(--gray-dark);
  border-color: var(--accent);
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(255, 138, 61, 0.3);
}

.feedback-textarea {
  width: 100%;
  padding: 1.25rem;
  background: white;
  border: 2px solid #D1D5DB;
  border-radius: 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  transition: all 0.3s ease;
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(255, 138, 61, 0.15);
}

.feedback-textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.feedback-sent {
  margin-top: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
  border: 3px solid #10B981;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
}

.feedback-sent p {
  font-size: 1.3rem;
  font-weight: 700;
  color: #059669;
}

/* Popup */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(37, 99, 235, 0.75);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.popup-card {
  background: white;
  border-radius: 32px;
  padding: 3rem;
  max-width: 550px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(37, 99, 235, 0.3);
  border: 3px solid var(--accent);
  animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.popup-title-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.popup-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(255, 138, 61, 0.3);
}

.popup-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  word-break: break-word;
}

.popup-close {
  width: 44px;
  height: 44px;
  background: var(--bg-main);
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.popup-close:hover {
  background: var(--primary-medium);
  color: white;
  transform: rotate(90deg);
}

.popup-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.popup-description-box {
  background: var(--bg-main);
  border-radius: 16px;
  padding: 1.5rem;
  border: 2px solid #D1D5DB;
}

.popup-description {
  color: var(--text-primary);
  font-size: 1.05rem;
  line-height: 1.7;
}

.popup-question-box {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 1.5rem;
}

.popup-question-label {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.popup-question {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Custom Criterion Form */
.custom-criterion-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.custom-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 1rem 0.5rem;
  }

  .app-card {
    padding: 2rem 1.5rem;
    border-radius: 24px;
  }

  .section-title-xl {
    font-size: 1.8rem;
  }

  .section-subtitle {
    font-size: 1rem;
  }

  .category-grid-large {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .category-btn {
    padding: 1.5rem 1rem;
  }

  .category-emoji {
    font-size: 2.5rem;
  }

  .logo-circle {
    width: 70px;
    height: 70px;
  }

  .logo-text-img {
    height: 60px;
  }

  .logo-text {
    font-size: 2.8rem;
  }

  .progress-circle {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }

  .progress-label {
    font-size: 0.7rem;
  }

  .evaluation-card {
    padding: 2rem 1.5rem;
  }

  .evaluation-title {
    font-size: 1.8rem;
  }

  /* MOBILE: Rating 3+3 */
  .evaluation-rating-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    max-width: 300px;
    margin: 0 auto;
  }

  .evaluation-rating-btn {
    width: 100%;
    height: 56px;
    font-size: 1.2rem;
  }

  .btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
  }

  /* MOBILE: Pulsanti stack verticale */
  .evaluation-navigation {
    flex-direction: column;
    align-items: center;
  }

  .evaluation-navigation .btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }

  .step-actions-spaced {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  /* FIX: Centra breakdown cards */
  .breakdown-container {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .breakdown-card {
    margin: 0 auto;
    max-width: 100%;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .chart-toggle {
    width: 100%;
    flex-direction: column;
  }

  .chart-toggle-btn {
    width: 100%;
    justify-content: center;
  }

  .popup-card {
    padding: 2rem 1.5rem;
  }

  .popup-title {
    font-size: 1.3rem;
  }

  /* MOBILE: Grafici più grandi */
  .main-chart-container {
    padding: 1rem 0.5rem;
    min-height: 350px;
    margin: 0 -0.5rem 3rem;
  }

  #mainChart {
    max-height: 350px !important;
  }

  .results-container {
    padding: 2rem 1rem;
  }

  /* Barra orizzontale mobile */
  .breakdown-bar-container {
    height: 40px;
    margin: 0 -0.5rem 1.5rem;
    border-radius: 12px;
  }

  .breakdown-bar-segment {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
   .category-grid-large {
    grid-template-columns: repeat(2, 1fr) !important;
    display: grid !important;
  }
  
  .choice-item-number {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .choice-item-input-large {
    font-size: 1rem;
    padding: 0.875rem 1.25rem;
  }

  .criterion-name-large {
    font-size: 1rem;
    padding: 0.875rem 1.25rem;
  }

  .icon-btn-large {
    width: 40px;
    height: 40px;
  }

  .weight-control-large {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .weight-label-large {
    min-width: auto;
    text-align: center;
  }

  .section-title-xl {
    font-size: 1.6rem;
  }

  .category-grid-large {
    grid-template-columns: 1fr;
  }

  .choice-item-large,
  .criterion-item-large {
    padding: 1rem;
    flex-wrap: wrap;
  }

  .choice-item-input-large,
  .criterion-name-large {
    font-size: 0.95rem;
    min-width: 0;
    flex: 1 1 100%;
  }

  .choice-item-remove-large,
  .icon-btn-large {
    flex-shrink: 0;
  }

  /* Polarity toggle mobile */
  .criterion-header-large {
    flex-direction: column;
    align-items: stretch;
  }

  .criterion-polarity-toggle {
    order: 2;
    width: 100%;
    margin: 1rem 0 0 0;
    justify-content: center;
  }

  .criterion-actions-large {
    order: 3;
    justify-content: center;
    margin-top: 0.5rem;
  }

  .criterion-name-large {
    order: 1;
  }
}
/**
 * ================================
 * CHOICER v4.3 - CSS ADDITIONS
 * ================================
 * AGGIUNGI QUESTE REGOLE AL TUO style.css ESISTENTE
 */

/* ================================
   iOS TOGGLE SWITCH (Pro/Contro)
   ================================ */

.criterion-polarity-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0.75rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #10B981;
  transition: 0.4s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #EF4444;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  user-select: none;
}

/* ================================
   LOGO LARGER SIZE (+30%)
   ================================ */

.logo-circle {
  width: 120px !important;  /* era 90px */
  height: 120px !important;
}

.logo-text-img {
  height: 100px !important;  /* era 80px circa */
}

.logo-text {
  font-size: 4rem !important;  /* era 3rem */
}

/* Hero logo anche */
.hero-logo-img {
  width: 150px !important;
  height: 150px !important;
}

/* ================================
   BREAKDOWN BAR FIX (no spazi vuoti)
   ================================ */

.breakdown-bar-container {
  margin-bottom: 1.5rem;
  background: var(--bg-main);
  border-radius: 20px;
  overflow: hidden;
  height: 48px;
  display: flex;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
}

.breakdown-bar-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  position: relative;
  flex-shrink: 0; /* FIX: Previene spazi vuoti */
}

.breakdown-bar-segment:first-child {
  border-radius: 20px 0 0 20px;
}

.breakdown-bar-segment:last-child {
  border-radius: 0 20px 20px 0;
}

.breakdown-bar-segment:only-child {
  border-radius: 20px;
}

.breakdown-bar-segment:hover {
  filter: brightness(1.1);
  transform: scaleY(1.05);
  z-index: 1;
}

/* ================================
   RACKET BAR IMPROVEMENTS
   ================================ */

.racket-bar {
  display: flex;
  gap: 3px;
  align-items: center;
  margin-left: 0.5rem;
}

.racket-segment {
  width: 8px;
  height: 24px;
  background: #E5E7EB;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.racket-segment.filled {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ================================
   ANIMATIONS
   ================================ */

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ================================
   FEATURE BUTTONS
   ================================ */

.btn-purple {
  background: linear-gradient(135deg, #8B5CF6, #7C3AED);
  color: white;
}

.btn-purple:hover {
  background: linear-gradient(135deg, #7C3AED, #6D28D9);
}

/* ================================
   MOBILE ADJUSTMENTS
   ================================ */

@media (max-width: 768px) {
  .toggle-switch {
    width: 48px;
    height: 26px;
  }
  
  .toggle-slider:before {
    height: 20px;
    width: 20px;
  }
  
  .toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
  }
  
  .criterion-polarity-toggle {
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 1rem 0 0 0;
  }
  
  .toggle-label {
    font-size: 0.85rem;
  }
  
  .breakdown-bar-container {
    height: 40px;
    margin: 0 -0.5rem 1.5rem;
    border-radius: 12px;
  }
  
  .breakdown-bar-segment {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .logo-circle {
    width: 90px !important;
    height: 90px !important;
  }
  
  .logo-text-img {
    height: 70px !important;
  }
  
  .logo-text {
    font-size: 3rem !important;
  }
}
/**
 * ================================
 * CHOICER v4.3 FINAL - CSS ADDITIONS
 * ================================
 * AGGIUNGI QUESTE REGOLE AL TUO style.css ESISTENTE
 */

/* ================================
   STEP 0: DECISION QUESTION
   ================================ */

.decision-question-input {
  width: 100%;
  padding: 1.5rem;
  background: white;
  border: 3px solid #D1D5DB;
  border-radius: 20px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  font-family: inherit;
  resize: vertical;
  transition: all 0.3s ease;
  margin-bottom: 0.75rem;
}

.decision-question-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(255, 138, 61, 0.15);
  background: white;
}

.decision-question-input::placeholder {
  color: #9CA3AF;
  font-weight: 500;
}

.question-input-container {
  max-width: 700px;
  margin: 0 auto 3rem;
}

.question-hint {
  display: block;
  color: var(--gray);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
}

/* ================================
   TOGGLE PULITO (no emoji/scritta)
   ================================ */

.criterion-polarity-toggle {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 0.75rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #10B981;
  transition: 0.4s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #EF4444;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* NO più label/emoji visibili */
.toggle-label {
  display: none;
}

/* ================================
   SMALL WARNINGS (Bias + Choices/Criteria)
   ================================ */

.small-warning {
  position: fixed;
  top: 90px;
  right: 20px;
  background: #FEF3C7;
  border: 2px solid #F59E0B;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #92400E;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
  animation: slideIn 0.3s ease;
  max-width: 300px;
  transition: all 0.3s ease;
}

.small-warning:hover {
  background: #FDE68A;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3);
}

/* ================================
   MOBILE FLUIDITY
   ================================ */

/* Smooth transitions everywhere */
* {
  transition: background-color 0.3s ease, 
              border-color 0.3s ease, 
              transform 0.3s ease,
              opacity 0.3s ease;
}

/* Larger touch targets mobile */
@media (max-width: 768px) {
  .evaluation-rating-btn {
    width: 100%;
    min-height: 64px;
    font-size: 1.5rem;
    border-radius: 16px;
  }
  
  .evaluation-rating-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 100%;
    margin: 0;
  }
  
  .evaluation-item {
    padding: 1.5rem 1rem;
    margin-bottom: 2rem;
  }
  
  .evaluation-criterion-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }
  
  .evaluation-criterion-name {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #E5E7EB;
    width: 100%;
  }
  
  .evaluation-criterion-weight {
    font-size: 1rem;
  }
  
  /* Smooth scrolling */
  html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Remove tap highlight */
  * {
    -webkit-tap-highlight-color: transparent;
  }
}

/* ================================
   BREAKDOWN BAR FIX (12 colors)
   ================================ */

.breakdown-bar-container {
  margin-bottom: 1.5rem;
  background: var(--bg-main);
  border-radius: 20px;
  overflow: hidden;
  height: 48px;
  display: flex;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.08);
}

.breakdown-bar-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  position: relative;
  flex-shrink: 0;
  min-width: 1%; /* Prevent collapsing */
}

.breakdown-bar-segment:first-child {
  border-radius: 20px 0 0 20px;
}

.breakdown-bar-segment:last-child {
  border-radius: 0 20px 20px 0;
}

.breakdown-bar-segment:only-child {
  border-radius: 20px;
}

.breakdown-bar-segment:hover {
  filter: brightness(1.1);
  transform: scaleY(1.05);
  z-index: 1;
}

/* ================================
   HISTORY IMPROVEMENTS
   ================================ */

.history-item:hover {
  background: white !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

.icon-btn-small {
  transition: all 0.3s ease;
}

/* ================================
   ANIMATIONS
   ================================ */

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ================================
   MOBILE RESPONSIVE (480px)
   ================================ */

@media (max-width: 480px) {
  .decision-question-input {
    font-size: 1rem;
    padding: 1.25rem;
  }
  
  .small-warning {
    font-size: 0.8rem;
    padding: 0.6rem 0.85rem;
    max-width: 250px;
  }
  
  .toggle-switch {
    width: 48px;
    height: 26px;
  }
  
  .toggle-slider:before {
    height: 20px;
    width: 20px;
  }
  
  .toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
  }
  
  .evaluation-rating-btn {
    min-height: 56px;
    font-size: 1.3rem;
  }
  
  .breakdown-bar-container {
    height: 40px;
    margin: 0 -0.5rem 1.5rem;
    border-radius: 12px;
  }
  
  .breakdown-bar-segment {
    font-size: 0.75rem;
  }
}
@media (max-width: 768px) {
  .breakdown-container {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }
  
  .breakdown-card {
    width: 100%;
  }
  
  .breakdown-bar-container {
    border-radius: 16px;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Language Switcher */
.lang-switcher {
  position: fixed;
  top: 20px;
  right: 150px;
  z-index: 99;
  display: flex;
  gap: 0.5rem;
  background: white;
  padding: 0.5rem;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.lang-btn {
  width: 48px;
  height: 48px;
  border: 2px solid transparent;
  background: transparent;
  border-radius: 12px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-btn:hover {
  background: #F3F4F6;
  transform: scale(1.05);
}

.lang-btn.active {
  border-color: #2563EB;
  background: #EFF6FF;
}

@media (max-width: 768px) {
  .lang-switcher {
    top: 10px;
    right: 10px;
  }
  
  .lang-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

/* ================================
   DARK MODE PREPARATION (future)
   ================================ */

@media (prefers-color-scheme: dark) {
  /* Placeholder for future dark mode */
  /* Uncomment when implementing:
  
  body {
    background: #111827;
    color: #F9FAFB;
  }
  
  .app-card {
    background: rgba(31, 41, 55, 0.95);
  }
  
  */
}
