/* ===================================================================
   فارم أكاونت — Premium Polish Layer
   Apple-grade micro-interactions and cinematic motion
   =================================================================== */

/* ===== PREMIUM LOADING SCREEN ===== */
.pl-loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: linear-gradient(135deg, #2A3621 0%, #3A4A2B 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2rem;
  transition: opacity 0.6s cubic-bezier(0.65, 0, 0.35, 1), visibility 0.6s;
}
.pl-loader.pl-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.pl-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
}
.pl-logo-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(184, 134, 47, 0.2);
  border-top-color: #D4A248;
  animation: pl-spin 1.2s linear infinite;
}
.pl-logo-img {
  width: 80px;
  height: 80px;
  animation: pl-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pl-spin {
  to { transform: rotate(360deg); }
}
@keyframes pl-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.92); opacity: 0.8; }
}
.pl-brand {
  font-family: 'Cairo', sans-serif;
  font-weight: 900;
  color: #EFE7D6;
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  opacity: 0;
  animation: pl-fade-up 0.8s 0.3s forwards cubic-bezier(0.65, 0, 0.35, 1);
}
.pl-tagline {
  font-family: 'Cairo', sans-serif;
  color: #B8862F;
  font-size: 0.875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0;
  animation: pl-fade-up 0.8s 0.6s forwards cubic-bezier(0.65, 0, 0.35, 1);
}
@keyframes pl-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== CUSTOM CURSOR (desktop only) ===== */
@media (hover: hover) and (pointer: fine) {
  body.pl-cursor-active {
    cursor: none;
  }
  body.pl-cursor-active a,
  body.pl-cursor-active button,
  body.pl-cursor-active input,
  body.pl-cursor-active textarea,
  body.pl-cursor-active select,
  body.pl-cursor-active [role="button"] {
    cursor: none;
  }
  .pl-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: #B8862F;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform 0.08s ease-out, width 0.2s ease, height 0.2s ease, background 0.2s ease;
    will-change: transform;
  }
  .pl-cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    border: 1.5px solid rgba(184, 134, 47, 0.4);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
    will-change: transform;
  }
  .pl-cursor.pl-hover {
    width: 16px;
    height: 16px;
    background: #D4A248;
  }
  .pl-cursor-ring.pl-hover {
    width: 56px;
    height: 56px;
    border-color: rgba(184, 134, 47, 0.7);
  }
}

/* ===== 3D CARD TILT ===== */
.pl-tilt {
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out, box-shadow 0.3s ease;
  will-change: transform;
}
.pl-tilt-content {
  transform: translateZ(20px);
}

/* ===== MAGNETIC BUTTONS ===== */
.pl-magnetic {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* ===== STICKY MOBILE CTA BAR ===== */
.pl-mobile-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: linear-gradient(180deg, rgba(58, 74, 43, 0.95), #3A4A2B);
  backdrop-filter: blur(20px);
  border-top: 2px solid rgba(184, 134, 47, 0.3);
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  transform: translateY(120%);
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.25);
}
.pl-mobile-cta.pl-visible {
  transform: translateY(0);
}
.pl-mobile-cta a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px;
  border-radius: 999px;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
}
.pl-mobile-cta .pl-cta-primary {
  background: #25D366;
  color: white;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
}
.pl-mobile-cta .pl-cta-primary:active {
  transform: scale(0.97);
}
.pl-mobile-cta .pl-cta-secondary {
  background: rgba(184, 134, 47, 0.2);
  color: #D4A248;
  border: 1px solid rgba(184, 134, 47, 0.4);
  flex: 0 0 auto;
  padding: 14px 18px;
}
@media (min-width: 1024px) {
  .pl-mobile-cta {
    display: none !important;
  }
}

/* ===== BACK TO TOP BUTTON ===== */
.pl-top {
  position: fixed;
  bottom: 88px;
  right: 24px;
  z-index: 80;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #3A4A2B, #4D6139);
  color: #D4A248;
  border: 1px solid rgba(184, 134, 47, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
  box-shadow: 0 8px 24px rgba(58, 74, 43, 0.3);
}
.pl-top.pl-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.pl-top:hover {
  background: linear-gradient(135deg, #2A3621, #3A4A2B);
  transform: translateY(-4px);
}
@media (max-width: 1023px) {
  .pl-top {
    bottom: 92px;
    right: 16px;
    width: 42px;
    height: 42px;
  }
}

/* ===== SECTION PROGRESS INDICATOR ===== */
.pl-progress-side {
  position: fixed;
  top: 50%;
  left: 24px;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.pl-progress-side.pl-visible {
  opacity: 1;
}
.pl-progress-side .pl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(184, 134, 47, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}
.pl-progress-side .pl-dot:hover {
  background: rgba(184, 134, 47, 0.6);
  transform: scale(1.4);
}
.pl-progress-side .pl-dot.pl-active {
  background: #B8862F;
  width: 24px;
  border-radius: 4px;
}
.pl-progress-side .pl-dot-label {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Cairo', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #3A4A2B;
  white-space: nowrap;
  background: white;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.pl-progress-side .pl-dot:hover .pl-dot-label {
  opacity: 1;
}
@media (max-width: 1024px) {
  .pl-progress-side { display: none; }
}

/* ===== STAGGER REVEAL ===== */
.pl-stagger > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.65, 0, 0.35, 1), transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}
.pl-stagger.pl-revealed > *:nth-child(1) { transition-delay: 0.0s; opacity: 1; transform: translateY(0); }
.pl-stagger.pl-revealed > *:nth-child(2) { transition-delay: 0.08s; opacity: 1; transform: translateY(0); }
.pl-stagger.pl-revealed > *:nth-child(3) { transition-delay: 0.16s; opacity: 1; transform: translateY(0); }
.pl-stagger.pl-revealed > *:nth-child(4) { transition-delay: 0.24s; opacity: 1; transform: translateY(0); }
.pl-stagger.pl-revealed > *:nth-child(5) { transition-delay: 0.32s; opacity: 1; transform: translateY(0); }
.pl-stagger.pl-revealed > *:nth-child(6) { transition-delay: 0.40s; opacity: 1; transform: translateY(0); }
.pl-stagger.pl-revealed > *:nth-child(n+7) { transition-delay: 0.48s; opacity: 1; transform: translateY(0); }

/* ===== COUNTER COMPLETION PULSE ===== */
@keyframes pl-counter-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); color: #D4A248; }
}
.counter.pl-completed {
  animation: pl-counter-pulse 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== SMOOTH SCROLL ===== */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* ===== TEXT SELECTION ===== */
::selection {
  background: #B8862F;
  color: #EFE7D6;
}

/* ===== SCROLLBAR (desktop) ===== */
@media (min-width: 1024px) {
  ::-webkit-scrollbar { width: 10px; }
  ::-webkit-scrollbar-track { background: #FAF6EC; }
  ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #B8862F, #8E6722);
    border-radius: 5px;
  }
  ::-webkit-scrollbar-thumb:hover { background: #8E6722; }
}

/* ===== REDUCED MOTION RESPECT ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .pl-loader { display: none; }
}

/* ===== HERO CINEMATIC REVEAL ===== */
.pl-hero-text > * {
  opacity: 0;
  transform: translateY(40px);
}
.pl-hero-text.pl-revealed > * {
  animation: pl-hero-reveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.pl-hero-text.pl-revealed > *:nth-child(1) { animation-delay: 0.0s; }
.pl-hero-text.pl-revealed > *:nth-child(2) { animation-delay: 0.15s; }
.pl-hero-text.pl-revealed > *:nth-child(3) { animation-delay: 0.30s; }
.pl-hero-text.pl-revealed > *:nth-child(4) { animation-delay: 0.45s; }
.pl-hero-text.pl-revealed > *:nth-child(5) { animation-delay: 0.60s; }
.pl-hero-text.pl-revealed > *:nth-child(n+6) { animation-delay: 0.75s; }
@keyframes pl-hero-reveal {
  to { opacity: 1; transform: translateY(0); }
}

/* ===== SECTION FADE-IN ===== */
.pl-section-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.pl-section-reveal.pl-revealed {
  opacity: 1;
  transform: translateY(0);
}
