*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --brand-primary: #291f75;
  --brand-accent: #d92157;
  --brand-gradient: linear-gradient(135deg, #d92157 0%, #291f75 100%);
  --brand-3: #4a38d4;
  --accent-mid: #e84472;
  --white: #fff;
  --surface-2: #f6f7fb;
  --ink: #0d0d1a;
  --ink-2: #4a4a6a;
  --ink-3: #8888a8;
  --green: #146b3e;
  --orange: #b45309;
  --red: #c0392b;
  --border: 1px solid rgba(13, 13, 26, 0.09);
  --border-color: rgba(13, 13, 26, 0.09);
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 20px;
  --sh-sm: 0 2px 8px rgba(13, 13, 26, 0.06);
}

html,
body {
  font-family: "DM Sans", "Inter", sans-serif;
  background: var(--surface-2);
  min-height: 100vh;
}

/* ── HEADER ── */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  height: 62px;
  background: var(--white);
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  padding: 0 36px;
  gap: 0;
  box-shadow: 0 1px 4px rgba(13, 13, 26, 0.07);
}

.hamburger-btn {
  display: flex;
  width: 34px;
  height: 30px;
  border-radius: 10px;
  border: var(--border);
  background: #f7f6f2;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
  margin-right: 12px;
}

.hamburger-btn span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--ink-2);
  border-radius: 2px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-lockup__logo {
  height: 24px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.brand-lockup__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-lockup__label {
  font-size: 16px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 600;
}

.nav-pills {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 0 24px;
}

.nav-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s;
}

.nav-pill:hover {
  background: var(--surface-2);
  color: var(--brand-primary);
}

.nav-pill.active {
  background: none;
  color: #334155;
  font-weight: 500;
}

.desktop-header-icon {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.hdr-actions {
  display: flex;
  align-items: center;
  gap: 27px;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  font-size: 16px;
  position: relative;
  transition: background 0.15s;
  text-decoration: none;
}

.icon-btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  width: auto;
  height: 18px;
  background: var(--brand-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--white);
}

.user-pill {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: var(--border);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-3), var(--accent-mid));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.04em;
}

.user-name {
  display: none;
}

/* ── PAGE TITLE STRIP ── */
.pi-page-topbar {
  width: 100%;
}

.pi-page-topbar-inner {
  width: 100%;
  background: var(--brand-gradient);
  padding: 16px 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pi-page-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
  margin: 0;
  text-align: center;
  width: 100%;
}

/* ── PAGE MAIN ── */
.faq-page-main {
  margin: 0 auto;
  padding: 30px 36px 56px;
  width: 100%;
}

.faq-intro {
  text-align: center;
  margin-bottom: 26px;
}

.faq-intro-title {
  font-family: "DM Serif Display", serif;
  font-size: 28px;
  color: var(--brand-primary);
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.faq-intro-sub {
  font-size: 14px;
  color: var(--ink-2);
}

/* ── PRODUCT TABS ── */
.faq-tabs-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 20px;
}

.faq-tabs-scroll::before,
.faq-tabs-scroll::after {
  content: "";
  margin: auto;
}

.faq-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.faq-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: 50px;
  border: 1.5px solid var(--border-color);
  background: var(--white);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  box-shadow: var(--sh-sm);
}

.faq-tab:hover {
  border-color: rgba(41, 31, 117, 0.35);
  background: rgba(41, 31, 117, 0.03);
}

.faq-tab.active {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
}

.faq-tab-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}

.faq-tab.active .faq-tab-name {
  color: #fff;
}

/* ── FAQ PANELS / ACCORDION ── */
.faq-panels {
  display: block;
}

.faq-panel {
  display: none;
}

.faq-panel.active {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: faqFadeUp 0.25s ease both;
}

@keyframes faqFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.faq-item {
  background: var(--white);
  border: var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.faq-item:hover {
  border-color: rgba(41, 31, 117, 0.2);
}

.faq-item.open {
  border-color: rgba(41, 31, 117, 0.3);
}

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.faq-q-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--brand-primary);
  color: white;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.03em;
}

/* .faq-item.open .faq-q-num {
  background: var(--brand-gradient);
  color: #fff;
} */

.faq-q-text {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
}

.faq-q-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border-color);
  background: var(--brand-primary);
  color: white;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.25s,
    background 0.2s,
    color 0.2s;
}

.faq-item.open .faq-q-icon {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.open .faq-a {
  grid-template-rows: 1fr;
}

.faq-a-inner {
  overflow: hidden;
}

.faq-a-text {
  padding: 0 20px 18px 66px;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-2);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── LOADING / STATE ── */
.faq-loading[hidden],
.faq-state[hidden] {
  display: none;
}

.faq-loading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0;
}

.faq-loading-row {
  height: 54px;
  border-radius: var(--r-md);
  background: linear-gradient(90deg, #eceaf6 25%, #f7f6fd 50%, #eceaf6 75%);
  background-size: 200% 100%;
  animation: faqShimmer 1.2s infinite linear;
}

@keyframes faqShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.faq-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--white);
  border: var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}

.faq-state-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(217, 33, 87, 0.1);
  color: var(--brand-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.faq-state-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.faq-state-desc {
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 18px;
}

.faq-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 30px;
  border: none;
  background: var(--brand-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

.faq-retry-btn:hover {
  opacity: 0.9;
}

/* ── MOBILE HEADER + BOTTOM NAV ── */
.mp-mobile-header {
  display: none;
}

.bottom-nav {
  display: none;
}

/* ── Footer ── */
.page-footer {
  background: var(--white);
  border-top: 1px solid var(--border-color);
  padding: 14px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-copy {
  font-size: 12px;
  color: var(--ink-3);
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
  text-decoration: underline;
}

.footer-links a:hover {
  color: var(--brand-primary);
}

.mobile-footer-links {
  display: none;
}

@media (max-width: 1023px) {
  .main-header {
    display: none;
  }

  .mp-mobile-header {
    display: block;
    background: #fff;
    padding: 14px 18px 16px;
  }

  .mp-mobile-header .hero-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    gap: 10px;
  }

  .mp-mobile-header .hbr-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .mp-mobile-header .menu-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    color: var(--brand-primary);
    font-size: 15px;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.2s;
  }

  .mp-mobile-header .brand-logo-text {
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    min-width: 0;
  }

  .mp-mobile-header .brand-lockup {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .mp-mobile-header .brand-lockup__logo {
    height: 23px;
    width: auto;
    display: block;
    flex-shrink: 0;
  }

  .mp-mobile-header .brand-lockup__text {
    display: flex;
    flex-direction: column;
    line-height: 1;
  }

  .mp-mobile-header .brand-lockup__label {
    font-size: 12px;
    color: #8487b2;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }

  .mp-mobile-header .hbr-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .mp-mobile-header .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--ink-2);
    position: relative;
    transition: background 0.2s;
  }

  .mp-mobile-header .icon-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
  }

  .mp-mobile-header .notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 17px;
    height: 17px;
    background: var(--brand-accent);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
  }

  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    height: 68px;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px env(safe-area-inset-bottom);
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.07);
  }

  .bn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--brand-primary);
    text-decoration: none;
    min-width: 0;
    transition: color 0.2s;
  }

  .bn-icon-wrap {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
  }

  .bn-icon-wrap img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    display: block;
  }

  .page-footer {
    display: none !important;
  }

  .mobile-footer-links {
    display: flex;
    padding: 20px 16px 8px;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
  }

  .mobile-footer-links a {
    font-size: 12px;
    color: var(--text-3, #94a3b8);
    font-weight: 500;
  }

  .faq-page-main {
    padding-bottom: calc(68px + 40px);
  }
}

/* Tablet 769-1023px */
@media (min-width: 769px) and (max-width: 1023px) {
  .mp-mobile-header {
    padding: 20px 24px 22px;
  }
  .mp-mobile-header .hero-brand-row {
    min-height: 52px;
    gap: 16px;
  }
  .mp-mobile-header .hbr-left {
    gap: 14px;
  }
  .mp-mobile-header .menu-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 20px;
  }
  .mp-mobile-header .brand-logo-text img {
    height: 32px;
  }
  .mp-mobile-header .brand-lockup__label {
    font-size: 13px;
  }
  .mp-mobile-header .hbr-actions {
    gap: 12px;
  }
  .mp-mobile-header .icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 20px;
  }
  .mp-mobile-header .icon-btn img {
    width: 22px;
    height: 22px;
  }
  .mp-mobile-header .notif-badge {
    width: 22px;
    height: 22px;
    font-size: 11px;
    top: -5px;
    right: -5px;
    border-width: 2.5px;
  }
  .bottom-nav {
    height: 76px;
    max-width: 94vw;
    padding: 0 14px env(safe-area-inset-bottom);
  }
  .bn-item {
    gap: 6px;
    padding: 12px 8px;
    font-size: 15px;
  }
  .bn-icon-wrap {
    width: 34px;
    height: 34px;
    font-size: 28px;
  }
  .bn-icon-wrap img {
    width: 30px;
    height: 30px;
  }
  .faq-page-main {
    padding-bottom: calc(76px + 40px);
  }
}

/* Mobile ≤768px */
@media (max-width: 768px) {
  .pi-page-topbar-inner {
    padding: 14px 18px;
  }
  .faq-page-main {
    padding: 22px 16px 40px;
  }
  .faq-intro-title {
    font-size: 22px;
  }
  .faq-intro-sub {
    font-size: 13px;
  }
  .faq-tab {
    padding: 9px 14px;
  }
  .faq-tab-name {
    font-size: 11px;
  }
  .faq-q {
    padding: 14px 14px;
    gap: 10px;
  }
  .faq-q-num {
    width: 28px;
    height: 28px;
    font-size: 10px;
  }
  .faq-q-text {
    font-size: 14px;
  }
  .faq-q-icon {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
  .faq-a-text {
    padding: 0 14px 16px 52px;
    font-size: 13.5px;
  }
}

@media (max-width: 360px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  .faq-q-num {
    display: none;
  }
  .faq-a-text {
    padding: 0 14px 16px 14px;
  }
}

/* Desktop 1024px+ */
@media (min-width: 1024px) {
  .faq-panel.active {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
  }
  .faq-panel.active .faq-item:nth-last-child(1):nth-child(odd) {
    grid-column: 1 / -1;
  }
}
