/* ======================================================
   Amar Pandey & Co. - Home Page Session Preloader
   Shows only once per browser tab/session using sessionStorage
   Logo colors: Blue + Orange + Green + White
====================================================== */

:root {
  --apc-loader-blue: #075c92;
  --apc-loader-blue-dark: #043f70;
  --apc-loader-navy: #062846;
  --apc-loader-orange: #ff8500;
  --apc-loader-green: #36c84b;
  --apc-loader-white: #ffffff;
  --apc-loader-muted: #607489;
}

html.apc-home-loader-active,
html.apc-home-loader-active body {
  overflow: hidden;
}

html.apc-skip-home-loader #apc-home-preloader {
  display: none !important;
}

#apc-home-preloader,
#apc-home-preloader * {
  box-sizing: border-box;
}

#apc-home-preloader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow: hidden;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.94), rgba(244,251,255,0.98)),
    radial-gradient(circle at 16% 18%, rgba(255, 133, 0, 0.25), transparent 32%),
    radial-gradient(circle at 86% 76%, rgba(54, 200, 75, 0.21), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #eaf7ff 100%);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.72s ease, visibility 0.72s ease;
}

#apc-home-preloader.apc-home-loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.apc-home-ambient {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.apc-home-blue {
  width: 370px;
  height: 370px;
  right: -140px;
  top: -130px;
  background: rgba(7, 92, 146, 0.12);
  border: 1px solid rgba(7, 92, 146, 0.12);
  animation: apcHomeMoveOne 7s ease-in-out infinite;
}

.apc-home-orange {
  width: 280px;
  height: 280px;
  left: -112px;
  bottom: -108px;
  background: rgba(255, 133, 0, 0.14);
  animation: apcHomeMoveTwo 6s ease-in-out infinite;
}

.apc-home-green {
  width: 150px;
  height: 150px;
  right: 12%;
  bottom: 14%;
  border: 20px solid rgba(54, 200, 75, 0.11);
  animation: apcHomeRotate 16s linear infinite;
}

.apc-home-shell {
  position: relative;
  width: min(94vw, 720px);
  padding: clamp(22px, 4vw, 38px);
  text-align: center;
  border-radius: 36px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.76));
  border: 1px solid rgba(7, 92, 146, 0.12);
  box-shadow:
    0 35px 90px rgba(4, 63, 112, 0.16),
    0 12px 28px rgba(255, 133, 0, 0.08),
    inset 0 1px 0 rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: apcHomeShellIn 0.85s cubic-bezier(.2,.8,.2,1) both;
}

.apc-home-shell::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg,
    rgba(7, 92, 146, 0.34),
    rgba(255, 133, 0, 0.30),
    rgba(54, 200, 75, 0.26));
  opacity: 0.45;
}

.apc-home-logo-card {
  position: relative;
  width: min(100%, 590px);
  margin: 0 auto 18px;
  padding: clamp(10px, 2.5vw, 17px);
  border-radius: 26px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(7, 92, 146, 0.10);
  box-shadow: 0 22px 55px rgba(4, 63, 112, 0.13);
}

.apc-home-logo-shine {
  position: absolute;
  inset: 0;
  transform: translateX(-110%) skewX(-18deg);
  width: 55%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.82), transparent);
  animation: apcHomeLogoShine 2.7s ease-in-out infinite;
}

.apc-home-logo {
  position: relative;
  display: block;
  width: 100%;
  max-height: 135px;
  object-fit: contain;
  margin: 0 auto;
}

.apc-home-meta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 4px auto 16px;
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--apc-loader-blue-dark);
  background: rgba(7, 92, 146, 0.075);
  border: 1px solid rgba(7, 92, 146, 0.12);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.apc-home-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--apc-loader-green);
  box-shadow: 0 0 0 6px rgba(54, 200, 75, 0.12);
}

.apc-home-separator {
  color: var(--apc-loader-orange);
}

.apc-home-title {
  margin: 0;
  color: var(--apc-loader-navy);
  font-size: clamp(25px, 4.4vw, 39px);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.75px;
}

.apc-home-subtitle {
  margin: 10px auto 22px;
  max-width: 560px;
  color: var(--apc-loader-muted);
  font-size: clamp(14px, 2.5vw, 16px);
  font-weight: 650;
  line-height: 1.55;
}

.apc-home-service-stage {
  width: min(94%, 430px);
  min-height: 52px;
  margin: 0 auto 16px;
  padding: 12px 18px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(90deg, var(--apc-loader-blue-dark), var(--apc-loader-blue));
  box-shadow: 0 18px 34px rgba(7, 92, 146, 0.22), inset 0 1px 0 rgba(255,255,255,0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 900;
}

.apc-home-service-icon {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--apc-loader-blue-dark);
  background: #ffffff;
  font-size: 15px;
  box-shadow: 0 0 0 6px rgba(255,255,255,0.10);
}

.apc-home-service-stage.apc-home-changing {
  animation: apcHomeTextSwitch 0.45s ease;
}

.apc-home-service-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin: 0 auto 22px;
}

.apc-home-service-list span {
  padding: 8px 11px;
  border-radius: 999px;
  color: #0d2f4c;
  background: rgba(255,255,255,0.80);
  border: 1px solid rgba(7, 92, 146, 0.09);
  box-shadow: 0 8px 18px rgba(4, 63, 112, 0.06);
  font-size: 12px;
  font-weight: 850;
}

.apc-home-progress-wrap {
  width: min(90%, 410px);
  margin: 0 auto;
}

.apc-home-progress-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(7, 92, 146, 0.12);
  border: 1px solid rgba(7, 92, 146, 0.06);
}

.apc-home-progress-bar span {
  display: block;
  width: 46%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--apc-loader-orange), var(--apc-loader-green), var(--apc-loader-blue));
  animation: apcHomeProgress 1.16s ease-in-out infinite;
}

.apc-home-progress-wrap small {
  display: block;
  margin-top: 11px;
  color: var(--apc-loader-blue-dark);
  font-size: 13px;
  font-weight: 850;
}

@keyframes apcHomeShellIn {
  from { opacity: 0; transform: translateY(24px) scale(0.965); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes apcHomeLogoShine {
  0% { transform: translateX(-120%) skewX(-18deg); }
  48%, 100% { transform: translateX(220%) skewX(-18deg); }
}

@keyframes apcHomeProgress {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(238%); }
}

@keyframes apcHomeTextSwitch {
  0% { opacity: 0.35; transform: translateY(6px) scale(0.99); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes apcHomeMoveOne {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-24px, 26px) scale(1.08); }
}

@keyframes apcHomeMoveTwo {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(26px, -22px) scale(1.07); }
}

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

@media (max-width: 680px) {
  #apc-home-preloader { padding: 16px; }
  .apc-home-shell { border-radius: 28px; }
  .apc-home-logo-card { border-radius: 20px; }
  .apc-home-logo { max-height: 112px; }
  .apc-home-meta-pill { font-size: 12px; gap: 6px; }
  .apc-home-service-stage { border-radius: 20px; width: 100%; }
  .apc-home-service-list { gap: 7px; }
  .apc-home-service-list span { font-size: 11px; }
}

@media (max-width: 420px) {
  .apc-home-logo { max-height: 94px; }
  .apc-home-meta-pill { width: 100%; flex-wrap: wrap; }
  .apc-home-service-list span { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .apc-home-ambient,
  .apc-home-logo-shine,
  .apc-home-progress-bar span,
  .apc-home-shell,
  .apc-home-service-stage.apc-home-changing {
    animation: none !important;
  }

  #apc-home-preloader {
    transition: none;
  }
}


/* cPanel / cache / delayed-JS safety:
   If JavaScript is delayed by hosting optimization, hide loader automatically. */
#apc-home-preloader {
  animation: apcHomeFailsafeHide 0.45s ease 6s forwards;
}

#apc-home-preloader.apc-home-loaded {
  animation: none;
}

@keyframes apcHomeFailsafeHide {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}
