/* ============================================================
   RESET
   ============================================================ */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}


/* ============================================================
   BODY
   ============================================================ */

body {
  min-height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;

  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;

  color: #f8fafc;

  background:
    radial-gradient(
      circle at 15% 15%,
      rgba(59, 130, 246, 0.18),
      transparent 30%
    ),
    radial-gradient(
      circle at 85% 20%,
      rgba(139, 92, 246, 0.16),
      transparent 30%
    ),
    radial-gradient(
      circle at 50% 100%,
      rgba(14, 165, 233, 0.10),
      transparent 35%
    ),
    linear-gradient(
      135deg,
      #020617 0%,
      #0f172a 45%,
      #111827 100%
    );

  overflow-x: hidden;
}


/* ============================================================
   EFECTO DE FONDO
   ============================================================ */

body::before {
  content: "";

  position: fixed;
  inset: 0;

  pointer-events: none;

  background:
    linear-gradient(
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.015) 1px,
      transparent 1px
    );

  background-size: 45px 45px;

  mask-image:
    linear-gradient(
      to bottom,
      black,
      transparent 85%
    );

  opacity: 0.35;
}


/* ============================================================
   CONTENEDOR
   ============================================================ */

.container {
  position: relative;
  z-index: 1;

  width: min(94%, 1250px);

  padding: 50px 20px;

  text-align: center;
}


/* ============================================================
   ENCABEZADO
   ============================================================ */

.encabezado {
  margin-bottom: 42px;
}

.titulo-principal {
  margin: 0;

  font-size:
    clamp(1.4rem, 3vw, 2rem);

  font-weight: 500;

  letter-spacing: -0.025em;

  color: #f8fafc;
}

.subtitulo-principal {
  margin: 8px 0 0;

  font-size: 0.68rem;

  text-transform: uppercase;

  letter-spacing: 0.22em;

  color: #94a3b8;

  opacity: 0.75;
}


/* ============================================================
   GRID
   ============================================================ */

.contadores {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 22px;

  width: 100%;
}


/* ============================================================
   TARJETAS
   ============================================================ */

.contador {
  position: relative;

  min-width: 0;

  padding: 32px 22px 26px;

  overflow: hidden;

  border:
    1px solid
    rgba(148, 163, 184, 0.14);

  border-radius: 24px;

  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.075),
      rgba(255, 255, 255, 0.025)
    );

  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  transition:
    transform 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
}


/* Brillo superior */

.contador::before {
  content: "";

  position: absolute;

  top: 0;
  left: 12%;

  width: 76%;
  height: 1px;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(96, 165, 250, 0.65),
      rgba(167, 139, 250, 0.65),
      transparent
    );

  opacity: 0.8;
}


/* Halo */

.contador::after {
  content: "";

  position: absolute;

  width: 180px;
  height: 180px;

  top: -100px;
  right: -80px;

  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      rgba(59, 130, 246, 0.10),
      transparent 70%
    );

  pointer-events: none;
}


.contador:hover {
  transform: translateY(-5px);

  border-color:
    rgba(96, 165, 250, 0.28);

  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.09),
      rgba(255, 255, 255, 0.035)
    );

  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.35),
    0 0 30px rgba(59, 130, 246, 0.06);
}


/* ============================================================
   NOMBRE
   ============================================================ */

.nombre {
  position: relative;
  z-index: 1;

  margin-bottom: 10px;

  font-size:
    clamp(1.15rem, 2.5vw, 1.55rem);

  font-weight: 700;

  letter-spacing: 0.08em;

  color: #f8fafc;

  text-shadow:
    0 2px 15px rgba(0, 0, 0, 0.25);
}


/* ============================================================
   SUBTÍTULO
   ============================================================ */

.subtitulo {
  position: relative;
  z-index: 1;

  margin-bottom: 8px;

  font-size: 0.82rem;

  font-weight: 400;

  color: #94a3b8;

  opacity: 0.85;
}


/* ============================================================
   CONTENIDO
   ============================================================ */

.contenido-contador {
  display: block;

  position: relative;
  z-index: 1;
}


/* ============================================================
   DÍAS
   ============================================================ */

.dias {
  margin: 0;

  font-size:
    clamp(4rem, 9vw, 7rem);

  line-height: 0.95;

  font-weight: 800;

  letter-spacing: -0.07em;

  white-space: nowrap;

  font-variant-numeric: tabular-nums;

  color: #ffffff;

  background:
    linear-gradient(
      135deg,
      #ffffff 10%,
      #dbeafe 45%,
      #a5b4fc 100%
    );

  -webkit-background-clip: text;
  background-clip: text;

  -webkit-text-fill-color: transparent;

  filter:
    drop-shadow(
      0 10px 30px rgba(59, 130, 246, 0.18)
    );
}


/* ============================================================
   DÍA / DÍAS
   ============================================================ */

.palabra {
  margin-top: 12px;

  font-size:
    clamp(1rem, 2.5vw, 1.35rem);

  font-weight: 500;

  color: #cbd5e1;

  letter-spacing: 0.02em;
}


/* ============================================================
   TIEMPO
   ============================================================ */

.tiempo {
  display: flex;

  align-items: baseline;
  justify-content: center;

  gap: 4px;

  margin-top: 26px;

  font-variant-numeric: tabular-nums;

  font-feature-settings: "tnum";
}


.unidad {
  min-width: 2.2em;

  font-size:
    clamp(1.35rem, 3.5vw, 2rem);

  font-weight: 650;

  letter-spacing: -0.04em;

  color: #e2e8f0;
}


.separador {
  margin: 0 2px;

  font-size:
    clamp(1.2rem, 3vw, 1.7rem);

  font-weight: 400;

  color: #64748b;

  opacity: 0.7;
}


/* ============================================================
   ETIQUETAS
   ============================================================ */

.etiquetas {
  display: flex;

  justify-content: center;

  gap: 9px;

  margin-top: 5px;

  font-size: 0.5rem;

  text-transform: uppercase;

  letter-spacing: 0.13em;

  color: #64748b;
}


.etiqueta {
  width: 3.5em;

  text-align: center;
}


/* ============================================================
   FECHA
   ============================================================ */

.fecha {
  margin-top: 26px;

  font-size: 0.75rem;

  color: #94a3b8;

  opacity: 0.75;
}


/* ============================================================
   ESTADO SIN REGISTRO
   ============================================================ */

.estado-sin-registro {
  min-height: 150px;

  display: flex;

  align-items: center;
  justify-content: center;

  padding: 20px;

  font-size:
    clamp(1.3rem, 4vw, 2rem);

  font-weight: 700;

  letter-spacing: 0.06em;

  color: #fbbf24;

  text-shadow:
    0 0 25px rgba(251, 191, 36, 0.2);
}


.estado-sin-registro[hidden] {
  display: none;
}


/* ============================================================
   INDICADOR
   ============================================================ */

.hora {
  display: flex;

  align-items: center;
  justify-content: center;

  margin-top: 10px;

  font-size: 0.68rem;

  color: #94a3b8;

  opacity: 0.65;
}


.punto {
  width: 7px;
  height: 7px;

  display: inline-block;

  margin-right: 7px;

  border-radius: 50%;

  background: #22c55e;

  box-shadow:
    0 0 8px rgba(34, 197, 94, 0.8),
    0 0 18px rgba(34, 197, 94, 0.35);

  animation:
    pulso 2s ease-in-out infinite;
}


@keyframes pulso {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}


/* ============================================================
   PIE
   ============================================================ */

.pie {
  margin-top: 32px;

  font-size: 0.65rem;

  color: #64748b;

  opacity: 0.7;
}


.pie strong {
  font-weight: 500;

  color: #94a3b8;
}


/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 950px) {

  .container {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .contadores {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 18px;
  }

  .contador:last-child {
    grid-column: 1 / -1;

    width: min(100%, calc(50% - 9px));

    justify-self: center;
  }

  .dias {
    font-size:
      clamp(4rem, 11vw, 6rem);
  }
}


/* ============================================================
   CELULAR
   ============================================================ */

@media (max-width: 650px) {

  body {
    align-items: flex-start;
  }

  .container {
    width: 100%;

    padding:
      30px 12px 28px;
  }

  .encabezado {
    margin-bottom: 28px;
  }

  .titulo-principal {
    font-size: 1.35rem;
  }

  .subtitulo-principal {
    font-size: 0.6rem;

    letter-spacing: 0.17em;
  }

  .contadores {
    grid-template-columns: 1fr;

    gap: 14px;
  }

  .contador:last-child {
    grid-column: auto;

    width: 100%;

    max-width: none;
  }

  .contador {
    padding:
      26px 15px 23px;

    border-radius: 20px;
  }

  .contador:hover {
    transform: none;
  }

  .dias {
    font-size:
      clamp(4.5rem, 22vw, 6.5rem);
  }

  .tiempo {
    margin-top: 22px;
  }

  .unidad {
    font-size:
      clamp(1.3rem, 7vw, 1.8rem);
  }

  .fecha {
    margin-top: 22px;
  }

  .estado-sin-registro {
    min-height: 125px;
  }
}


/* ============================================================
   CELULARES PEQUEÑOS
   ============================================================ */

@media (max-width: 380px) {

  .container {
    padding-left: 8px;
    padding-right: 8px;
  }

  .contador {
    padding-left: 11px;
    padding-right: 11px;
  }

  .dias {
    font-size: 4.2rem;
  }

  .unidad {
    font-size: 1.25rem;
  }

  .etiquetas {
    gap: 5px;
  }

  .estado-sin-registro {
    font-size: 1.2rem;
  }
}


/* ============================================================
   PANTALLAS ALTAS / GRANDES
   ============================================================ */

@media (min-width: 1400px) {

  .container {
    width: min(90%, 1350px);
  }

  .contadores {
    gap: 26px;
  }

  .contador {
    padding:
      38px 28px 30px;
  }
}


/* ============================================================
   REDUCIR MOVIMIENTO
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
