/* MaxDuit — FAQ H5 (WebView-safe) */
:root {
  --navy-950: #06122e;
  --navy-900: #0a1f4d;
  --navy-800: #12306e;
  --navy-700: #1a4494;
  --ink: #0f172a;
  --ink-soft: #475569;
  --white: #ffffff;
  --gold: #f5c542;
  --gold-deep: #e8a317;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

html,
body {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.faq-body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--navy-950);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.55;
  margin: 0;
}

.faq-body .site-footer {
  display: none;
  margin-top: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}

.faq-page {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  flex-direction: column;
  padding:
    calc(0.95rem + var(--safe-top))
    max(1.1rem, var(--safe-right))
    calc(1.25rem + var(--safe-bottom))
    max(1.1rem, var(--safe-left));
  background:
    radial-gradient(ellipse 90% 50% at 50% -8%, rgba(59, 130, 246, 0.32), transparent 58%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(245, 197, 66, 0.12), transparent 50%),
    linear-gradient(165deg, var(--navy-950) 0%, var(--navy-900) 50%, #0d2a63 100%);
  color: #ffffff;
  overscroll-behavior-y: contain;
}

.faq-top {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  margin-bottom: 1.35rem;
}

.faq-brand {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.faq-top-actions {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  gap: 0.65rem;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}

.faq-home-link {
  display: none;
}

.faq-brand img {
  width: 2.5rem;
  height: 2.5rem;
  margin-right: 0.65rem;
  object-fit: contain;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}

.faq-name {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #ffffff;
}

.faq-tag {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.faq-lang {
  display: -webkit-inline-box;
  display: -webkit-inline-flex;
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}

.faq-lang-btn {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.4rem 0.55rem;
  min-height: 2.1rem;
  min-width: 2.1rem;
  border-radius: 999px;
  cursor: pointer;
}

.faq-lang-btn.is-active {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #06122e;
}

.faq-main {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  width: 100%;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.faq-hero {
  margin-bottom: 1.15rem;
}

.faq-hero h1 {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.55rem;
  color: #ffffff;
}

.faq-hero p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.75);
}

/* Category chips: wrap so all types stay visible in WebView (no horizontal scroll) */
.faq-tabs {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.faq-tab {
  display: inline-block;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  margin: 0 0.45rem 0.45rem 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 0.62rem 0.9rem;
  min-height: 2.5rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
  vertical-align: middle;
}

.faq-tab.is-active {
  background: #ffffff;
  border-color: #ffffff;
  color: #06122e;
}

.faq-list {
  display: block;
}

.faq-item {
  display: block;
  margin-bottom: 0.65rem;
  border-radius: 1rem;
  background: #f5f7fb;
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.faq-q {
  width: 100%;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 1rem;
  min-height: 3.25rem;
  cursor: pointer;
  color: #0a1f4d;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.faq-q-text {
  display: block;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  padding-right: 0.75rem;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  line-height: 1.4;
  color: #0a1f4d;
}

.faq-chevron {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  background: rgba(10, 31, 77, 0.08);
  color: #1a4494;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}

.faq-item.is-open .faq-chevron {
  -webkit-transform: rotate(180deg);
  transform: rotate(180deg);
  background: rgba(245, 197, 66, 0.28);
  color: #92400e;
}

.faq-a {
  display: none;
  padding: 0 1rem 1rem;
  color: #475569;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  line-height: 1.65;
}

.faq-item.is-open .faq-a {
  display: block;
}

.faq-help {
  margin-top: 1.5rem;
  padding: 1.1rem 1.05rem;
  border-radius: 1.05rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.faq-help p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 0.75rem;
}

.faq-help-btn {
  display: inline-block;
  min-height: 2.75rem;
  line-height: 2.75rem;
  padding: 0 1.2rem;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.92rem;
  color: #06122e;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  box-shadow: 0 10px 22px rgba(245, 197, 66, 0.25);
  text-align: center;
}

.faq-help-btn:active {
  -webkit-transform: scale(0.98);
  transform: scale(0.98);
}

/* —— Tablet: show site footer, slightly wider content —— */
@media (min-width: 760px) {
  .faq-body .site-footer {
    display: block;
  }

  .faq-page {
    min-height: auto;
    padding-bottom: 2.5rem;
  }

  .faq-main {
    width: min(560px, 100%);
    max-width: none;
  }
}

/* —— PC browser layout (keeps H5/WebView styles below this breakpoint) —— */
@media (min-width: 960px) {
  body.faq-body {
    font-family: "Outfit", system-ui, -apple-system, sans-serif !important;
    background:
      radial-gradient(ellipse 70% 45% at 50% -10%, rgba(26, 68, 148, 0.18), transparent 55%),
      linear-gradient(180deg, #eef2f8 0%, #f4f7fc 40%, #eef2f8 100%);
    color: var(--ink);
  }

  .faq-page {
    min-height: auto;
    width: min(1080px, calc(100% - 3.5rem));
    margin: 2.25rem auto 0;
    padding:
      1.6rem 2rem 2.25rem;
    border-radius: 1.5rem;
    background:
      radial-gradient(ellipse 80% 55% at 12% -10%, rgba(59, 130, 246, 0.28), transparent 55%),
      radial-gradient(ellipse 55% 45% at 100% 8%, rgba(245, 197, 66, 0.16), transparent 48%),
      linear-gradient(165deg, var(--navy-950) 0%, var(--navy-900) 48%, #0d2a63 100%);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.08) inset,
      0 28px 60px -36px rgba(6, 18, 46, 0.55);
    overscroll-behavior-y: auto;
  }

  .faq-top {
    margin-bottom: 1.75rem;
    padding-bottom: 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .faq-brand img {
    width: 2.85rem;
    height: 2.85rem;
  }

  .faq-name {
    font-family: "Syne", system-ui, sans-serif !important;
    font-size: 1.35rem;
  }

  .faq-tag {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
  }

  .faq-home-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.35rem;
    padding: 0 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    font-family: "Outfit", system-ui, sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
  }

  .faq-home-link:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.36);
    color: #ffffff;
  }

  .faq-lang {
    background: rgba(255, 255, 255, 0.1);
  }

  .faq-lang-btn {
    min-height: 2.25rem;
    min-width: 2.35rem;
    padding: 0.42rem 0.7rem;
    font-size: 0.76rem;
    transition: background 0.2s, color 0.2s;
  }

  .faq-lang-btn:hover:not(.is-active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
  }

  .faq-main {
    width: 100%;
    max-width: none;
  }

  .faq-hero {
    margin-bottom: 1.6rem;
    max-width: 40rem;
  }

  .faq-hero h1 {
    font-family: "Syne", system-ui, sans-serif !important;
    font-size: clamp(2rem, 2.6vw, 2.55rem);
    letter-spacing: -0.03em;
    margin-bottom: 0.7rem;
  }

  .faq-hero p {
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 34rem;
  }

  .faq-tabs {
    margin-bottom: 1.35rem;
    gap: 0.15rem;
  }

  .faq-tab {
    margin: 0 0.5rem 0.5rem 0;
    padding: 0.68rem 1.05rem;
    min-height: 2.65rem;
    font-size: 0.9rem;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  }

  .faq-tab:hover:not(.is-active) {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.42);
  }

  .faq-list {
    display: grid;
    gap: 0.75rem;
  }

  .faq-item {
    margin-bottom: 0;
    border-radius: 1.15rem;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.7) inset,
      0 16px 36px -22px rgba(6, 18, 46, 0.45);
    transition: box-shadow 0.2s, transform 0.2s;
  }

  .faq-item:hover {
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.7) inset,
      0 22px 42px -20px rgba(6, 18, 46, 0.5);
  }

  .faq-q {
    padding: 1.15rem 1.25rem;
    min-height: 3.5rem;
    transition: background 0.15s;
  }

  .faq-q:hover {
    background: rgba(10, 31, 77, 0.03);
  }

  .faq-q-text {
    font-family: "Syne", system-ui, sans-serif !important;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
  }

  .faq-chevron {
    width: 1.7rem;
    height: 1.7rem;
    transition: transform 0.25s var(--ease), background 0.2s, color 0.2s;
  }

  .faq-a {
    padding: 0 1.25rem 1.25rem;
    font-size: 0.98rem;
    line-height: 1.7;
    max-width: 52rem;
  }

  .faq-help {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    text-align: left;
    margin-top: 1.85rem;
    padding: 1.35rem 1.5rem;
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
  }

  .faq-help p {
    margin-bottom: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
  }

  .faq-help-btn {
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    min-height: 2.9rem;
    line-height: 2.9rem;
    padding: 0 1.45rem;
    font-size: 0.95rem;
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
  }

  .faq-help-btn:hover {
    filter: brightness(1.04);
    box-shadow: 0 12px 26px rgba(245, 197, 66, 0.32);
  }

  .faq-help-btn:active {
    transform: scale(0.99);
  }

  .faq-body .site-footer {
    width: min(1080px, calc(100% - 3.5rem));
    margin: 1.5rem auto 2.5rem;
    border-radius: 1.25rem;
    overflow: hidden;
  }
}

@media (min-width: 960px) and (max-width: 1100px) {
  .faq-help {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
}
