/* Saffo.az — home page form + animation enhancements */

.navbar__logo-img,
.footer__logo-img {
  height: 120px;
  width: auto;
}

.form-card__lead {
  margin: -0.25rem 0 1rem;
  color: rgba(17, 24, 39, 0.72);
  font-size: 0.98rem;
  line-height: 1.55;
}

.group-picker {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.group-picker legend {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #0f172a;
}

.group-picker__hint {
  margin: 0 0 1rem;
  color: rgba(15, 23, 42, 0.68);
  font-size: 0.94rem;
  line-height: 1.5;
}

.group-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.group-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(59, 130, 246, 0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(245,248,255,0.98));
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, background 220ms ease;
}

.group-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.16);
  border-color: rgba(59, 130, 246, 0.34);
}

.group-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.group-card__top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  font-weight: 700;
  font-size: 0.85rem;
}

.group-card__title {
  color: #0f172a;
  font-size: 0.98rem;
  line-height: 1.35;
}

.group-card__desc {
  color: rgba(15, 23, 42, 0.72);
  font-size: 0.9rem;
  line-height: 1.5;
}

.group-card:has(input:checked) {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.09), rgba(255,255,255,0.98));
  border-color: rgba(37, 99, 235, 0.52);
  box-shadow: 0 22px 44px rgba(37, 99, 235, 0.18);
}

.group-card:has(input:checked) .group-card__top {
  background: #2563eb;
  color: #fff;
}

/* Motion system */
.reveal-up {
  opacity: 0;
  transform: translateY(26px) scale(0.985);
  transition: opacity 600ms ease, transform 700ms cubic-bezier(.2,.8,.2,1);
  will-change: transform, opacity;
}

.reveal-up.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.float-soft {
  animation: floatSoft 5.8s ease-in-out infinite;
}

.floating-badge {
  animation: badgeFloat 4.8s ease-in-out infinite;
}

.hero__feature:nth-child(2) { animation-delay: 0.8s; }
.hero__feature:nth-child(3) { animation-delay: 1.6s; }
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.12s; }
.delay-3 { animation-delay: 0.18s; }
.delay-4 { animation-delay: 0.24s; }

.teacher-card,
.pricing-card,
.review-card,
.faq__item,
.stats__item,
.form-card {
  transition: transform 260ms ease, box-shadow 260ms ease;
}

.teacher-card:hover,
.pricing-card:hover,
.review-card:hover,
.faq__item:hover {
  transform: translateY(-6px);
}

@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes badgeFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -6px, 0); }
}

@media (max-width: 900px) {
  .group-cards {
    grid-template-columns: 1fr;
  }

  .navbar__logo-img,
  .footer__logo-img {
    max-height: 100px;
  }
}

/* ─── Scroll progress bar ─── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #2563EB, #60a5fa, #2563EB);
  background-size: 200% 100%;
  animation: progressShimmer 2s linear infinite;
  z-index: 9999;
  transition: width 0.1s linear;
}
@keyframes progressShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Button ripple ─── */
.btn {
  position: relative;
  overflow: hidden;
}
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: rippleAnim 0.55s linear;
  background: rgba(255,255,255,0.35);
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* ─── Teacher card shine on hover ─── */
.teacher-card {
  position: relative;
  overflow: hidden;
}
.teacher-card::after {
  content: '';
  position: absolute;
  top: -50%; left: -75%;
  width: 50%; height: 200%;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.22) 50%, transparent 70%);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
  pointer-events: none;
}
.teacher-card:hover::after {
  left: 130%;
}

/* ─── Featured pricing card pulse glow ─── */
.pricing-card--featured {
  animation: featuredGlow 3s ease-in-out infinite;
}
@keyframes featuredGlow {
  0%, 100% { box-shadow: 0 8px 32px rgba(37,99,235,0.18), 0 0 0 0 rgba(37,99,235,0); }
  50%       { box-shadow: 0 8px 40px rgba(37,99,235,0.35), 0 0 0 8px rgba(37,99,235,0.08); }
}

/* ─── Review stars pop in ─── */
.review-card__stars {
  display: inline-block;
  animation: starsPop 0.6s cubic-bezier(.2,.8,.2,1) both;
}
.review-card:nth-child(1) .review-card__stars { animation-delay: 0.1s; }
.review-card:nth-child(2) .review-card__stars { animation-delay: 0.25s; }
.review-card:nth-child(3) .review-card__stars { animation-delay: 0.4s; }
@keyframes starsPop {
  0% { transform: scale(0) rotate(-15deg); opacity: 0; }
  70% { transform: scale(1.2) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ─── Section title underline draw ─── */
.section-title {
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 0;
  width: 0; height: 3px;
  background: linear-gradient(90deg, #2563EB, #60a5fa);
  border-radius: 2px;
  transition: width 0.7s cubic-bezier(.2,.8,.2,1);
}
.section-header.is-visible .section-title::after,
.center-head.is-visible .section-title::after {
  width: 100%;
}

/* ─── Slot machine counter ─── */
.counter {
  display: inline-flex;
  align-items: baseline;
}
.digit-slot {
  display: inline-block;
  overflow: hidden;
  height: 1em;
  line-height: 1;
  vertical-align: bottom;
}
.digit-slot__inner {
  display: flex;
  flex-direction: column;
  will-change: transform;
}
.digit-slot__item {
  height: 1em;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── 3D card tilt ─── */
.teacher-card,
.pricing-card,
.review-card {
  transform-style: preserve-3d;
  will-change: transform;
}

/* ─── Cursor spotlight ─── */
#cursor-spotlight {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(37,99,235,0.10) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  opacity: 0;
}
body:hover #cursor-spotlight { opacity: 1; }

/* ─── Nav link hover underline ─── */
.navbar__links a {
  position: relative;
}
.navbar__links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: #2563EB;
  border-radius: 2px;
  transition: width 0.25s ease;
}
.navbar__links a:hover::after { width: 100%; }

/* ─── Stats item bounce appear ─── */
@keyframes statBounce {
  0%   { transform: translateY(24px) scale(0.8); opacity: 0; }
  60%  { transform: translateY(-6px) scale(1.04); opacity: 1; }
  80%  { transform: translateY(3px) scale(0.98); }
  100% { transform: translateY(0) scale(1); }
}
.stats__item.is-visible {
  animation: statBounce 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.stats__item:nth-child(1) { animation-delay: 0s; }
.stats__item:nth-child(3) { animation-delay: 0.12s; }
.stats__item:nth-child(5) { animation-delay: 0.24s; }
.stats__item:nth-child(7) { animation-delay: 0.36s; }

/* ─── Teacher avatar pulsing ring ─── */
.teacher-card__avatar-img {
  position: relative;
}
.teacher-card:hover .teacher-card__avatar-img {
  animation: avatarRing 1.2s ease-in-out infinite;
}
@keyframes avatarRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(37,99,235,0); }
}

/* ─── Pricing badge wiggle ─── */
.pricing-card__badge {
  animation: badgeWiggle 3s ease-in-out infinite;
}
@keyframes badgeWiggle {
  0%, 90%, 100% { transform: rotate(0deg); }
  92%           { transform: rotate(-3deg); }
  96%           { transform: rotate(3deg); }
}

/* ─── Hero h1 gradient shift ─── */
.hero__h1 {
  background: linear-gradient(90deg, #fff 0%, #bfd7ff 40%, #fff 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s linear infinite;
}
@keyframes gradientShift {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* ─── Group card check pulse ─── */
.group-card:has(input:checked) {
  animation: cardPulse 0.35s ease;
}
@keyframes cardPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* ─── FAQ item open slide ─── */
.faq__answer {
  transition: max-height 0.4s cubic-bezier(.2,.8,.2,1), opacity 0.35s ease;
  opacity: 0;
}
.faq__item.open .faq__answer {
  opacity: 1;
}

/* ─── Navbar scroll shadow ─── */
.navbar.scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  backdrop-filter: blur(12px);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-up,
  .float-soft,
  .floating-badge,
  .teacher-card,
  .pricing-card,
  .review-card,
  .faq__item {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
