/* ═══════════════════════════════════════════════
   FabNails — Nail Polish Preloader
   Nadpisuje domyślny preloader ze styles.css
   ═══════════════════════════════════════════════ */

/* ── Kontener ── */
.preloader {
  background: #FDF9F6;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Opóźnij wygaszanie, aby cała animacja zdążyła się rozegrać,
     nawet gdy skrypt doda .is-done bardzo wcześnie (szybkie ładowanie). */
  transition: opacity .7s var(--ease-out) 1.8s, visibility .7s 1.8s !important;
}

.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* ── SVG paznokieć ── */
.nail-svg {
  width: 72px;
  height: 118px;
  overflow: visible;
  filter: drop-shadow(0 8px 24px rgba(201,123,132,0.25));
}

/* Tło paznokcia */
.nail-bg {
  fill: #FDF9F6;
  stroke: #E8B4B8;
  stroke-width: 2;
}

/* Zarys paznokcia (rysuje się stopniowo) */
.nail-outline {
  fill: none;
  stroke: #C97B84;
  stroke-width: 2;
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
  animation: nail-draw 0.7s cubic-bezier(0.4,0,0.2,1) 0.1s forwards;
}

/* Linia skórki */
.nail-cuticle {
  fill: none;
  stroke: #C97B84;
  stroke-width: 1.2;
  stroke-linecap: round;
  opacity: 0;
  animation: nail-cuticle-in 0.35s ease 0.7s forwards;
}

/* Lakier — wypełnia się od dołu do góry */
.nail-polish {
  x: 14px;
  y: 122px;
  width: 52px;
  height: 0px;
  fill: url(#polish-grad);
  animation: polish-fill 1.0s cubic-bezier(0.4,0,0.15,1) 0.8s forwards;
}

/* Blask — pojawia się po wypełnieniu */
.nail-shine {
  opacity: 0;
  animation: shine-in 0.6s ease 1.7s forwards;
}

/* Iskierka (gwiazdka) */
.nail-sparkle {
  opacity: 0;
  transform-origin: center;
  animation: sparkle-pop 0.5s cubic-bezier(0.34,1.56,0.64,1) 1.65s forwards;
}

/* ── Tekst FabNails ── */
.preloader-script {
  opacity: 0;
  transform: translateY(8px);
  animation: text-rise 0.55s ease 1.4s forwards;
  /* wyłącz stary pulsujący anim */
  animation-iteration-count: 1 !important;
}

/* ── Ukryj stary element line ── */
.preloader-line {
  display: none;
}

/* ── Keyframes ── */
@keyframes nail-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes nail-cuticle-in {
  to { opacity: 1; }
}

@keyframes polish-fill {
  to { y: 8px; height: 114px; }
}

@keyframes shine-in {
  0%   { opacity: 0; }
  50%  { opacity: 1; }
  100% { opacity: 0.7; }
}

@keyframes sparkle-pop {
  0%   { opacity: 0; transform: scale(0) rotate(0deg); }
  60%  { opacity: 1; transform: scale(1.3) rotate(20deg); }
  100% { opacity: 0.9; transform: scale(1) rotate(15deg); }
}

@keyframes text-rise {
  to { opacity: 1; transform: translateY(0); }
}
