/* VivePortil · cuestionarios interactivos sobre racismo moderno */

.vp-racismo-quiz {
  --vpq-accent: var(--vp-racismo-accent, #0e9ea5);
  --vpq-accent-dark: var(--vp-racismo-accent-dark, #087e85);
  --vpq-text: var(--vp-racismo-text, #1f2937);
  --vpq-muted: var(--vp-racismo-muted, #64748b);
  --vpq-border: var(--vp-racismo-border, #d9e7e8);
}

.vp-racismo-quiz__header > h2:first-of-type {
  margin-top: 24px;
}

.vp-racismo-quiz__eyebrow,
.vp-racismo-result__eyebrow {
  margin: 0 0 6px !important;
  color: var(--vpq-accent-dark);
  font-size: 13px !important;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.vp-racismo-quiz__notice,
.vp-racismo-quiz__privacy {
  padding: 14px 16px;
  border-radius: 13px;
}

.vp-racismo-quiz__notice {
  border-left: 4px solid #f59e0b;
  background: #fff7ed;
}

.vp-racismo-quiz__privacy {
  border: 1px solid var(--vpq-border);
  background: rgba(255,255,255,.72);
  color: #475569;
  font-size: 15px !important;
}

.vp-racismo-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 24px 0;
}

.vp-racismo-scale span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 72px;
  padding: 10px 8px;
  border: 1px solid var(--vpq-border);
  border-radius: 12px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.vp-racismo-scale strong {
  color: var(--vpq-accent-dark);
  font-size: 20px;
}

.vp-racismo-progress {
  position: sticky;
  top: 84px;
  z-index: 12;
  margin: 0 0 22px;
  padding: 12px 15px;
  border: 1px solid var(--vpq-border);
  border-radius: 14px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 9px 22px rgba(15,23,42,.08);
  backdrop-filter: blur(8px);
}

.vp-racismo-progress__text {
  margin-bottom: 8px;
  color: #475569;
  font-size: 14px;
}

.vp-racismo-progress__track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.vp-racismo-progress__track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--vpq-accent), var(--vpq-accent-dark));
  transition: width .22s ease;
}

.vp-racismo-quiz .vp-racismo-question {
  min-width: 0;
  margin: 0 0 16px;
  padding: 20px;
  border: 1px solid var(--vpq-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(15,23,42,.045);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.vp-racismo-question.is-answered {
  border-color: rgba(14,158,165,.55);
  box-shadow: 0 8px 22px rgba(14,158,165,.10);
}

.vp-racismo-question.has-error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.10);
}

.vp-racismo-question legend {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  margin: 0 0 17px;
  padding: 0;
  color: var(--vpq-text);
  font-size: 17px;
  font-weight: 750;
  line-height: 1.55;
}

.vp-racismo-question__number {
  flex: 0 0 31px;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  margin-top: -2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--vpq-accent), var(--vpq-accent-dark));
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.vp-racismo-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.vp-racismo-options label {
  position: relative;
  display: flex;
  min-width: 0;
  cursor: pointer;
}

.vp-racismo-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.vp-racismo-options label > span {
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.vp-racismo-options label {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 78px;
  padding: 9px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
  text-align: center;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.vp-racismo-options label:hover {
  transform: translateY(-1px);
  border-color: var(--vpq-accent);
  background: #f0fbfb;
}

.vp-racismo-options label:has(input:focus-visible) {
  outline: 3px solid rgba(14,158,165,.28);
  outline-offset: 2px;
}

.vp-racismo-options label:has(input:checked) {
  border-color: var(--vpq-accent-dark);
  background: linear-gradient(135deg, var(--vpq-accent), var(--vpq-accent-dark));
  color: #fff;
  box-shadow: 0 8px 18px rgba(14,158,165,.22);
}

.vp-racismo-option__number {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.vp-racismo-option__label {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.25;
}

.vp-racismo-question__error,
.vp-racismo-form-error {
  color: #b91c1c;
  font-weight: 750;
}

.vp-racismo-question__error {
  margin: 12px 0 0 !important;
  font-size: 14px !important;
}

.vp-racismo-form-error {
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fef2f2;
}

.vp-racismo-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.vp-racismo-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 22px;
  border-radius: 999px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.vp-racismo-button:hover {
  transform: translateY(-2px);
}

.vp-racismo-button--primary {
  border: 0;
  background: linear-gradient(135deg, var(--vpq-accent), var(--vpq-accent-dark));
  color: #fff;
  box-shadow: 0 10px 23px rgba(14,158,165,.22);
}

.vp-racismo-button--secondary {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
}

.vp-racismo-result {
  margin-top: 28px;
  padding: 25px;
  border: 2px solid var(--vpq-accent);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 15px 32px rgba(14,158,165,.12);
  outline: none;
}

.vp-racismo-result__score {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 4px 0 8px;
}

.vp-racismo-result__score strong {
  color: var(--vpq-accent-dark);
  font-size: clamp(42px, 8vw, 62px);
  line-height: 1;
}

.vp-racismo-result__score span {
  color: var(--vpq-muted);
  font-weight: 750;
}

.vp-racismo-result h3 {
  margin: 10px 0 !important;
  color: var(--vpq-text) !important;
}

.vp-racismo-result__review {
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--vp-racismo-soft, #f1f8f8);
  font-weight: 750;
}

.vp-racismo-result__disclaimer {
  margin-bottom: 0 !important;
  color: var(--vpq-muted);
  font-size: 14px !important;
}

.vp-racismo-quiz [hidden] {
  display: none !important;
}

@media (max-width: 768px) {
  .vp-racismo-scale {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .vp-racismo-scale span {
    flex-direction: row;
    align-items: center;
    min-height: 0;
    padding: 7px 10px;
    text-align: left;
  }

  .vp-racismo-scale strong {
    width: 26px;
    font-size: 17px;
  }

  .vp-racismo-progress {
    position: static;
  }

  .vp-racismo-options {
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
  }

  .vp-racismo-options label {
    min-height: 54px;
    padding: 8px 4px;
  }

  .vp-racismo-option__number {
    font-size: 20px;
  }

  .vp-racismo-option__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .vp-racismo-actions {
    flex-direction: column;
  }

  .vp-racismo-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vp-racismo-progress__track span,
  .vp-racismo-question,
  .vp-racismo-options label,
  .vp-racismo-button {
    transition: none;
  }
}
