/* CMS-motion · «Estamos trabajando para mejorar el sitio» (lienzo Claude
   Design CMS-034). Lo usan el vigía dentro del sitio (vigia.js) y la página
   estática que entrega el proxy o el renderer con 503 (mantencion.html). */
.cms-vigia {
  --vg-ink: var(--brand, var(--site-color, #1d4e57));
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: #f4f6f5;
  color: #13262b;
  animation: vg-in 320ms ease-out both;
}
dialog.cms-vigia {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  box-sizing: border-box;
}
dialog.cms-vigia::backdrop {
  background: #f4f6f5;
}
.cms-en-mantencion body {
  overflow: hidden;
}
.cms-vigia-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Sin respuesta del servidor (no es mantención anunciada): aviso pequeño que
   no tapa lo que la persona está leyendo. */
.cms-vigia-aviso {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 1001;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  padding: 10px 10px 10px 16px;
  border: 1px solid #e5e9e8;
  border-radius: 14px;
  background: #fff;
  color: #13262b;
  font-size: 15px;
  box-shadow: 0 16px 36px -20px rgba(19, 38, 43, 0.45);
  animation: vg-card 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.cms-vigia-aviso button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #c9d2cf;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.cms-vigia-dot {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d58a00;
  animation: vg-pulse 1.4s ease-in-out infinite;
}
@keyframes vg-pulse {
  50% {
    opacity: 0.35;
    transform: scale(0.8);
  }
}
.cms-vigia-franja {
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.cms-vigia-franja i,
.cms-vigia-bars i {
  background: var(--c, var(--vg-ink));
}
/* Página estática: los colores del sitio si el renderer los conoce
   (/site-theme.css guardado); si no, la franja de referencia. */
.cms-vigia-pagina .cms-vigia-franja i:nth-child(1),
.cms-vigia-pagina .cms-vigia-bars i:nth-child(1) { --c: var(--civic-0, #e26a6a); }
.cms-vigia-pagina .cms-vigia-franja i:nth-child(2),
.cms-vigia-pagina .cms-vigia-bars i:nth-child(2) { --c: var(--civic-1, #8e7dbe); }
.cms-vigia-pagina .cms-vigia-franja i:nth-child(3),
.cms-vigia-pagina .cms-vigia-bars i:nth-child(3) { --c: var(--civic-2, #2ea39a); }
.cms-vigia-pagina .cms-vigia-franja i:nth-child(4),
.cms-vigia-pagina .cms-vigia-bars i:nth-child(4) { --c: var(--civic-3, #f2c94c); }
.cms-vigia-pagina .cms-vigia-franja i:nth-child(5),
.cms-vigia-pagina .cms-vigia-bars i:nth-child(5) { --c: var(--civic-4, #7bbe6a); }
.cms-vigia-pagina .cms-vigia-franja i:nth-child(6),
.cms-vigia-pagina .cms-vigia-bars i:nth-child(6) { --c: var(--civic-5, #6faedb); }

.cms-vigia-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(640px, 100%);
  box-sizing: border-box;
  padding: clamp(28px, 4vw, 40px) clamp(22px, 4vw, 48px) clamp(22px, 3vw, 32px);
  border: 1px solid #e5e9e8;
  border-radius: clamp(24px, 3vw, 28px);
  background: #fff;
  text-align: center;
  box-shadow: 0 30px 60px -34px rgba(19, 38, 43, 0.4);
  animation: vg-card 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.cms-vigia-head {
  display: flex;
  align-items: flex-end;
  gap: clamp(12px, 2vw, 18px);
}
.cms-vigia-logo {
  width: clamp(44px, 6vw, 58px);
  height: clamp(56px, 7.5vw, 74px);
  object-fit: contain;
}
.cms-vigia-bars {
  display: flex;
  align-items: flex-end;
  gap: clamp(4px, 0.6vw, 6px);
  height: clamp(42px, 6vw, 56px);
}
.cms-vigia-bars i {
  display: block;
  width: clamp(9px, 1.2vw, 12px);
  height: 100%;
  border-radius: 6px;
  transform-origin: bottom;
  animation: vg-eq 1.6s ease-in-out infinite alternate;
}
.cms-vigia-bars i:nth-child(2) { animation-delay: -0.25s; }
.cms-vigia-bars i:nth-child(3) { animation-delay: -0.5s; }
.cms-vigia-bars i:nth-child(4) { animation-delay: -0.75s; }
.cms-vigia-bars i:nth-child(5) { animation-delay: -1s; }
.cms-vigia-bars i:nth-child(6) { animation-delay: -1.25s; }
/* Engranaje que gira lento en un círculo crema. */
.cms-vigia-icon {
  width: clamp(44px, 6vw, 58px);
  height: clamp(44px, 6vw, 58px);
  border-radius: 50%;
  background: #fdf6df;
  display: grid;
  place-items: center;
}
.cms-vigia-icon::before {
  content: "";
  width: 55%;
  height: 55%;
  background: #9a6a00;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19.4 13a7.5 7.5 0 0 0 0-2l2.1-1.6-2-3.5-2.5 1a7.4 7.4 0 0 0-1.7-1l-.4-2.6h-4l-.4 2.6a7.4 7.4 0 0 0-1.7 1l-2.5-1-2 3.5L4.6 11a7.5 7.5 0 0 0 0 2l-2.1 1.6 2 3.5 2.5-1a7.4 7.4 0 0 0 1.7 1l.4 2.6h4l.4-2.6a7.4 7.4 0 0 0 1.7-1l2.5 1 2-3.5zM12 15.5a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  animation: vg-gear 6s linear infinite;
}
.cms-vigia-card h1,
.cms-vigia-card h2 {
  margin: 8px 0 0;
  font-family: var(--display, "Segoe UI", Arial, sans-serif);
  font-size: clamp(27px, 3.4vw, 38px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--vg-ink);
  text-wrap: balance;
}
.cms-vigia-card p {
  margin: 0;
  max-width: 480px;
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.55;
  color: #3e5257;
  text-wrap: pretty;
}
.cms-vigia-retry-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 14px;
  margin-top: 8px;
  padding: 12px 18px;
  border-radius: 16px;
  background: #f4f6f5;
}
.cms-vigia-ring {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  transform: rotate(-90deg);
}
.cms-vigia-ring circle {
  fill: none;
  stroke: #e1e7e5;
  stroke-width: 5;
}
.cms-vigia-ring .cms-vigia-ring-on {
  stroke: var(--vg-ink);
  stroke-linecap: round;
  stroke-dasharray: 113.1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}
.cms-vigia-count {
  display: grid;
  text-align: left;
  line-height: 1.35;
}
.cms-vigia-count small {
  font-size: 13px;
  color: #5b6e72;
}
.cms-vigia-retry {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #c9d2cf;
  border-radius: 10px;
  background: #fff;
  color: #13262b;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.cms-vigia-retry:hover {
  filter: brightness(0.95);
}
.cms-vigia-retry:focus-visible {
  outline: 2px solid var(--vg-ink);
  outline-offset: 2px;
}
@media (max-width: 520px) {
  .cms-vigia-retry {
    width: 100%;
    min-height: 46px;
  }
}
@keyframes vg-in {
  from {
    opacity: 0;
  }
}
@keyframes vg-card {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
@keyframes vg-eq {
  from {
    transform: scaleY(0.3);
  }
  to {
    transform: scaleY(1);
  }
}
@keyframes vg-gear {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cms-vigia,
  .cms-vigia *,
  .cms-vigia-aviso,
  .cms-vigia-dot,
  .cms-vigia-icon::before {
    animation: none !important;
  }
  .cms-vigia-ring .cms-vigia-ring-on {
    transition: none;
  }
}

/* Página estática. */
body.cms-mantencion {
  margin: 0;
  font: 18px/1.5 "Segoe UI", system-ui, Arial, sans-serif;
  background: #f4f6f5;
}
