:root {
  --color-bg-1: #eaf6f3;
  --color-bg-2: #eef3fb;
  --color-primary: #2f9e8f;
  --color-primary-dark: #237e72;
  --color-text: #263238;
  --color-text-soft: #55666b;
  --color-card: #ffffff;
  --color-border: #dbe7e5;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(38, 50, 56, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background: linear-gradient(160deg, var(--color-bg-1) 0%, var(--color-bg-2) 100%);
  display: flex;
  justify-content: center;
  padding: 24px 16px 48px;
  line-height: 1.5;
}

.app-container {
  width: 100%;
  max-width: 560px;
}

.app-header {
  text-align: center;
  margin-bottom: 20px;
}

.app-header h1 {
  font-size: 1.6rem;
  color: var(--color-primary-dark);
  margin: 0 0 12px;
}

.progress-bar {
  background: rgba(47, 158, 143, 0.15);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-primary);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.progress-label {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--color-text-soft);
}

#app {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}

.screen { display: none; text-align: center; }
.screen.active { display: block; animation: fadeIn 0.3s ease; }

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

.intro-lead { font-size: 1.1rem; }

.disclaimer {
  font-size: 0.85rem;
  color: var(--color-text-soft);
  font-style: italic;
  border-top: 1px solid var(--color-border);
  padding-top: 14px;
  margin-top: 18px;
}

.pilar-icon { font-size: 2.6rem; margin-bottom: 4px; }

#screen-question h2 {
  color: var(--color-primary-dark);
  margin: 0 0 10px;
}

.pilar-question {
  font-weight: 600;
  margin-top: 18px;
}

.scale-wrap { margin: 22px 0 6px; }

.scale-value {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 6px;
}

input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary) 50%, var(--color-border) 50%, var(--color-border) 100%);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  touch-action: pan-y;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  cursor: pointer;
  border: none;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--color-text-soft);
  margin-top: 6px;
}

.question-actions, .result-actions {
  display: flex;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.question-actions { justify-content: space-between; }
.result-actions { flex-direction: column; }

.btn {
  flex: 1;
  min-height: 48px;
  padding: 12px 18px;
  font-size: 1rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.1s ease, background 0.2s ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover { background: var(--color-primary-dark); }

.btn-secondary {
  background: #f1f4f3;
  color: var(--color-text);
}

.btn-secondary:hover { background: #e4e9e8; }

.btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.radar-chart {
  width: 100%;
  height: 340px;
  margin: 12px 0;
}

.score-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 4px;
  text-align: left;
  border-top: 1px solid var(--color-border);
}

.score-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 2px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
}

.score-list li span:last-child {
  font-weight: 700;
  color: var(--color-primary-dark);
}

.pdf-hint {
  font-size: 0.8rem;
  color: var(--color-text-soft);
  margin-top: 12px;
}

@media (min-width: 480px) {
  .question-actions { flex-wrap: nowrap; }
  .result-actions { flex-direction: row; }
}

@media print {
  body { background: #fff; padding: 0; }
  .app-header, #screen-welcome, #screen-question { display: none !important; }
  #app { box-shadow: none; padding: 0; }
  .no-print { display: none !important; }
  .radar-chart { height: 380px; }
}
