/* =========================
   FAQ PAGE – clean & classy
   ========================= */
.faq-page {
  padding: 0 0 64px;
}
.faq-page h1 {
  max-width: 900px;
  margin: 26px auto 10px;
  padding: 0 12px;
  font-size: 32px;
  font-weight: 800;
  color: #1f1f1f;
  text-align: center;
}
.faq-content {
  max-width: 900px;
  margin: 6px auto 0;
  padding: 0 12px 40px;
}

/* Search row */
.faq-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 12px 0 18px;
}
#faqSearch {
  flex: 1;
  height: 44px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 0 14px 0 40px;
  font-size: 15px;
  outline: none;
  background: #fff
    url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E")
    no-repeat 12px center;
}
#faqSearch:focus {
  box-shadow: 0 0 0 3px #26528c22;
  border-color: #cfd8e3;
}
.faq-actions {
  display: flex;
  gap: 8px;
}
.faq-actions button {
  height: 44px;
  padding: 0 12px;
  border: 1px solid #e6e6e6;
  background: #fff;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.faq-actions button:hover {
  background: #f6f8fb;
}

/* Item */
.faq {
  border: 1px solid #eee;
  border-radius: 14px;
  background: #fff;
  margin: 10px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.18s ease, transform 0.18s ease,
    border-color 0.18s ease;
}
.faq:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

/* Question button */
.faq .question {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  padding: 14px 16px;
  background: #fff;
  border: 0;
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: #222;
}
.faq .question:focus {
  outline: 2px solid #26528c22;
  outline-offset: 1px;
}
.faq .question .chev {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  transition: transform 0.18s ease;
}
.faq.open .question .chev {
  transform: rotate(180deg);
}

/* Answer (accordion) */
.faq .answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 16px;
  transition: max-height 0.28s ease, padding 0.18s ease;
}
.faq .answer:not(.height-0) {
  max-height: 1000px;
  padding: 0 16px 14px;
}
.faq .answer p,
.faq .answer li {
  font-size: 15.5px;
  line-height: 1.7;
  color: #2f2f2f;
}

/* Utilities */
.faq .highlight {
  background: #fff29b;
}

/* Responsive */
@media (max-width: 640px) {
  .faq-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .faq-actions {
    justify-content: flex-end;
  }
}
/* Tăng khoảng cách khi câu trả lời đang mở */
.faq .answer {
  padding: 0 16px; /* trạng thái đóng */
}

/* trạng thái mở – hỗ trợ cả 2 cách toggle: .open hoặc bỏ .height-0 */
.faq.open .answer,
.faq .answer:not(.height-0) {
  padding: 14px 16px 16px; /* ↑ thêm padding-top */
}

/* kẻ 1 đường mảnh ngăn cách với button cho đỡ dính */
.faq.open .answer::before,
.faq .answer:not(.height-0)::before {
  content: "";
  display: block;
  height: 1px;
  background: #e9edf3;
  margin: 6px 0 12px; /* khoảng cách giữa button và nội dung */
}

/* bo góc mượt khi mở (nhìn card liền mạch hơn) */
.faq.open .question {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.faq.open .answer {
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}

/* tránh trường hợp <p> đầu tiên có margin-top quá lớn/ quá nhỏ */
.faq.open .answer > :first-child,
.faq .answer:not(.height-0) > :first-child {
  margin-top: 0;
}
/* ==== tokens ==== */
:root {
  --brand: #26528c;
  --brand-700: #1e4475;
  --accent: #e5bf3c;
  --accent-700: #d2ab2e;
  --ink: #1f1f1f;
  --muted: #6f7480;
  --line: #e9edf3;
}

/* Card & hover nâng cấp nhẹ */
.faq {
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.18s ease, transform 0.18s ease,
    border-color 0.18s ease;
}
.faq:hover {
  border-color: #dee5f0;
  box-shadow: 0 14px 30px rgba(38, 82, 140, 0.08);
  transform: translateY(-1px);
}

/* Question row – chữ đậm hơn, chevron đẹp hơn */
.faq .question {
  color: #222;
  position: relative;
}
.faq .question .chev {
  width: 28px;
  height: 28px;
  border: 2px solid var(--line);
  border-radius: 50%;
  justify-content: center;
}
.faq .question:hover .chev {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 191, 60, 0.18) inset;
}

/* Trạng thái mở – nhấn màu brand + viền trái gradient vàng */
.faq.open {
  border-color: var(--accent);
  box-shadow: 0 16px 32px rgba(229, 191, 60, 0.12);
}
.faq.open .question {
  color: var(--brand);
}
.faq.open .question::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -1px;
  bottom: -1px;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), #ffd772);
  border-radius: 14px 0 0 14px;
}
/* Chevron khi mở – pill vàng */
.faq.open .question .chev {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Ngăn cách button/answer + nhấn vàng rất mảnh */
.faq.open .answer::before,
.faq .answer:not(.height-0)::before {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin: 8px 0 14px;
}

/* Text trong answer tối hơn chút cho dễ đọc */
.faq .answer p,
.faq .answer li {
  color: #333;
}

/* Search & buttons mang màu thương hiệu */
#faqSearch {
  border-color: var(--line);
}
#faqSearch:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(38, 82, 140, 0.15);
}

.faq-actions button {
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 700;
}
.faq-actions button:hover {
  background: var(--brand);
  color: #fff;
}

/* Nhẹ nhàng khi hover toàn card */
.faq .question:hover {
  background: linear-gradient(180deg, #fff, #f9fbff);
}
/* Clip mọi thành phần bên trong theo bo góc của card */
.faq {
  position: relative;
  overflow: hidden; /* <<< quan trọng để cắt góc */
  border-radius: 14px; /* đảm bảo bo góc đồng nhất */
}

/* Đưa vạch vàng sang container để không lệch bo góc */
.faq.open .question::before {
  display: none;
} /* tắt pseudo cũ trên .question */

.faq.open::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0; /* không dùng -1px */
  width: 4px;
  background: linear-gradient(180deg, var(--accent, #e5bf3c), #ffd772);
  border-radius: 14px 0 0 14px; /* ăn theo bo góc ngoài */
  pointer-events: none;
}

/* Khi mở: bo góc trên của button giữ nguyên, cạnh dưới thì phẳng để liền answer */
.faq.open .question {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.faq.open .answer {
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}
/* Khi đóng: bo góc dưới của answer giữ nguyên, cạnh trên thì phẳng để liền button */