/* From Uiverse.io by 20essentials */ 
.loader {
  --size: 250px;
  width: var(--size);
  height: var(--size);
  zoom: 0.8;
  border: 4px solid #fff;
  border-radius: 50%;
  position: relative;
  --current-gray: #444;
  background-color: var(--current-gray);
  transform-origin: 50% 100%;
  animation: rotarBall 1s linear alternate infinite both;

  .cap {
    width: 50%;
    height: 18%;
    border-radius: 50%;
    border: inherit;
    left: 50%;
    position: absolute;
    top: -4%;
    transform: translateX(-50%);
    background-color: var(--current-gray);
  }

  .shadow-top {
    position: absolute;
    width: 55%;
    height: 25%;
    border-radius: 50%;
    background-color: #fff3;
    left: 50%;
    top: 19%;
    transform: translateX(-50%) scale(0.9);
  }

  .circle {
    width: 96%;
    height: 96%;
    background-color: #20a5e1;
    border-radius: inherit;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    clip-path: polygon(0 50%, 100% 50%, 100% 100%, 0 100%);
    animation: rotarCicle 1.5s linear alternate infinite both;
  }

  .circle-top {
    background-color: #40c9ff;
    width: 96%;
    height: 10%;
    position: absolute;
    border-radius: 50%;
    top: 45.5%;
    left: 50%;
    transform: translateX(-50%);
    animation: rotarCircleTop 1.5s linear alternate infinite both;
  }

  .fish {
    position: absolute;
    bottom: 50px;
    width: 40px;
    width: 50px;
    height: 50px;
    animation: moveFish 2s linear infinite both;
  }
}

.shadow-bottom {
  zoom: 0.8;
  position: absolute;
  top: calc(50% + 125px);
  left: 50%;
  transform: translate(-50%, -50%);
  width: 275px;
  height: 40px;
  z-index: -1;
  border-radius: 50%;
  background-color: #000a;
  filter: blur(20px);
}

@keyframes moveFish {
  0% {
    left: 10%;
    transform: scaleX(1);
  }
  50% {
    left: calc(90% - 40px);
    transform: scaleX(1);
  }
  51% {
    left: calc(90% - 40px);
    transform: scaleX(-1);
  }
  100% {
    left: 10%;
    transform: scaleX(-1);
  }
}

@keyframes rotarBall {
  0% {
    transform: rotate(-10deg);
  }
  100% {
    transform: rotate(10deg);
  }
}

@keyframes rotarCircleTop {
  0% {
    transform: translateX(-50%) rotate(10deg);
  }
  100% {
    transform: translateX(-50%) rotate(-10deg);
  }
}

@keyframes rotarCicle {
  0% {
    transform: translate(-50%, -50%) rotate(10deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(-10deg);
  }
}

/* ------------------------------------------------------------------
   Cortinilla de mantenimiento (usa el loader de arriba)
   ------------------------------------------------------------------ */
.cortinilla {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  overflow: auto;
  text-align: center;
  color: #eaf3fc;
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(1100px 520px at 50% -8%, rgba(31, 110, 67, 0.5), transparent 62%),
    linear-gradient(180deg, #14352a 0%, #0a1f14 72%);
  animation: cortinillaIn 0.6s ease both;
}

.cortinilla * {
  box-sizing: border-box;
}

.cortinilla-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  max-width: 560px;
}

.cortinilla-logo {
  width: 96px;
  height: auto;
  padding: 12px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 22px 46px -22px rgba(0, 0, 0, 0.65);
}

.cortinilla-title {
  margin: 0;
  font-size: clamp(1.5rem, 4.8vw, 2.35rem);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.cortinilla-title span {
  color: #9fe0b8;
}

.cortinilla-sub {
  margin: 0;
  max-width: 44ch;
  font-size: 1.02rem;
  line-height: 1.55;
  color: #b8cde3;
}

.cortinilla-loader {
  position: relative;
  display: grid;
  place-items: center;
  width: 240px;
  height: 230px;
  margin: 0.6rem 0 0.2rem;
}

.cortinilla .loader {
  margin: 0 auto;
}

.cortinilla .shadow-bottom {
  top: auto;
  bottom: -4px;
  transform: translateX(-50%);
}

.cortinilla-wa {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.4rem;
  padding: 0.8rem 1.25rem;
  border-radius: 14px;
  background: #25d366;
  color: #06331d;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 18px 42px -18px rgba(37, 211, 102, 0.75);
  transition: transform 0.18s ease, background 0.18s ease;
}

.cortinilla-wa:hover {
  background: #1fbe5b;
  transform: translateY(-2px);
}

.cortinilla-wa:active {
  transform: translateY(0);
}

.cortinilla-wa svg {
  flex: 0 0 auto;
}

.cortinilla-wa-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}

.cortinilla-wa-text small {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.75;
}

.cortinilla-wa-text b {
  font-size: 1.05rem;
}

@keyframes cortinillaIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

body:has(> .cortinilla) {
  overflow: hidden;
}

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