/* ============================================================
   MODAL + BOTÓN FLOTANTE - CONCURSO DE MURALES
   Campaña contra la violencia hacia la mujer (25N), en fucsia para
   diferenciarse a simple vista del Teatro (naranja).
   Archivo nuevo e independiente: no modifica estilos existentes.
   Contraparte de concurso-grupo.css (Teatro): se muestra SOLO a
   usuarios cuyo id_dependecia NO esté en la lista de Oficinas
   Administrativas (ver js/concurso-murales.js). Nunca se muestran
   los dos a la vez.
   ============================================================ */

.cm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(24, 10, 26, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cm-overlay.cm-show {
  opacity: 1;
  visibility: visible;
}

.cm-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 460px;
  max-height: min(88vh, 680px);
  overflow: hidden;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  transform: translateY(24px) scale(0.96);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.32s ease;
}

.cm-overlay.cm-show .cm-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.cm-modal-header {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  padding: 26px 28px 50px;
  color: #fff;
  background: linear-gradient(135deg, #a21caf 0%, #701a75 100%);
}

.cm-modal-header::after {
  position: absolute;
  right: -40px;
  bottom: -70px;
  width: 170px;
  aspect-ratio: 1;
  content: "";
  border: 1px solid rgba(232, 121, 249, 0.32);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(232, 121, 249, 0.07), 0 0 0 36px rgba(232, 121, 249, 0.04);
}

.cm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #fff;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.14);
  border: none;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  transition: background 0.2s ease, transform 0.2s ease;
}

.cm-close:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: rotate(90deg);
}

.cm-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 6px 12px;
  color: #fae8ff;
  background: rgba(232, 121, 249, 0.2);
  border-radius: 30px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.cm-modal-header h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.cm-modal-header h2 span {
  color: #f0abfc;
}

.cm-modal-header p {
  margin: 0;
  max-width: 340px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13.5px;
  font-style: italic;
  line-height: 1.6;
}

.cm-modal-body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  margin-top: -30px;
  padding: 0 24px 24px;
  overflow-y: auto;
}

.cm-pending {
  margin: 0 0 18px;
  padding: 14px 16px;
  color: #701a75;
  background: #fdf4ff;
  border: 1px dashed #f0abfc;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.6;
}

.cm-section {
  margin: 0 0 18px;
  padding: 16px;
  background: #fff;
  border: 1px solid #f5d0fe;
  border-radius: 12px;
}

.cm-section h3 {
  margin: 0 0 8px;
  color: #a21caf;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.cm-section p {
  margin: 0 0 8px;
  color: #44403c;
  font-size: 12.5px;
  line-height: 1.65;
}

.cm-section p:last-child {
  margin-bottom: 0;
}

.cm-section ul {
  margin: 0;
  padding: 0 0 0 18px;
  color: #44403c;
  font-size: 12.5px;
  line-height: 1.7;
}

.cm-section ul li {
  margin-bottom: 6px;
}

.cm-section ul li:last-child {
  margin-bottom: 0;
}

.cm-eval-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #fdf4ff;
  font-size: 12px;
}

.cm-eval-row:last-child {
  border-bottom: none;
  padding-top: 9px;
  margin-top: 3px;
  border-top: 2px solid #f0abfc;
  font-weight: 800;
  color: #701a75;
}

.cm-eval-row span:first-child {
  color: #57534e;
}

.cm-eval-row:last-child span:first-child {
  color: #701a75;
}

.cm-eval-row span:last-child {
  flex: 0 0 auto;
  font-weight: 700;
  color: #a21caf;
}

.cm-dontshow {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 16px;
  color: #57534e;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}

.cm-dontshow input {
  margin-top: 2px;
  accent-color: #a21caf;
  cursor: pointer;
}

.cm-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cm-btn-primary,
.cm-btn-ghost {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cm-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #a21caf, #701a75);
  border: none;
  box-shadow: 0 10px 24px rgba(162, 28, 175, 0.35);
}

.cm-btn-primary:hover {
  box-shadow: 0 14px 30px rgba(162, 28, 175, 0.45);
  transform: translateY(-2px);
}

.cm-btn-ghost {
  flex: 0 0 auto;
  color: #701a75;
  background: #fff;
  border: 1px solid #f5d0fe;
}

.cm-btn-ghost:hover {
  background: #fdf4ff;
  border-color: #f0abfc;
}

/* ---------------- BOTÓN FLOTANTE ---------------- */
/* Mismo lugar que el del Teatro (noticias 65-125px, hackatón 140-258px):
   nunca coinciden en pantalla porque son mutuamente excluyentes por dependencia. */
.cm-fab {
  position: fixed;
  right: 24px;
  bottom: 280px;
  z-index: 9400;
  display: none;
  flex-direction: row-reverse;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.cm-fab.cm-fab-visible {
  display: inline-flex;
  animation: cm-fab-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.cm-fab-circle-wrap {
  position: relative;
  flex: 0 0 auto;
  /* Deja espacio debajo del medallón para el listón y el texto inferior */
  padding-bottom: 100px;
}

.cm-fab-tag {
  position: absolute;
  top: -46px;
  left: 50%;
  z-index: 3;
  width: 112px;
  padding: 6px 8px;
  color: #fff;
  background: linear-gradient(135deg, #e879f9, #a21caf);
  border-radius: 10px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: normal;
  box-shadow: 0 6px 16px rgba(162, 28, 175, 0.5);
  transform: translateX(-50%) rotate(-4deg);
  animation: cm-tag-wiggle 2.6s ease-in-out infinite;
}

/* Texto inferior, debajo del listón: completa el mensaje de la etiqueta de arriba. */
.cm-fab-caption {
  position: absolute;
  top: 168px;
  left: 50%;
  z-index: 1;
  width: 132px;
  padding: 5px 9px;
  color: #701a75;
  background: #fff;
  border-radius: 8px;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
  transform: translateX(-50%);
}

.cm-fab-spark {
  position: absolute;
  top: -2px;
  right: -2px;
  z-index: 3;
  width: 22px;
  height: 22px;
  background: #ff3b3b;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(255, 59, 59, 0.9);
  animation: cm-spark-pulse 1.4s ease-in-out infinite;
}

.cm-fab-ring {
  /* Tamaño fijo (no "inset") para que no se estire con el padding-bottom
     del listón: debe rodear solo el medallón, no todo el bloque. */
  position: absolute;
  top: -12px;
  left: -12px;
  width: 142px;
  height: 142px;
  z-index: 0;
  border: 3px dashed rgba(232, 121, 249, 0.75);
  border-radius: 50%;
  animation: cm-ring-spin 7s linear infinite;
}

/* Colas del listón fucsia: nacen casi del mismo punto, detrás del pincel,
   y se abren en V hacia abajo como una cinta de tela real (no dos bloques). */
.cm-fab-ribbon-tail {
  position: absolute;
  top: 80px;
  left: 49px;
  z-index: 0;
  width: 20px;
  height: 84px;
  background: linear-gradient(180deg, #f0abfc, #c026d3 55%, #86198f);
  clip-path: polygon(0 0, 100% 0, 100% 80%, 50% 100%, 0 80%);
  box-shadow:
    inset 3px 0 5px -1px rgba(255, 255, 255, 0.4),
    inset -3px 0 5px -1px rgba(0, 0, 0, 0.25),
    0 10px 16px rgba(112, 26, 117, 0.4);
  /* Ambas colas comparten el mismo punto de origen (centrado, debajo del
     pincel) y solo se separan al girar, como una cinta real de un solo nudo. */
  transform-origin: top center;
}

.cm-fab-ribbon-tail-left {
  transform: rotate(-22deg);
}

.cm-fab-ribbon-tail-right {
  transform: rotate(22deg);
}

.cm-fab-circle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 118px;
  height: 118px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #f0abfc, #d946ef 55%, #86198f);
  border: 5px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  font-size: 54px;
  box-shadow: 0 18px 46px rgba(134, 25, 143, 0.6), 0 0 0 8px rgba(232, 121, 249, 0.22);
  cursor: pointer;
  animation: cm-bounce 2.6s ease-in-out infinite, cm-glow 1.8s ease-in-out infinite;
}

.cm-fab-circle > span {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.25));
}

.cm-fab-circle::before,
.cm-fab-circle::after {
  position: absolute;
  inset: 0;
  content: "";
  border: 3px solid rgba(232, 121, 249, 0.8);
  border-radius: 50%;
  animation: cm-ping 1.9s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.cm-fab-circle::after {
  animation-delay: 0.95s;
}

.cm-fab-shine {
  position: absolute;
  top: -60%;
  left: -60%;
  z-index: 2;
  width: 45%;
  height: 220%;
  background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.85) 50%, transparent 100%);
  transform: rotate(20deg);
  animation: cm-shine 2.6s ease-in-out infinite;
  pointer-events: none;
}

.cm-fab-label {
  max-width: 0;
  overflow: hidden;
  color: #fff;
  background: #701a75;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease, max-width 0.25s ease, padding 0.25s ease;
}

.cm-fab:hover .cm-fab-label,
.cm-fab:focus-visible .cm-fab-label {
  max-width: 220px;
  padding: 11px 18px;
  opacity: 1;
  transform: translateX(0);
}

.cm-fab:hover .cm-fab-circle,
.cm-fab:focus-visible .cm-fab-circle {
  box-shadow: 0 14px 36px rgba(134, 25, 143, 0.7);
  transform: scale(1.06);
}

@keyframes cm-fab-in {
  from { transform: translateY(30px) scale(0.6); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes cm-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  10% { transform: translateY(-14px) scale(1.04); }
  20% { transform: translateY(0) scale(1); }
  26% { transform: translateY(-6px) scale(1.02); }
  32% { transform: translateY(0) scale(1); }
}

@keyframes cm-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

@keyframes cm-shine {
  0% { transform: translateX(-120%) rotate(20deg); }
  45%, 100% { transform: translateX(220%) rotate(20deg); }
}

@keyframes cm-tag-wiggle {
  0%, 100% { transform: translateX(-50%) rotate(-6deg); }
  50% { transform: translateX(-50%) rotate(4deg); }
}

@keyframes cm-spark-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

@keyframes cm-ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes cm-ping {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.8); opacity: 0; }
}

@media (max-width: 560px) {
  .cm-cta-row { flex-direction: column; }
  .cm-btn-ghost { width: 100%; }
  .cm-fab-label { display: none; }
  .cm-fab { right: 16px; bottom: 240px; }
  .cm-fab-circle { width: 96px; height: 96px; font-size: 44px; }
  .cm-fab-ring { top: -10px; left: -10px; width: 116px; height: 116px; }
}

@media (prefers-reduced-motion: reduce) {
  .cm-fab-circle,
  .cm-fab-circle::before,
  .cm-fab-circle::after,
  .cm-fab-shine,
  .cm-fab-ring,
  .cm-fab-spark,
  .cm-fab-tag {
    animation: none !important;
  }
}
