/*
  Encuesta de madurez pública (sin login).
  Réplica del react-portal: Survey.tsx + SurveyResults.tsx.
  Namespace propio (.frs-mad-pub) para no pisar .frs-madurez-* del dashboard.
*/

body.frs-mad-pub-body {
  margin: 0;
  background: #2E2117;
  color: #F7F1E7;
  font-family: 'Hanken Grotesk', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.frs-mad-pub {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #2E2117;
}

.frs-mad-pub__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(110% 70% at 80% -10%, rgba(237, 22, 134, 0.22), transparent 58%);
}

.frs-mad-pub__inner {
  position: relative;
  z-index: 1;
  max-width: 896px;
  margin-inline: auto;
  padding: 32px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.frs-mad-pub.is-results .frs-mad-pub__inner { max-width: 1024px; }

/* ---------- Topbar ---------- */

.frs-mad-pub__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.frs-mad-pub__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.frs-mad-pub__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 250, 242, 0.6);
}

.frs-mad-pub__topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.frs-mad-pub__topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(255, 250, 242, 0.55);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.18s ease;
}

.frs-mad-pub__topbar-link:hover,
.frs-mad-pub__topbar-link:focus-visible { color: #F7F1E7; }

/* ---------- Tarjeta papel ---------- */

.frs-mad-pub__card {
  background: #F7F1E7;
  color: #33281F;
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
}

.frs-mad-pub__kicker {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #B3115F;
  margin-bottom: 12px;
}

.frs-mad-pub__title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: #33281F;
}

.frs-mad-pub__lead {
  font-size: 15px;
  line-height: 1.65;
  color: #5C4F42;
  max-width: 42rem;
  margin: 0 0 32px;
}

/* ---------- Progreso ---------- */

.frs-mad-pub__progress-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.frs-mad-pub__track {
  flex: 1;
  height: 8px;
  background: #F0E7DA;
  border-radius: 999px;
  overflow: hidden;
}

.frs-mad-pub__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ED1686 0%, #FF9E19 100%);
  transition: width 0.3s ease;
}

.frs-mad-pub__progress-label {
  font-size: 12px;
  font-weight: 700;
  color: #5C4F42;
  white-space: nowrap;
}

/* ---------- Leyenda de escala ---------- */

.frs-mad-pub__scale {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: #EFE6D6;
  border: 1px solid #E4D6BE;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 32px;
}

.frs-mad-pub__scale-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8C7E6F;
  margin-right: 6px;
}

.frs-mad-pub__scale-item { font-size: 11px; color: #5C4F42; }
.frs-mad-pub__scale-item strong { color: #33281F; }
.frs-mad-pub__scale-dot { color: #D8C9B4; }

/* ---------- Dimensiones y preguntas ---------- */

.frs-mad-pub__dims {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.frs-mad-pub__dim {
  border-top: 1px solid #EEE5D9;
  padding-top: 24px;
}

.frs-mad-pub__dim:first-child {
  border-top: 0;
  padding-top: 0;
}

.frs-mad-pub__dim-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.frs-mad-pub__dim-num {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #2E2117;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.frs-mad-pub__dim-name {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  color: #33281F;
}

.frs-mad-pub__questions {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.frs-mad-pub__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #F2EADD;
  padding-bottom: 16px;
}

.frs-mad-pub__question:last-child { border-bottom: 0; padding-bottom: 0; }

.frs-mad-pub__question-text {
  flex: 1;
  font-size: 14.5px;
  line-height: 1.6;
  color: #40342A;
}

.frs-mad-pub__options {
  display: flex;
  gap: 8px;
  flex: none;
}

.frs-mad-pub__option {
  position: relative;
  cursor: pointer;
}

.frs-mad-pub__option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.frs-mad-pub__option > span:first-of-type {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #E0D2BC;
  background: #EFE6D6;
  color: #8C7E6F;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.frs-mad-pub__option:hover > span:first-of-type {
  border-color: #B3115F;
  color: #B3115F;
}

.frs-mad-pub__option input:focus-visible + span {
  outline: 2px solid #B3115F;
  outline-offset: 2px;
}

.frs-mad-pub__option.is-selected > span:first-of-type {
  background: #ED1686;
  border-color: #ED1686;
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 6px 14px rgba(237, 22, 134, 0.32);
}

/* ---------- Footer de la encuesta ---------- */

.frs-mad-pub__form-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #E4D8C4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.frs-mad-pub__hint {
  margin: 0;
  font-size: 12px;
  color: #A89A88;
}

.frs-mad-pub__hint.is-complete {
  color: #1F6E4A;
  font-weight: 700;
}

.frs-mad-pub__submit {
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 16px 32px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #ED1686 0%, #FF9E19 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(237, 22, 134, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.frs-mad-pub__submit:hover:not([disabled]) {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(237, 22, 134, 0.34);
}

.frs-mad-pub__submit[disabled] {
  background: #E4D8C4;
  color: #8C7E6F;
  box-shadow: none;
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Resultado ---------- */

.frs-mad-pub__result-top,
.frs-mad-pub__result-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.frs-mad-pub__score {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0 0 8px;
}

.frs-mad-pub__score-num {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #2E2117;
}

.frs-mad-pub__score-pct {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 30px;
  font-weight: 700;
  color: #2E2117;
}

.frs-mad-pub__level {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 8px 0 16px;
  color: #33281F;
}

.frs-mad-pub__level-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: #5C4F42;
}

.frs-mad-pub__route {
  position: relative;
  overflow: hidden;
  background: #2E2117;
  color: #F7F1E7;
  border-radius: 16px;
  padding: 24px;
  height: 100%;
}

.frs-mad-pub__route-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(90% 90% at 100% 0%, rgba(237, 22, 134, 0.3), transparent 60%);
}

.frs-mad-pub__route-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}

.frs-mad-pub__route-kicker {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #FF9E19;
  margin-bottom: 12px;
}

.frs-mad-pub__route-name {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
  color: #F7F1E7;
}

.frs-mad-pub__route-copy {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: rgba(255, 250, 242, 0.72);
}

.frs-mad-pub__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ED1686 0%, #FF9E19 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 14px 32px rgba(237, 22, 134, 0.28);
  transition: transform 0.18s ease;
}

.frs-mad-pub__cta:hover { transform: translateY(-2px); }

.frs-mad-pub__divider {
  height: 1px;
  background: #EEE3D5;
  margin: 40px 0;
}

.frs-mad-pub__panel-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 20px;
  color: #33281F;
}

.frs-mad-pub__bars {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.frs-mad-pub__bar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #33281F;
}

.frs-mad-pub__bar-meta strong {
  font-size: 12px;
  font-weight: 700;
  color: #5C4F42;
}

.frs-mad-pub__bar-track {
  height: 8px;
  background: #F0E7DA;
  border-radius: 999px;
  overflow: hidden;
}

.frs-mad-pub__bar-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, #ED1686 0%, #FF9E19 100%);
}

.frs-mad-pub__focos-col {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.frs-mad-pub__focos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.frs-mad-pub__focos li {
  position: relative;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #40342A;
}

.frs-mad-pub__focos li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ED1686;
}

.frs-mad-pub__actions {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #F2EADD;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.frs-mad-pub__btn-solid,
.frs-mad-pub__btn-ghost {
  flex: 1 1 180px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 14px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.16s ease;
}

.frs-mad-pub__btn-solid {
  background: #fff;
  border: 1px solid #E0D2BC;
  color: #33281F;
}

.frs-mad-pub__btn-solid:hover { background: #EFE6D6; }

.frs-mad-pub__btn-ghost {
  background: transparent;
  border: 0;
  color: #B3115F;
}

.frs-mad-pub__btn-ghost:hover { background: #EFE6D6; }

.frs-mad-pub__note {
  margin: 12px 0 0;
  font-size: 12px;
  color: #A89A88;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .frs-mad-pub__result-top,
  .frs-mad-pub__result-bottom { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .frs-mad-pub__inner { padding: 24px 16px 48px; }
  .frs-mad-pub__card { padding: 24px 20px; border-radius: 20px; }
  .frs-mad-pub__question {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .frs-mad-pub__options { width: 100%; }
  .frs-mad-pub__option { flex: 1; }
  .frs-mad-pub__option > span:first-of-type { width: 100%; }
  .frs-mad-pub__form-footer { flex-direction: column; align-items: stretch; }
  .frs-mad-pub__submit { width: 100%; }
  .frs-mad-pub__score-num { font-size: 56px; }
}

/* ---------- Impresión ---------- */

.frs-mad-pub__print { display: none; }

@media print {
  body.frs-mad-pub-body { background: #fff; color: #000; }
  .frs-mad-pub__glow,
  .frs-mad-pub__inner { display: none !important; }
  .frs-mad-pub__print {
    display: block;
    padding: 0;
    color: #000;
    font-size: 12pt;
  }
  .frs-mad-pub__print h1 { font-size: 20pt; margin: 0 0 4pt; }
  .frs-mad-pub__print h2 { font-size: 14pt; margin: 0 0 12pt; color: #ED1686; }
  .frs-mad-pub__print h3 { font-size: 12pt; margin: 16pt 0 6pt; }
  .frs-mad-pub__print ul { margin: 0; padding-left: 18pt; }
}
