/* ============================================================
   IT Recycle Systems – Preloader CSS
   Version: 1.0.0
   ============================================================ */

:root {
  --itrp-accent: #7dba56;
  --itrp-bg:     #0e1e14;
  --itrp-ring:   #7dba56;
  --itrp-white:  #ffffff;
}

/* ── Overlay ── */
#itrp-preloader {
  position: fixed;
  inset: 0;
  background: var(--itrp-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  transition: opacity 0.7s ease, transform 0.7s ease;
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#itrp-preloader.itrp-hidden {
  opacity: 0;
  transform: translateY(-30px);
  pointer-events: none;
}

/* Background grid */
#itrp-preloader::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(125,186,86,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125,186,86,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* ── Corner brackets ── */
.itrp-corner {
  position: absolute;
  width: 56px;
  height: 56px;
  opacity: 0.25;
}
.itrp-tl { top: 24px; left: 24px;
  border-top: 1.5px solid var(--itrp-accent);
  border-left: 1.5px solid var(--itrp-accent); }
.itrp-tr { top: 24px; right: 24px;
  border-top: 1.5px solid var(--itrp-accent);
  border-right: 1.5px solid var(--itrp-accent); }
.itrp-bl { bottom: 24px; left: 24px;
  border-bottom: 1.5px solid var(--itrp-accent);
  border-left: 1.5px solid var(--itrp-accent); }
.itrp-br { bottom: 24px; right: 24px;
  border-bottom: 1.5px solid var(--itrp-accent);
  border-right: 1.5px solid var(--itrp-accent); }

/* ── Logo / Spinner wrap ── */
.itrp-logo-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
  animation: itrpLogoIn 0.5s ease 0.2s both;
}

@keyframes itrpLogoIn {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Glow behind spinner ── */
.itrp-glow {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125,186,86,0.14) 0%, transparent 65%);
  animation: itrpGlowPulse 2.5s ease-in-out infinite;
}

@keyframes itrpGlowPulse {
  0%, 100% { transform: scale(1);   opacity: 0.7; }
  50%       { transform: scale(1.2); opacity: 1; }
}

/* ── Rings ── */
.itrp-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid transparent;
  animation: itrpSpin linear infinite;
}

.itrp-ring-1 {
  width: 120px; height: 120px;
  border-top-color: rgba(125,186,86,0.22);
  border-right-color: rgba(125,186,86,0.06);
  animation-duration: 8s;
}
.itrp-ring-2 {
  width: 100px; height: 100px;
  border-top-color: rgba(125,186,86,0.45);
  border-right-color: rgba(125,186,86,0.12);
  animation-duration: 5s;
  animation-direction: reverse;
}
.itrp-ring-3 {
  width: 80px; height: 80px;
  border-width: 2px;
  border-top-color: var(--itrp-ring);
  border-right-color: rgba(125,186,86,0.18);
  animation-duration: 3s;
}
.itrp-ring-4 {
  width: 60px; height: 60px;
  border-top-color: rgba(125,186,86,0.55);
  border-right-color: transparent;
  animation-duration: 2s;
  animation-direction: reverse;
}
.itrp-ring-5 {
  width: 42px; height: 42px;
  border-top-color: rgba(125,186,86,0.3);
  animation-duration: 1.5s;
}

@keyframes itrpSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Center logo mark ── */
.itrp-logo-center {
  width: 36px;
  height: 36px;
  background: var(--itrp-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  box-shadow:
    0 0 20px rgba(125,186,86,0.45),
    0 0 44px rgba(125,186,86,0.16);
  animation: itrpCenterPulse 2s ease-in-out infinite;
}

@keyframes itrpCenterPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(125,186,86,0.45), 0 0 44px rgba(125,186,86,0.16);
  }
  50% {
    box-shadow: 0 0 30px rgba(125,186,86,0.75), 0 0 60px rgba(125,186,86,0.28);
  }
}

.itrp-logo-center svg {
  width: 18px;
  height: 18px;
  fill: #1a3a2a;
}

/* ── Brand text ── */
.itrp-brand-text {
  text-align: center;
  animation: itrpFadeUp 0.6s ease 0.5s both;
}

.itrp-brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--itrp-white);
  margin-bottom: 6px;
  line-height: 1.2;
}

.itrp-brand-sub {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.32);
}

/* ── Progress bar ── */
.itrp-progress-wrap {
  margin-top: 44px;
  width: 200px;
  animation: itrpFadeUp 0.6s ease 0.7s both;
}

.itrp-progress-track {
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 11px;
}

.itrp-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    #2d5c3e,
    var(--itrp-accent),
    #b8e08a
  );
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(125,186,86,0.6);
  transition: width 0.3s ease;
}

.itrp-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.itrp-progress-text {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
}

.itrp-progress-pct {
  font-size: 10px;
  font-weight: 800;
  color: var(--itrp-accent);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

/* ── Bouncing dots ── */
.itrp-dots {
  display: flex;
  gap: 6px;
  margin-top: 30px;
  animation: itrpFadeUp 0.6s ease 0.9s both;
}

.itrp-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(125,186,86,0.22);
  animation: itrpDotBounce 1.2s ease-in-out infinite;
}
.itrp-dot:nth-child(1) { animation-delay: 0s; }
.itrp-dot:nth-child(2) { animation-delay: 0.15s; }
.itrp-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes itrpDotBounce {
  0%, 80%, 100% {
    transform: scale(1);
    background: rgba(125,186,86,0.22);
  }
  40% {
    transform: scale(1.6);
    background: var(--itrp-accent);
  }
}

/* ── Shared fade-up ── */
@keyframes itrpFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Hide on mobile (optional setting) ── */
@media (max-width: 767px) {
  #itrp-preloader.itrp-hide-mobile {
    display: none !important;
  }
}
