/* Página de estado de Proggest (status.proggest.es).
   Estilo de página de estado clásica: aviso general, servicios con 90 días de
   disponibilidad e historial de incidentes. Paleta de status.claude.com (fondo
   marfil, grises cálidos y los mismos colores de estado), a petición del dueño;
   de Proggest quedan el logotipo y Poppins, alojada aquí mismo para no mandar
   las visitas a terceros. Un solo tema claro, como la de Claude.
   Solo se animan transform y opacity. */

@font-face {
  font-family: Poppins;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/poppins-400.woff2) format('woff2');
}
@font-face {
  font-family: Poppins;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/poppins-500.woff2) format('woff2');
}
@font-face {
  font-family: Poppins;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/poppins-600.woff2) format('woff2');
}

:root {
  --bg: #faf9f5;
  --bg-soft: #f4f3ee;
  --card: #faf9f5;
  --text: #141413;
  /* #87867f es el gris secundario de Claude; para el texto pequeño que hay que
     leer se oscurece un punto hasta el 4,5:1 de contraste. */
  --muted: #73726c;
  --faint: #87867f;
  --line: #dedcd1;

  --ok: #76ad2a;
  --ok-text: #4f7a18;
  --minor: #faa72a;
  --major: #e86235;
  --down: #e04343;
  --maint: #2c84db;
  --none: #dedcd1;

  --radius: 10px;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Poppins,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

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

/* --- Cabecera ------------------------------------------------------------- */

.top {
  border-bottom: 1px solid var(--line);
}

.top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  display: block;
  height: 28px;
  width: auto;
}

.brand__tag {
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.top__link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.top__link:hover,
.top__link:focus-visible {
  color: var(--text);
}

main.wrap {
  padding-top: 40px;
  padding-bottom: 8px;
}

/* --- Aviso general -------------------------------------------------------- */

.summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--ok);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: rise 0.4s ease both;
}

.summary__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}

.summary__icon svg {
  width: 18px;
  height: 18px;
}

.summary--degraded {
  background: var(--minor);
  color: #3a2a05;
}

.summary--degraded .summary__icon {
  background: rgba(58, 42, 5, 0.12);
}

.summary--down {
  background: var(--down);
}

.summary--partial {
  background: var(--major);
}

.summary--maint {
  background: var(--maint);
}

.summary--loading,
.summary--error {
  background: var(--bg-soft);
  color: var(--muted);
  box-shadow: none;
  border: 1px solid var(--line);
  font-weight: 500;
}

.summary--loading .summary__icon,
.summary--error .summary__icon {
  background: var(--none);
}

/* --- Avisos publicados (incidentes activos y mantenimientos) -------------- */

.notice {
  margin-bottom: 20px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--maint);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  animation: rise 0.4s ease both;
}

.notice--danger {
  border-left-color: var(--down);
}

.notice--warning {
  border-left-color: var(--minor);
}

.notice--ok {
  border-left-color: var(--ok);
}

.notice__label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.notice__title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.notice__body {
  margin: 8px 0 0;
  color: var(--text);
  white-space: pre-line;
}

.notice__meta {
  margin: 10px 0 0;
  color: var(--faint);
  font-size: 13px;
}

/* --- Incidentes publicados (arriba del todo, con su cronología) ------------- */

.incident-card {
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  animation: rise 0.4s ease both;
}

.incident-card__head {
  padding: 16px 22px;
  background: var(--impact, var(--maint));
  color: #fff;
}

.incident-card--minor {
  --impact: var(--minor);
}
.incident-card--major {
  --impact: var(--major);
}
.incident-card--critical {
  --impact: var(--down);
}
.incident-card--maintenance {
  --impact: var(--maint);
}

.incident-card--minor .incident-card__head {
  color: #3a2a05;
}

.incident-card__label {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}

.incident-card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.incident-card__meta {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: 0.9;
}

.incident-card__updates,
.event__updates {
  margin: 0;
  padding: 0;
  list-style: none;
}

.incident-card__updates {
  padding: 4px 22px 6px;
}

.update {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.update:last-child {
  border-bottom: 0;
}

.update__text {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.update__status {
  font-weight: 600;
}

.update__meta {
  margin: 2px 0 0;
  color: var(--faint);
  font-size: 13px;
}

.event__updates .update {
  padding: 6px 0;
  border-bottom: 0;
  font-size: 14px;
}

/* --- Servicios ------------------------------------------------------------ */

.panel {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise 0.45s 0.05s ease both;
}

.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}

.panel__head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.panel__hint {
  color: var(--muted);
  font-size: 13px;
}

.service {
  padding: 18px 22px 16px;
  border-top: 1px solid var(--line);
}

.service:first-child {
  border-top: 0;
}

.service__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.service__name {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.service__desc {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.service__state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.service__state::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.state--ok {
  color: var(--ok-text);
}

.state--ok::before {
  animation: pulse 2.4s ease-in-out infinite;
}

.state--down {
  color: var(--down);
}

.state--pending,
.state--degraded {
  color: #b7791f;
}

.state--partial {
  color: #c24e1f;
}

.state--maint {
  color: var(--maint);
}

.state--unknown {
  color: var(--faint);
}

.bars {
  display: flex;
  gap: 2px;
  height: 34px;
  margin-top: 14px;
}

.bar {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 2px;
  background: var(--none);
  transform-origin: 50% 100%;
  transition:
    transform 0.14s ease,
    opacity 0.14s ease;
}

.bar:hover,
.bar:focus-visible {
  transform: scaleY(1.14);
  opacity: 0.82;
  outline: none;
}

.bar--ok {
  background: var(--ok);
}

.bar--minor {
  background: var(--minor);
}

.bar--major {
  background: var(--major);
}

.bar--down {
  background: var(--down);
}

.axis {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  color: var(--faint);
  font-size: 12px;
}

.axis__line {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.axis__uptime {
  color: var(--muted);
  font-weight: 500;
}

/* --- Historial ------------------------------------------------------------ */

.history {
  margin-top: 52px;
  animation: rise 0.45s 0.1s ease both;
}

.history > h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
}

.day {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.day__date {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
}

.day__empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.event + .event {
  margin-top: 12px;
}

.event__title {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.event__title--danger {
  color: var(--down);
}

.event__title--warning,
.event__title--minor {
  color: #b7791f;
}

.event__title--major {
  color: #c24e1f;
}

.event__title--critical {
  color: var(--down);
}

.event__title--maintenance {
  color: var(--maint);
}

.event__body {
  margin: 2px 0 0;
  white-space: pre-line;
  font-size: 14px;
}

.event__meta {
  margin: 2px 0 0;
  color: var(--faint);
  font-size: 13px;
}

/* --- Pie ------------------------------------------------------------------ */

.foot {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
}

.foot__inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 48px;
}

/* --- Tooltip de cada día --------------------------------------------------- */

.tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  min-width: 190px;
  max-width: 260px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(20, 20, 19, 0.1);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.tooltip.is-visible {
  opacity: 1;
}

.tooltip__date {
  margin: 0 0 4px;
  font-weight: 600;
}

.tooltip__line {
  margin: 0;
  color: var(--muted);
}

.tooltip__line strong {
  color: var(--text);
  font-weight: 500;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 640px) {
  main.wrap {
    padding-top: 28px;
  }

  .summary {
    padding: 16px;
    font-size: 16px;
  }

  .service,
  .panel__head {
    padding-left: 16px;
    padding-right: 16px;
  }

  .panel__hint {
    display: none;
  }

  .top__link {
    font-size: 13px;
  }

  .foot__inner {
    flex-direction: column;
    gap: 4px;
  }
}
