/* ==========================================================================
   ATTEST — XEVON-INSPIRED LUMINOUS EMERALD LOADING SCREEN
   Features:
   - Living Obsidian Emerald Aurora Backdrop (#010907 with breathing gradients)
   - Multi-stage SVG Laser Stroke Drawing (Dash-offset emerald-white energy)
   - Official Company Logo Bloom & Diagonal Specular Sweep
   - Hairline Energy Progress Indicator & Monospace Precision Telemetry
   - Cinematic 3-Second Pacing with Seamless Aperture Dissolve
   ========================================================================== */

.attest-loader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background-color: #010907;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform, filter;
}

/* Exit state: Elegant aperture bloom & dimensional scale */
.attest-loader.is-loaded {
  opacity: 0;
  transform: scale(1.05);
  filter: blur(12px) brightness(1.15);
  visibility: hidden;
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────────────
   1. AMBIENT LIVING AURORA BACKGROUND
   ───────────────────────────────────────────────────────────── */
.attest-loader__ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 650px 480px at 50% 48%, rgba(16, 185, 129, 0.18) 0%, rgba(5, 150, 105, 0.08) 45%, transparent 75%),
    radial-gradient(ellipse 800px 600px at 50% 50%, rgba(6, 78, 59, 0.25) 0%, rgba(2, 20, 18, 0.12) 60%, transparent 80%),
    radial-gradient(circle 300px at 50% 45%, rgba(110, 231, 183, 0.12) 0%, transparent 65%),
    #010907;
  animation: attest-aurora-breath 4s ease-in-out infinite alternate;
}

@keyframes attest-aurora-breath {
  0% {
    transform: scale(0.96);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
  100% {
    transform: scale(0.98);
    opacity: 0.85;
  }
}

.attest-loader__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.85;
}

/* ─────────────────────────────────────────────────────────────
   2. LOGO STAGE & LUMINOUS CENTERPIECE
   ───────────────────────────────────────────────────────────── */
.attest-loader__stage {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  user-select: none;
}

/* Radial Glow Aura Behind Logo */
.attest-loader__halo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -58%);
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.28) 0%, rgba(52, 211, 153, 0.12) 40%, rgba(255, 255, 255, 0.05) 55%, transparent 72%);
  filter: blur(28px);
  pointer-events: none;
  animation: attest-halo-pulse 3s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

@keyframes attest-halo-pulse {
  0% {
    opacity: 0.4;
    transform: translate(-50%, -58%) scale(0.85);
  }
  100% {
    opacity: 0.9;
    transform: translate(-50%, -58%) scale(1.15);
  }
}

/* Logo Box Wrapper */
.attest-loader__logo-container {
  position: relative;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
}

/* Attest Brand Wordmark (30px Proportional Scale - Symmetrically Spaced) */
.attest-loader__wordmark {
  font-family: var(--font-brand, 'Cormorant Garamond', Georgia, serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.14em;
  color: #FFFFFF;
  text-shadow: 0 0 16px rgba(16, 185, 129, 0.45), 0 0 4px rgba(255, 255, 255, 0.85);
  margin-top: -24px;
  margin-bottom: 24px;
  opacity: 0;
  animation: attest-wordmark-bloom 2.4s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

@keyframes attest-wordmark-bloom {
  0% {
    opacity: 0;
    transform: scale(0.96);
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.2));
  }
  60% {
    opacity: 0.7;
    transform: scale(0.99);
    filter: drop-shadow(0 0 20px rgba(52, 211, 153, 0.6)) drop-shadow(0 0 4px #ffffff);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 14px rgba(16, 185, 129, 0.5)) drop-shadow(0 0 2px rgba(255, 255, 255, 0.9));
  }
}

/* SVG Laser Stroke Outline Drawing */
.attest-loader__svg-strokes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 0 6px #10b981) drop-shadow(0 0 16px rgba(52, 211, 153, 0.7));
}

.attest-loader__stroke-path {
  fill: none;
  stroke: url(#attest-emerald-white-grad);
  stroke-width: 16;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 4500;
  stroke-dashoffset: 4500;
  animation: attest-stroke-draw 2.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.attest-loader__inner-cutout {
  fill: none;
  stroke: url(#attest-emerald-white-grad);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1800;
  stroke-dashoffset: 1800;
  animation: attest-stroke-draw-sub 2s cubic-bezier(0.25, 1, 0.5, 1) 0.15s forwards;
}

.attest-loader__wordmark-path {
  fill: none;
  stroke: #ffffff;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: attest-stroke-draw-sub 1.8s cubic-bezier(0.25, 1, 0.5, 1) 0.3s forwards;
}

@keyframes attest-stroke-draw {
  0% {
    stroke-dashoffset: 4500;
    opacity: 0.2;
  }
  30% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0.9;
  }
}

@keyframes attest-stroke-draw-sub {
  0% {
    stroke-dashoffset: 1800;
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0.85;
  }
}

/* Official Full Raster Logo with Emerald Specular Shimmer & Bloom */
.attest-loader__logo-solid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 3;
  opacity: 0;
  transform: scale(0.96);
  filter: drop-shadow(0 0 18px rgba(16, 185, 129, 0.45)) drop-shadow(0 0 4px rgba(255, 255, 255, 0.8));
  animation: attest-logo-bloom 2.4s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

@keyframes attest-logo-bloom {
  0% {
    opacity: 0;
    transform: scale(0.94);
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.2));
  }
  60% {
    opacity: 0.7;
    transform: scale(0.99);
    filter: drop-shadow(0 0 22px rgba(52, 211, 153, 0.65)) drop-shadow(0 0 6px #ffffff);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 16px rgba(16, 185, 129, 0.5)) drop-shadow(0 0 2px rgba(255, 255, 255, 0.9));
  }
}

/* Diagonal Emerald-to-White Specular Sweep */
.attest-loader__sweep {
  position: absolute;
  inset: -20%;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(16, 185, 129, 0.25) 45%,
    rgba(255, 255, 255, 0.75) 50%,
    rgba(52, 211, 153, 0.25) 55%,
    transparent 65%
  );
  transform: translateX(-120%);
  animation: attest-specular-sweep 2.2s cubic-bezier(0.4, 0, 0.2, 1) 0.8s forwards;
  mix-blend-mode: screen;
}

@keyframes attest-specular-sweep {
  0% {
    transform: translateX(-120%);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* ─────────────────────────────────────────────────────────────
   3. HAIRLINE TELEMETRY & PROGRESS BAR
   ───────────────────────────────────────────────────────────── */
.attest-loader__telemetry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

/* Track */
.attest-loader__track {
  width: 180px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.5);
}

/* Fill with emerald-to-white gradient & trailing laser spark */
.attest-loader__fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #059669 0%, #10b981 40%, #6ee7b7 75%, #ffffff 100%);
  border-radius: 2px;
  box-shadow: 0 0 10px #10b981, 0 0 20px rgba(110, 231, 183, 0.8), 0 0 4px #ffffff;
  transition: width 0.06s linear;
}

/* Status & Numeric Counter */
.attest-loader__status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 180px;
  font-family: 'JetBrains Mono', monospace, ui-monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.attest-loader__label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(110, 231, 183, 0.8);
  font-size: 9.5px;
}

.attest-loader__indicator-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: attest-dot-blink 1.2s ease-in-out infinite alternate;
}

@keyframes attest-dot-blink {
  0% { opacity: 0.3; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.3); }
}

.attest-loader__counter {
  color: #ffffff;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}
