:root {
  /* --- Palette --- */
  --faq-primary-color: rgb(2, 66, 201);
  --faq-primary-light: rgba(2, 66, 201, 0.15);
  --faq-primary-gradient: linear-gradient(135deg, rgb(2, 66, 201), rgb(70, 130, 245));
  --faq-text-color: #2c3e50;
  --faq-text-secondary-color: #636e72;
  --faq-bg-color: #f9fbff;
  --faq-item-bg: #ffffff;
  --faq-border-color: #dbe4f7;

  /* --- Sizing & Spacing --- */
  --faq-border-radius: 32px;
  --faq-container-padding: 36px;
  --faq-item-padding: 28px;

  /* --- Modern Soft Shadows --- */
  --faq-shadow-base: 0 8px 20px rgba(2, 66, 201, 0.12);
  --faq-shadow-hover: 0 16px 40px rgba(2, 66, 201, 0.2);
  --faq-shadow-focus: 0 0 12px 3px rgba(2, 66, 201, 0.4);

  /* --- Transitions --- */
  --faq-transition-smooth: 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  --faq-transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body {
  background-color: var(--faq-bg-color);
  font-smooth: antialiased;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ratek-faq-container {
  max-width: 900px;
  margin: 50px auto;
  padding: 0 var(--faq-container-padding);
  direction: rtl;
  color: var(--faq-text-color);
}

/* ==========================================
   انیمیشن سایه کادر سرچ (به جای پس‌زمینه)
   ========================================== */
@keyframes animated-shadow {
  0% {
    box-shadow: 0 0 8px 2px rgba(2, 66, 201, 0.5);
    border-color: rgb(2, 66, 201);
  }
  50% {
    box-shadow: 0 0 20px 6px rgba(70, 130, 245, 0.8);
    border-color: rgb(70, 130, 245);
  }
  100% {
    box-shadow: 0 0 8px 2px rgba(2, 66, 201, 0.5);
    border-color: rgb(2, 66, 201);
  }
}

/* ==========================================
   کادر (Wrapper) — انیمیشن اینجاست
   ========================================== */
.faq-search-wrapper {
  margin-bottom: 50px;
  position: relative;
  z-index: 10;
  display: inline-block;
  width: 100%;
}

.faq-search-wrapper .faq-search-input {
  /* کادر متحرک اطراف فیلد */
  border: 3px solid rgb(2, 66, 201);
  border-radius: 48px;
  animation: animated-shadow 6s ease infinite;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
  display: block;
}

/* ==========================================
   فیلد سرچ — بدون انیمیشن و پس‌زمینه ساده
   ========================================== */
.faq-search-input {
  width: 100%;
  max-width: 600px;
  padding: 32px 40px;
  font-size: 1.5rem;
  background: #ffffff;                /* ← پس‌زمینه سفید ثابت */
  border: 3px solid rgb(2, 66, 201);
  border-radius: 48px;
  box-sizing: border-box;
  color: var(--faq-text-color);       /* ← متن مشکی خوانا */
  font: inherit;
  box-shadow: 0 0 8px 2px rgba(2, 66, 201, 0.5);
  /* انیمیشن gradient-animation کاملاً حذف شد */
  transition: transform 0.5s ease, box-shadow 0.5s ease, border-color 0.5s ease;
}

/* Placeholder — تیره و واضح */
.faq-search-input::placeholder {
  color: #555;                        /* ← خاکستری تیره */
  opacity: 0.7;                       /* ← شفافیت کم برای خوانایی بهتر */
}

/* Hover — فقط سایه و مقیاس */
.faq-search-wrapper .faq-search-input:hover {
  box-shadow: 0 0 20px 6px rgba(70, 130, 245, 0.9);
  transform: translateY(-4px) scale(1.05);
  border-color: rgb(70, 130, 245);
  animation-play-state: paused;       /* انیمیشن کادر متوقف می‌شود */
}

/* Focus — سایه قوی‌تر */
.faq-search-wrapper .faq-search-input:focus,
.faq-search-wrapper .faq-search-input:focus-visible {
  outline: none;
  transform: translateY(-6px) scale(1.1);
  box-shadow: 0 0 28px 8px rgba(70, 130, 245, 1);
  border-color: rgb(70, 130, 245);
  animation-play-state: paused;
}

/* ==========================================
   Accordion
   ========================================== */
.ratek-faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.faq-item {
  background-color: var(--faq-item-bg);
  border: 1.5px solid var(--faq-border-color);
  border-radius: var(--faq-border-radius);
  box-shadow: var(--faq-shadow-base);
  transition: all var(--faq-transition-smooth);
  transform: translateY(0) scale(1);
  overflow: hidden;
}

.faq-item:hover {
  box-shadow: var(--faq-shadow-hover);
  border-color: var(--faq-primary-color);
  transform: translateY(-3px) scale(1.01);
  z-index: 3;
  position: relative;
}

/* ==========================================
   Question
   ========================================== */
.faq-question {
  width: 100%;
  background: linear-gradient(90deg, rgba(2, 66, 201, 0.15), transparent);
  border: none;
  padding: var(--faq-item-padding);
  text-align: right;
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--faq-text-color);
  transition: color var(--faq-transition-smooth);
  font: inherit;
  user-select: none;
  letter-spacing: 0.015em;
  border-radius: var(--faq-border-radius);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.07);
}

.faq-question:hover {
  color: var(--faq-primary-color);
}

.faq-question.active {
  color: var(--faq-primary-color);
  background: var(--faq-primary-light);
}

/* ==========================================
   Icon (Chevron)
   ========================================== */
.faq-icon {
  flex-shrink: 0;
  margin-right: 18px;
  width: 14px;
  height: 14px;
  border-left: 3px solid var(--faq-text-secondary-color);
  border-bottom: 3px solid var(--faq-text-secondary-color);
  transform: rotate(-45deg);
  transition: all var(--faq-transition-bounce);
  will-change: transform;
}

.faq-question:hover .faq-icon {
  border-color: var(--faq-primary-color);
}

.faq-question.active .faq-icon {
  transform: rotate(135deg);
  margin-top: -7px;
  border-color: var(--faq-primary-color);
}

/* ==========================================
   Answer Panel
   ========================================== */
.faq-answer {
  background-color: #f3f3f3;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-15px);
  padding: 0;
  transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease, transform 0.5s ease;
}

.faq-question.active + .faq-answer {
  max-height: 1000px;
  opacity: 1;
  transform: translateY(0);
  padding: 20px;
}

/* ==========================================
   Answer Content
   ========================================== */
.faq-answer-content {
  padding: 0 var(--faq-item-padding) var(--faq-item-padding);
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--faq-text-secondary-color);
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 768px) {
  .ratek-faq-container {
    margin: 30px auto;
    padding: 0 24px;
  }

  .faq-search-input {
    padding: 22px 24px;
    font-size: 1.15rem;
    border-radius: 32px;
  }

  .faq-question {
    padding: 20px;
    font-size: 1.15rem;
  }

  .faq-answer-content {
    padding: 0 20px 20px;
    font-size: 1rem;
  }

  .faq-icon {
    margin-right: 14px;
    width: 12px;
    height: 12px;
    border-left-width: 2.5px;
    border-bottom-width: 2.5px;
  }
}