.eco-protection-visual {
  --protection-blue: #8ec9eb;
  --protection-mint: #94d8c2;
  --protection-red: #df6b72;
  position: relative;
  width: min(250px, 70vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.eco-protection-building {
  position: relative;
  z-index: 1;
  width: 48%;
  height: 64%;
  margin-top: -2%;
  border: 1px solid rgba(142, 201, 235, .48);
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(155deg, rgba(26, 53, 76, .96), rgba(7, 16, 27, .96));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.eco-protection-building::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 6%;
  bottom: 5%;
  border-left: 1px solid rgba(142, 201, 235, .08);
  border-right: 1px solid rgba(142, 201, 235, .08);
}

.eco-building-roof {
  position: absolute;
  left: 13%;
  right: 13%;
  top: -8%;
  height: 8%;
  border: 1px solid rgba(142, 201, 235, .44);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  background: rgba(12, 31, 48, .94);
}

.eco-building-antenna {
  position: absolute;
  left: 50%;
  top: -19%;
  width: 1px;
  height: 11%;
  background: rgba(142, 201, 235, .55);
}

.eco-building-antenna::after {
  content: "";
  position: absolute;
  left: -2px;
  top: -4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--protection-red);
  box-shadow: 0 0 12px rgba(223, 107, 114, .8);
  animation: ecoWindowLight 2.6s ease-in-out infinite;
}

.eco-building-windows {
  position: absolute;
  z-index: 2;
  left: 13%;
  right: 13%;
  top: 10%;
  bottom: 18%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 9% 13%;
}

.eco-building-windows i {
  border: 1px solid rgba(142, 201, 235, .2);
  border-radius: 2px;
  background: rgba(142, 201, 235, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  animation: ecoWindowLight 5.2s ease-in-out infinite;
}

.eco-building-windows i:nth-child(3n+1) { animation-delay: -1.1s; }
.eco-building-windows i:nth-child(3n+2) { animation-delay: -3.4s; }
.eco-building-windows i:nth-child(4n) { animation-delay: -4.5s; }
.eco-building-windows i:nth-child(5n) { animation-delay: -2.2s; }

.eco-building-door {
  position: absolute;
  z-index: 2;
  left: 39%;
  bottom: 0;
  width: 22%;
  height: 14%;
  border: 1px solid rgba(148, 216, 194, .38);
  border-bottom: 0;
  background: rgba(148, 216, 194, .12);
}

.eco-building-ground {
  position: absolute;
  z-index: 0;
  left: 18%;
  right: 18%;
  bottom: 16.5%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(142, 201, 235, .5), transparent);
}

.eco-protection-scan {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  height: 13%;
  top: -14%;
  overflow: hidden;
  background: linear-gradient(180deg, transparent, rgba(142, 201, 235, .05), rgba(148, 216, 194, .36), transparent);
  animation: ecoBuildingScan 4.6s cubic-bezier(.45, 0, .55, 1) infinite;
}

.eco-protection-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4%;
  height: 28px;
  text-align: center;
  color: #f4f7fb;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.eco-protection-status span {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: ecoStatusSwap 7.2s ease-in-out infinite;
}

.eco-protection-status span:first-child { color: var(--protection-mint); }
.eco-protection-status span:last-child { color: var(--protection-blue); animation-delay: 3.6s; }

.client-protection { margin: auto; }

.self-protection-intro {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  background: radial-gradient(circle at 50% 44%, #132538 0, #09131f 43%, #050b12 100%);
  animation: ecoProtectionExit .75s cubic-bezier(.7, 0, .25, 1) 3.45s forwards;
}

.self-protection-intro .eco-protection-visual { width: min(300px, 76vw); }
.self-protection-copy { text-align: center; }
.self-protection-copy strong,
.self-protection-copy span { display: block; }
.self-protection-copy strong { color: #f4f7fb; font-size: clamp(24px, 6vw, 42px); letter-spacing: .12em; }
.self-protection-copy span { margin-top: 8px; color: #8ec9eb; font-size: 10px; font-weight: 800; letter-spacing: .28em; }

@keyframes ecoWindowLight { 0%, 24%, 100% { background: rgba(142, 201, 235, .07); box-shadow: none; } 38%, 68% { background: rgba(148, 216, 194, .78); border-color: rgba(192, 244, 226, .82); box-shadow: 0 0 12px rgba(148, 216, 194, .48); } }
@keyframes ecoBuildingScan { 0%, 10% { transform: translateY(0); opacity: 0; } 22% { opacity: 1; } 75% { opacity: .9; } 90%, 100% { transform: translateY(820%); opacity: 0; } }
@keyframes ecoStatusSwap { 0%, 8% { opacity: 0; transform: translateY(6px); } 15%, 43% { opacity: 1; transform: none; } 50%, 100% { opacity: 0; transform: translateY(-5px); } }
@keyframes ecoProtectionExit { to { opacity: 0; visibility: hidden; transform: scale(1.02); } }

@media (prefers-reduced-motion: reduce) {
  .eco-building-windows i,
  .eco-building-antenna::after,
  .eco-protection-scan,
  .eco-protection-status span { animation: none !important; }
  .eco-protection-status span:first-child { opacity: 1; }
  .self-protection-intro { display: none; }
}

/* Animate a separate light layer: the legacy finish fixes window backgrounds
 * with !important, so background keyframes alone cannot illuminate them. */
@layer eco-protection-scene {
  @media screen {
    .eco-protection-visual::before {
      content: "";
      position: absolute;
      z-index: 0;
      inset: 20% 8% 12%;
      border-radius: 50%;
      pointer-events: none;
      background: radial-gradient(ellipse at 60% 48%, rgba(61, 139, 198, .2), transparent 70%);
      opacity: .5;
    }
    .eco-building-windows i {
      position: relative;
      animation: none !important;
    }
    .eco-building-windows i::after {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: inherit;
      pointer-events: none;
      background: linear-gradient(150deg, #c9ebff, #72b8e2);
      box-shadow: 0 0 8px rgba(102, 186, 238, .48);
      opacity: .35;
    }
    .eco-building-antenna::after {
      background: var(--protection-red) !important;
      box-shadow: 0 0 10px rgba(223, 107, 114, .65) !important;
    }
    .eco-building-antenna::before {
      content: "";
      position: absolute;
      left: -8px;
      top: -10px;
      width: 17px;
      height: 17px;
      border: 1px solid rgba(223, 107, 114, .64);
      border-radius: 50%;
      pointer-events: none;
      opacity: 0;
    }
    .eco-protection-status span { transform: none !important; }
    html[data-eco-vision="light"] .eco-protection-status span:first-child { color: #176644 !important; }
    html[data-eco-vision="light"] .eco-protection-status span:last-child { color: #215a99 !important; }

    @media (prefers-reduced-motion: no-preference) {
      .eco-protection-building { animation: ecoProtectionFloat 6.8s ease-in-out infinite !important; }
      .eco-protection-visual::before { animation: ecoProtectionHalo 6.8s ease-in-out infinite !important; }
      .eco-building-windows i::after { animation: ecoProtectionWindowGlow 5.6s ease-in-out infinite !important; }
      .eco-building-windows i:nth-child(3n+1)::after { animation-delay: -1.1s !important; }
      .eco-building-windows i:nth-child(3n+2)::after { animation-delay: -3.4s !important; }
      .eco-building-windows i:nth-child(4n)::after { animation-delay: -4.5s !important; }
      .eco-building-windows i:nth-child(5n)::after { animation-delay: -2.2s !important; }
      .eco-building-antenna::after { animation: ecoProtectionBeacon 2.8s ease-in-out infinite !important; }
      .eco-building-antenna::before { animation: ecoProtectionSignal 2.8s ease-out infinite !important; }
      .eco-protection-scan { animation: ecoBuildingScan 4.6s cubic-bezier(.45, 0, .55, 1) infinite !important; }
      .eco-protection-status span { animation: ecoStatusSwap 7.2s ease-in-out infinite !important; }
      .eco-protection-status span:last-child { animation-delay: 3.6s !important; }
    }

    @keyframes ecoProtectionFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
    @keyframes ecoProtectionHalo { 0%, 100% { opacity: .4; transform: scale(.96); } 50% { opacity: .85; transform: scale(1.04); } }
    @keyframes ecoProtectionWindowGlow { 0%, 22%, 100% { opacity: .08; } 40%, 68% { opacity: .86; } }
    @keyframes ecoProtectionBeacon { 0%, 100% { opacity: .56; transform: scale(.86); } 40%, 64% { opacity: 1; transform: scale(1.14); } }
    @keyframes ecoProtectionSignal { 0%, 10% { opacity: 0; transform: scale(.45); } 24% { opacity: .6; } 76%, 100% { opacity: 0; transform: scale(1.65); } }

    @media (prefers-reduced-motion: reduce) {
      .eco-protection-building,
      .eco-protection-visual::before,
      .eco-building-windows i::after,
      .eco-building-antenna::before,
      .eco-building-antenna::after,
      .eco-protection-scan,
      .eco-protection-status span {
        animation: none !important;
        transform: none !important;
      }
      .eco-building-antenna::after { opacity: 1; }
      .eco-building-antenna::before { opacity: 0; }
      .eco-building-windows i::after { opacity: .35; }
      .eco-protection-status span:first-child { opacity: 1; }
    }
  }
}
