/* ============================================================
   Global FAQ + help section
   ------------------------------------------------------------
   Markup:    resources/views/frontend/inc/faq-section.blade.php
   Behaviour: public/frontend/js/faq-section.js
   Self-contained (own tokens and components) so any page can include it.
   Mobile-first. The site resets list margins, so lists are spaced with padding.
   ============================================================ */

.fqs {
    --fq-navy: #061634;
    --fq-navy-2: #0b2a5b;
    --fq-blue: #2563eb;
    --fq-blue-d: #1d4ed8;
    --fq-orange: #f97316;
    --fq-orange-d: #ea580c;
    --fq-green: #16a34a;
    --fq-ink: #0f172a;
    --fq-text: #475569;
    --fq-muted: #64748b;
    --fq-line: #e6ebf3;
    --fq-soft: #f5f8fe;
    --fq-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
    padding: 56px 0;
    background: #fff;
    color: var(--fq-text);
}
.fqs--soft { background: #f7f9fd; }
.fqs *, .fqs *::before, .fqs *::after { box-sizing: border-box; }
.fqs a { text-decoration: none; }
.fqs [hidden] { display: none !important; }
.fqs :focus-visible { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; border-radius: 6px; }
.fqs-sr {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Shared pieces ────────────────────────────────────────── */
.fqs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px;
    border: 1px solid var(--fq-blue);
    border-radius: 10px;
    background: var(--fq-blue);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .2s, border-color .2s, color .2s;
}
.fqs-btn:hover { background: var(--fq-blue-d); border-color: var(--fq-blue-d); color: #fff; }
.fqs-btn--orange { background: var(--fq-orange); border-color: var(--fq-orange); }
.fqs-btn--orange:hover { background: var(--fq-orange-d); border-color: var(--fq-orange-d); }
.fqs-btn--ghost { background: #fff; border-color: var(--fq-line); color: var(--fq-ink); }
.fqs-btn--ghost:hover { background: var(--fq-soft); border-color: #cbd8ee; color: var(--fq-ink); }

.fqs-head { padding-bottom: 0; }
.fqs-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #eff5ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--fq-blue);
}
.fqs-head h2 { margin: 0 0 10px; font-size: clamp(1.5rem, 1.15rem + 1.3vw, 2.2rem); font-weight: 900; line-height: 1.2; letter-spacing: -.01em; color: var(--fq-ink); }
.fqs-head p { margin: 0; font-size: 15.5px; line-height: 1.65; }

.fqs-tabs {
    display: flex;
    align-self: flex-start;
    gap: 4px;
    max-width: 100%;
    padding: 4px;
    overflow-x: auto;
    border: 1px solid var(--fq-line);
    border-radius: 999px;
    background: #fff;
    scrollbar-width: none;
}
.fqs-tabs::-webkit-scrollbar { display: none; }
.fqs-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--fq-muted);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}
.fqs-tab span { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--fq-soft); font-size: 11.5px; line-height: 20px; text-align: center; }
.fqs-tab:hover { color: var(--fq-ink); }
.fqs-tab[aria-pressed="true"] { background: var(--fq-ink); color: #fff; }
.fqs-tab[aria-pressed="true"] span { background: rgba(255, 255, 255, .18); }

/* ── Layout ───────────────────────────────────────────────── */
.fqs-grid { display: grid; gap: 20px; }
/* One column: heading and stats, then the questions, then the help card. */
.fqs-aside { display: contents; }
.fqs-head { order: 1; }
.fqs-stats { order: 2; }
.fqs-main { order: 3; }
.fqs-help { order: 4; }
.fqs-aside,
.fqs-main { min-width: 0; }

.fqs-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.fqs-stats li { flex: 1 1 120px; padding: 12px 14px; border: 1px solid var(--fq-line); border-radius: 14px; background: #fff; }
.fqs-stats b { display: block; font-size: 1.4rem; font-weight: 900; line-height: 1.2; color: var(--fq-ink); }
.fqs-stats span { font-size: 12.5px; font-weight: 600; color: var(--fq-muted); }

/* ── Help card ────────────────────────────────────────────── */
.fqs-help {
    padding: 22px;
    border-radius: 18px;
    color: #fff;
    background:
        radial-gradient(320px 220px at 100% 0, rgba(249, 115, 22, .3), transparent 60%),
        linear-gradient(150deg, var(--fq-navy), var(--fq-navy-2));
    box-shadow: 0 18px 40px rgba(6, 22, 52, .18);
}
.fqs-help__head { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; }
.fqs-help__avatar {
    position: relative;
    flex-shrink: 0;
    width: 48px; height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, .1);
    color: #fdba74;
    font-size: 20px;
}
.fqs-help__dot { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border: 2px solid var(--fq-navy); border-radius: 50%; background: #22c55e; }
.fqs-help h3 { margin: 0 0 2px; font-size: 1.1rem; font-weight: 900; line-height: 1.3; color: #fff; }
.fqs-help__head p { margin: 0; font-size: 13.5px; line-height: 1.5; color: rgba(255, 255, 255, .72); }

.fqs-help__contacts { display: grid; gap: 8px; margin: 0; padding: 0 0 14px; list-style: none; }
.fqs-help__contacts a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    background: rgba(255, 255, 255, .05);
    color: #fff;
    transition: background-color .2s, border-color .2s;
}
.fqs-help__contacts a:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .24); color: #fff; }
.fqs-help__contacts i {
    flex-shrink: 0;
    width: 34px; height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, .1);
    color: #93c5fd;
    font-size: 14px;
}
.fqs-help__contacts .fa-whatsapp { color: #4ade80; font-size: 17px; }
.fqs-help__contacts span { min-width: 0; }
.fqs-help__contacts small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.fqs-help__contacts b { display: block; font-size: 14px; line-height: 1.35; color: #fff; overflow-wrap: anywhere; }
.fqs-help__meta { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 0 0 16px; font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, .7); }
.fqs-help__meta i { margin-top: 3px; color: #fdba74; }
.fqs-help__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fqs-help .fqs-btn--ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: #fff; }
.fqs-help .fqs-btn--ghost:hover { background: rgba(255, 255, 255, .16); }

/* ── Toolbar ──────────────────────────────────────────────── */
.fqs-toolbar { display: flex; flex-direction: column; gap: 10px; padding: 0 0 14px; }
.fqs-search { position: relative; }
.fqs-search i { position: absolute; top: 50%; left: 15px; transform: translateY(-50%); font-size: 13px; color: #94a3b8; pointer-events: none; }
.fqs-search input {
    width: 100%;
    height: 46px;
    margin: 0;
    padding: 0 14px 0 40px;
    border: 1px solid var(--fq-line);
    border-radius: 12px;
    background: #fff;
    color: var(--fq-ink);
    font-size: 14.5px;
    transition: border-color .2s, box-shadow .2s;
}
.fqs-search input:focus { outline: none; border-color: var(--fq-blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }

/* ── Questions ────────────────────────────────────────────── */
.fqs-panel { display: grid; gap: 10px; }
.fqs-item { border: 1px solid var(--fq-line); border-radius: 14px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.fqs-item:hover { border-color: #d3dff2; }
.fqs-item[open] { border-color: #c7d7f3; box-shadow: var(--fq-shadow); }
.fqs-item summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 16px;
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--fq-ink);
    cursor: pointer;
    list-style: none;
}
.fqs-item summary::-webkit-details-marker { display: none; }
.fqs-item__num { flex-shrink: 0; min-width: 24px; font-size: 12px; font-weight: 800; color: #a9bbd8; transition: color .2s; }
.fqs-item__q { flex: 1; min-width: 0; }
.fqs-item summary > i {
    flex-shrink: 0;
    width: 28px; height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--fq-soft);
    color: var(--fq-blue);
    font-size: 12px;
    transition: transform .2s, background-color .2s, color .2s;
}
.fqs-item[open] .fqs-item__num { color: var(--fq-blue); }
.fqs-item[open] summary > i { transform: rotate(45deg); background: var(--fq-blue); color: #fff; }
.fqs-item__a { padding: 0 16px 16px; font-size: 14.5px; line-height: 1.75; overflow-wrap: anywhere; }
.fqs-item__answer > :last-child { margin-bottom: 0; }

.fqs-feedback {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--fq-line);
    font-size: 13px;
    color: var(--fq-muted);
}
.fqs-feedback > span { font-weight: 600; }
.fqs-feedback button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--fq-line);
    border-radius: 999px;
    background: #fff;
    color: var(--fq-text);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s, border-color .2s, color .2s;
}
.fqs-feedback button:hover { border-color: #bfd3fb; color: var(--fq-blue); }
.fqs-feedback button[data-vote="yes"][aria-pressed="true"] { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.fqs-feedback button[data-vote="no"][aria-pressed="true"] { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.fqs-feedback button:disabled { opacity: .6; cursor: progress; }
.fqs-feedback small { font-size: 12.5px; color: var(--fq-muted); }
.fqs-feedback small.is-error { color: #b91c1c; }

.fqs-more { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 6px; }
.fqs-all { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--fq-blue); transition: gap .2s, color .2s; }
.fqs-all:hover { gap: 12px; color: var(--fq-blue-d); }

.fqs-empty { padding: 32px 20px; border: 1px dashed #cfdbee; border-radius: 16px; background: #fff; text-align: center; }
.fqs-empty__icon { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; background: var(--fq-soft); color: var(--fq-blue); font-size: 20px; }
.fqs-empty h3 { margin: 0 0 6px; font-size: 1.1rem; font-weight: 800; color: var(--fq-ink); overflow-wrap: anywhere; }
.fqs-empty p { margin: 0; padding-bottom: 16px; font-size: 14.5px; }
.fqs-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* ── ≥768px ───────────────────────────────────────────────── */
@media (min-width: 768px) {
    .fqs { padding: 72px 0; }
    .fqs-toolbar { flex-direction: row; align-items: center; justify-content: space-between; }
    .fqs-search { flex: 0 1 300px; }
    .fqs-item summary { padding: 16px 20px; }
    .fqs-item__a { padding: 0 20px 18px 56px; }
}

/* ── ≥992px — help beside the questions ───────────────────── */
@media (min-width: 992px) {
    .fqs { padding: 88px 0; }
    .fqs-grid { grid-template-columns: 360px minmax(0, 1fr); align-items: start; gap: 40px; }
    .fqs-aside { display: block; }
    .fqs-head, .fqs-stats { padding-bottom: 20px; }
    .fqs-grid--solo { grid-template-columns: minmax(0, 520px); justify-content: center; }
}

/* Sticky sidebar only when the screen is tall enough to show it whole. */
@media (min-width: 992px) and (min-height: 820px) {
    .fqs-aside { position: sticky; top: 96px; }
}

@media (prefers-reduced-motion: reduce) {
    .fqs *, .fqs *::before, .fqs *::after { transition: none !important; }
}
