

#tm-page-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(ellipse at center,
    rgba(15, 16, 25, 0.97) 0%,
    rgba(3, 6, 16, 1) 70%);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: opacity 0.55s cubic-bezier(.16,1,.3,1), transform 0.55s cubic-bezier(.16,1,.3,1);
  font-family: 'Cairo', 'Inter', system-ui, sans-serif;
}
body.light #tm-page-loader {
  background: radial-gradient(ellipse at center,
    rgba(240, 242, 255, 0.98) 0%,
    rgba(220, 225, 245, 1) 70%);
}
#tm-page-loader.tm-pl-hide {
  opacity: 0;
  transform: scale(1.1);
  pointer-events: none;
}

#tm-page-loader::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 30%, transparent 100%);
  opacity: 0.6;
  animation: tm-pl-grid 15s linear infinite;
}
body.light #tm-page-loader::before {
  background-image:
    linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
}
@keyframes tm-pl-grid {
  from { transform: translate(0, 0); }
  to   { transform: translate(40px, 40px); }
}

.tm-pl-particle {
  position: absolute;
  border-radius: 50%;
  background-image: linear-gradient(135deg, var(--brand-primary, #6366f1), var(--brand-accent, #a855f7));
  filter: blur(1px);
  opacity: 0.7;
  pointer-events: none;
}
.tm-pl-particle.p1 { width: 12px; height: 12px; top: 18%; left: 15%; animation: tm-pl-float 6s ease-in-out infinite; }
.tm-pl-particle.p2 { width: 18px; height: 18px; bottom: 22%; right: 12%; animation: tm-pl-float 8s ease-in-out infinite -1s; }
.tm-pl-particle.p3 { width: 10px; height: 10px; top: 30%; right: 18%; animation: tm-pl-float 7s ease-in-out infinite -2s; }
.tm-pl-particle.p4 { width: 14px; height: 14px; bottom: 25%; left: 18%; animation: tm-pl-float 9s ease-in-out infinite -3s; }
.tm-pl-particle.p5 { width: 8px; height: 8px; top: 45%; left: 30%; animation: tm-pl-float 5s ease-in-out infinite -1.5s; }
.tm-pl-particle.p6 { width: 16px; height: 16px; top: 55%; right: 28%; animation: tm-pl-float 6.5s ease-in-out infinite -0.5s; }
@keyframes tm-pl-float {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.7; }
  50%      { transform: translate(30px, -40px) scale(1.3); opacity: 0.3; }
}

.tm-pl-stage {
  position: relative;
  width: 220px;
  height: 220px;
  display: grid;
  place-items: center;
}

.tm-pl-orb {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(var(--brand-primary-rgb, 99,102,241), 0.45) 0%,
    rgba(var(--brand-accent-rgb,  168,85,247),  0.25) 40%,
    transparent 70%);
  filter: blur(30px);
  animation: tm-pl-breathe 3s ease-in-out infinite;
}
@keyframes tm-pl-breathe {
  0%, 100% { transform: scale(0.9); opacity: 0.8; }
  50%      { transform: scale(1.15); opacity: 1; }
}

.tm-pl-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--brand-primary, #6366f1) 90deg,
    var(--brand-accent, #a855f7) 180deg,
    var(--brand-secondary, #06b6d4) 270deg,
    transparent 360deg);
  mask: radial-gradient(circle, transparent 60%, black 62%, black 100%);
  -webkit-mask: radial-gradient(circle, transparent 60%, black 62%, black 100%);
  animation: tm-pl-spin 2.5s linear infinite;
}
@keyframes tm-pl-spin { to { transform: rotate(360deg); } }

.tm-pl-ring2 {
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  border: 2px dashed rgba(var(--brand-primary-rgb, 99,102,241), 0.4);
  animation: tm-pl-spin 6s linear infinite reverse;
}

.tm-pl-logo-box {
  position: relative;
  width: 130px;
  height: 130px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(15,17,28,0.85), rgba(8,10,20,0.95));
  border-radius: 50%;
  border: 1px solid rgba(var(--brand-primary-rgb, 99,102,241), 0.3);
  box-shadow:
    inset 0 0 30px rgba(0,0,0,0.5),
    0 10px 40px rgba(var(--brand-primary-rgb, 99,102,241), 0.4);
}
body.light .tm-pl-logo-box {
  background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(240,242,255,1));
  box-shadow:
    inset 0 0 20px rgba(15,23,42,0.05),
    0 10px 40px rgba(var(--brand-primary-rgb, 99,102,241), 0.3);
}

.tm-pl-logo-text {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #ffffff;
  position: relative;
  text-align: center;
  line-height: 1.2;
}
body.light .tm-pl-logo-text { color: #1f2937; }
.tm-pl-logo-text span {
  background-image: linear-gradient(135deg, var(--brand-primary, #6366f1), var(--brand-accent, #a855f7));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.tm-pl-logo-img {
  max-width: 80px;
  max-height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(var(--brand-primary-rgb, 99,102,241), 0.4));
}

.tm-pl-logo-box::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(110deg,
    transparent 0%,
    rgba(255,255,255,0.18) 50%,
    transparent 100%);
  animation: tm-pl-shimmer 2.4s ease-in-out infinite;
  border-radius: 50%;
}
@keyframes tm-pl-shimmer {
  0%, 100% { left: -100%; opacity: 0; }
  40%      { opacity: 1; }
  60%      { opacity: 1; }
  100%     { left: 200%; opacity: 0; }
}

.tm-pl-status {
  position: absolute;
  bottom: 22%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.tm-pl-text {
  color: rgba(255,255,255,0.7);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: tm-pl-fade 2s ease-in-out infinite;
}
body.light .tm-pl-text { color: rgba(15,23,42,0.55); }
@keyframes tm-pl-fade {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

.tm-pl-dots {
  display: flex;
  gap: 6px;
}
.tm-pl-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand-primary, #6366f1);
  animation: tm-pl-dot 1.4s ease-in-out infinite;
}
.tm-pl-dots span:nth-child(1) { animation-delay: 0s; background: var(--brand-primary, #6366f1); }
.tm-pl-dots span:nth-child(2) { animation-delay: 0.2s; background: var(--brand-accent, #a855f7); }
.tm-pl-dots span:nth-child(3) { animation-delay: 0.4s; background: var(--brand-secondary, #06b6d4); }
@keyframes tm-pl-dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1.2); opacity: 1; }
}

.tm-pl-progress {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  max-width: 80vw;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}
body.light .tm-pl-progress { background: rgba(15,23,42,0.08); }
.tm-pl-progress-fill {
  height: 100%;
  width: 0%;
  background-image: linear-gradient(90deg,
    var(--brand-primary, #6366f1),
    var(--brand-accent, #a855f7),
    var(--brand-secondary, #06b6d4));
  background-size: 200% 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
  animation: tm-pl-progress-grad 2s linear infinite;
  box-shadow: 0 0 10px rgba(var(--brand-primary-rgb, 99,102,241), 0.6);
}
@keyframes tm-pl-progress-grad {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  #tm-page-loader *,
  #tm-page-loader::before,
  #tm-page-loader::after {
    animation: none !important;
    transition: opacity 0.3s ease !important;
  }
}

@media (max-width: 480px) {
  .tm-pl-stage { width: 180px; height: 180px; }
  .tm-pl-logo-box { width: 110px; height: 110px; }
  .tm-pl-logo-text { font-size: 1.1rem; }
  .tm-pl-progress { width: 180px; bottom: 8%; }
}
