/* ============================================================
   ANIMATIONS & RESPONSIVE — jumtamazgasanariga.lv
   ============================================================ */

/* ── Keyframes ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes subtle-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes star-pop {
  0% { opacity: 0; transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes checkmark-draw {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}

/* Star pop stagger */
.review-stars .review-star {
  opacity: 0;
  animation: star-pop 0.3s ease forwards;
}
.review-stars .review-star:nth-child(1) { animation-delay: 0.05s; }
.review-stars .review-star:nth-child(2) { animation-delay: 0.12s; }
.review-stars .review-star:nth-child(3) { animation-delay: 0.19s; }
.review-stars .review-star:nth-child(4) { animation-delay: 0.26s; }
.review-stars .review-star:nth-child(5) { animation-delay: 0.33s; }

/* Only animate stars when card is visible */
.review-card:not(.visible) .review-stars .review-star {
  animation: none;
  opacity: 1;
}

/* ── Reduced Motion ── */
@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;
  }

  .hero-badge,
  .hero h1,
  .hero-subtitle,
  .hero-cta-group,
  .hero-trust {
    opacity: 1;
    animation: none;
    transform: none;
  }

  .response-badge {
    animation: none;
  }
}

/* ── ═══════════════════════════════════════════════════════
   RESPONSIVE — Tablet (768px+)
   ═══════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  :root {
    --section-pad-y: 80px;
  }

  body {
    font-size: var(--font-size-base-desktop);
  }

  .container {
    padding: 0 32px;
  }

  /* Header */
  .site-header .btn {
    display: inline-flex;
  }

  /* Hero */
  .hero {
    padding: calc(72px + 80px) 0 96px;
  }

  .hero h1 {
    font-size: 2.75rem;
  }

  .hero-subtitle {
    font-size: 1.1875rem;
  }

  /* Services */
  .services {
    padding: var(--section-pad-y) 0;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Process */
  .process {
    padding: var(--section-pad-y) 0;
  }

  /* Why Us */
  .why-us {
    padding: var(--section-pad-y) 0;
  }

  .why-us-benefits {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Reviews */
  .reviews {
    padding: var(--section-pad-y) 0;
  }

  .reviews-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Areas */
  .areas {
    padding: var(--section-pad-y) 0;
  }

  /* Trust */
  .trust {
    padding: var(--section-pad-y) 0;
  }

  .trust-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  /* FAQ */
  .faq {
    padding: var(--section-pad-y) 0;
  }

  /* Final CTA */
  .final-cta h2 {
    font-size: 2.25rem;
  }

  .final-cta-actions {
    flex-direction: row;
    justify-content: center;
  }

  /* Footer */
  .footer-top {
    grid-template-columns: 1.5fr 1fr 1fr;
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  /* Form panel */
  .form-panel {
    width: 480px;
    border-radius: 16px 0 0 16px;
  }
}

/* ── ═══════════════════════════════════════════════════════
   RESPONSIVE — Desktop (1024px+)
   ═══════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  /* Header — show desktop nav, hide hamburger */
  .main-nav {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .header-right .lang-switcher {
    display: inline-flex;
  }

  .header-right .btn-primary {
    display: inline-flex;
  }

  /* Hero */
  .hero {
    padding: calc(72px + 96px) 0 112px;
  }

  .hero h1 {
    font-size: var(--font-size-h1-desktop);
  }

  .hero-subtitle {
    font-size: 1.25rem;
  }

  /* Section headings */
  .section-header h2 {
    font-size: var(--font-size-h2-desktop);
  }

  /* Services */
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Process — horizontal on desktop */
  .process-steps {
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
  }

  .process-step {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 24px 0 0;
  }

  .step-indicator {
    flex-direction: row;
    width: 100%;
    margin-bottom: 16px;
    align-items: center;
  }

  .step-line {
    width: auto;
    height: 2px;
    flex: 1;
    min-height: unset;
    margin-top: 0;
    margin-left: 6px;
  }

  .process-step:last-child .step-indicator { width: auto; }

  .step-content {
    padding-bottom: 0;
  }

  /* Why Us — two columns */
  .why-us-inner {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }

  .why-us-benefits {
    grid-template-columns: 1fr;
  }

  .why-us-image {
    order: 2;
  }

  /* Reviews — 3 columns */
  .reviews-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Trust stats — 5 columns */
  .trust-stats {
    grid-template-columns: repeat(5, 1fr);
  }

  /* Final CTA */
  .final-cta h2 {
    font-size: var(--font-size-h2-desktop);
  }
}

/* ── ═══════════════════════════════════════════════════════
   RESPONSIVE — Large Desktop (1440px+)
   ═══════════════════════════════════════════════════════ */
@media (min-width: 1440px) {
  :root {
    --container-max: var(--container-max-lg);
    --section-pad-y: 100px;
  }
}

/* ── ═══════════════════════════════════════════════════════
   RESPONSIVE — Mobile overrides (max 767px)
   ═══════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  /* Reviews — horizontal swipe carousel */
  .reviews-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .reviews-grid::-webkit-scrollbar {
    display: none;
  }

  .review-card {
    min-width: 86%;
    scroll-snap-align: start;
    flex-shrink: 0;
  }

  .reviews-nav {
    display: flex;
  }

  .reviews-dots {
    display: flex;
  }

  /* Form — full-screen bottom sheet on mobile */
  .form-panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    max-height: 95dvh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }

  .form-panel.open {
    transform: translateY(0);
  }

  /* Hero — compact */
  .hero {
    padding: calc(72px + 40px) 0 60px;
  }

  .hero-trust {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .hero-cta-group .btn {
    width: 100%;
  }

  /* Process steps full width on mobile */
  .process-step {
    padding: 20px 0;
  }

  /* Trust stats — 2 col on mobile */
  .trust-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Final CTA actions */
  .final-cta-actions .btn {
    width: 100%;
    max-width: 380px;
  }

  /* Footer top single column */
  .footer-top {
    grid-template-columns: 1fr;
  }
}

/* ── Focus Visible (keyboard nav) ── */
:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 3px;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 3px;
}
