/**
 * FORRE.NU — FAQ-sida ("Hur funkar sidan?")
 * FORRE_DARK: 0 radius, tokens, tw-faq-* prefix. Responsiv.
 */

/* FAQ följer sidans standard 1200px-wrapper (.pb-wrapper) och fyller den helt. */
/* Ta bort sidans nästlade ytter-panel + padding så inget glapp uppstår runt FAQ. */
body.tw-page-faq .tw-page-content {
  padding: 12px;
}

body.tw-page-faq .pb-content-area {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  margin-bottom: 0;
}

.tw-faq {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 20px;
  font-family: var(--font-family), Roboto, sans-serif;
}

/* ── HERO ─────────────────────────────────────────────── */
.tw-faq-hero {
  border: 1px solid var(--border-dark);
  background: var(--surface-2);
  box-shadow: var(--shadow-default);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.tw-faq-hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
}

.tw-faq-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tw-faq-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  border: 1px solid rgba(39, 150, 242, 0.4);
  background: var(--tint-blue);
  padding: 4px 9px;
}

.tw-faq-hero-count {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.tw-faq-hero-title {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 900;
  color: var(--text-primary);
}

.tw-faq-hero-sub {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 720px;
}

/* ── SÖK ──────────────────────────────────────────────── */
.tw-faq-search {
  position: relative;
  display: flex;
  align-items: center;
}

.tw-faq-search > i {
  position: absolute;
  left: 14px;
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.tw-faq-search-input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 40px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--surface-4);
  border: 1px solid var(--border);
  border-radius: 0;
  outline: none;
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.tw-faq-search-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.tw-faq-search-input:focus {
  border-color: var(--primary);
  box-shadow: var(--ring-focus);
}

.tw-faq-search-clear {
  position: absolute;
  right: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 0;
}

.tw-faq-search-clear:hover {
  color: var(--text-primary);
}

/* ── ASK-BOT CTA (hero) ───────────────────────────────── */
.tw-faq-ask-bot {
  margin-top: 14px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--tint-blue);
  border: 1px solid rgba(39, 150, 242, 0.4);
  border-radius: 0;
  cursor: pointer;
  transition: background var(--transition-speed), border-color var(--transition-speed);
}

.tw-faq-ask-bot:hover {
  background: var(--tint-blue-strong);
  border-color: var(--primary);
}

.tw-faq-ask-bot > i:first-child {
  color: var(--primary);
  font-size: 15px;
  flex: 0 0 auto;
}

.tw-faq-ask-bot span {
  flex: 1 1 auto;
}

.tw-faq-ask-bot-arrow {
  flex: 0 0 auto;
  color: var(--primary);
  transition: transform var(--transition-speed);
}

.tw-faq-ask-bot:hover .tw-faq-ask-bot-arrow {
  transform: translateX(3px);
}

/* ── KATEGORI-CHIPS ───────────────────────────────────── */
.tw-faq-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tw-faq-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 0;
  transition: border-color var(--transition-speed), color var(--transition-speed), background var(--transition-speed);
}

.tw-faq-chip i {
  font-size: 12px;
  color: var(--text-muted);
  transition: color var(--transition-speed);
}

.tw-faq-chip:hover {
  border-color: var(--primary);
  color: var(--text-primary);
  background: var(--tint-blue);
}

.tw-faq-chip:hover i {
  color: var(--primary);
}

/* ── SEKTIONER ────────────────────────────────────────── */
.tw-faq-sections {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.tw-faq-section {
  border: 1px solid var(--border-dark);
  background: var(--surface-2);
  box-shadow: var(--shadow-widget);
  scroll-margin-top: calc(var(--navbar-height) + 16px);
}

.tw-faq-section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border-dark);
  background: var(--surface-3);
}

.tw-faq-section-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tint-blue);
  border: 1px solid rgba(39, 150, 242, 0.35);
  color: var(--primary);
  font-size: 16px;
}

.tw-faq-section-headtext {
  min-width: 0;
}

.tw-faq-section-title {
  margin: 0 0 3px;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.tw-faq-section-blurb {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-tertiary);
}

/* ── ITEMS (accordion) ────────────────────────────────── */
.tw-faq-items {
  display: block;
}

.tw-faq-item {
  border-bottom: 1px solid var(--border-dark);
}

.tw-faq-item:last-child {
  border-bottom: none;
}

.tw-faq-q {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background var(--transition-speed);
}

.tw-faq-q::-webkit-details-marker {
  display: none;
}

.tw-faq-q:hover {
  background: var(--surface-3);
}

.tw-faq-q-text {
  flex: 1 1 auto;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}

.tw-faq-q-chev {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-muted);
  transition: transform var(--transition-speed), color var(--transition-speed);
}

.tw-faq-item[open] > .tw-faq-q {
  background: var(--surface-3);
}

.tw-faq-item[open] > .tw-faq-q .tw-faq-q-chev {
  transform: rotate(180deg);
  color: var(--primary);
}

.tw-faq-item[open] > .tw-faq-q .tw-faq-q-text {
  color: var(--primary);
}

.tw-faq-a {
  padding: 2px 16px 16px;
  animation: tw-faq-reveal 0.16s ease;
}

@keyframes tw-faq-reveal {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

.tw-faq-a-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* ── STEG ─────────────────────────────────────────────── */
.tw-faq-steps {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: tw-faq-step;
  display: grid;
  gap: 8px;
}

.tw-faq-steps li {
  counter-increment: tw-faq-step;
  position: relative;
  padding: 8px 12px 8px 42px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  background: var(--surface-3);
  border: 1px solid var(--border-dark);
}

.tw-faq-steps li::before {
  content: counter(tw-faq-step);
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: var(--primary);
  background: var(--tint-blue);
  border: 1px solid rgba(39, 150, 242, 0.4);
  font-variant-numeric: tabular-nums;
}

/* ── EXEMPEL-RUTA ─────────────────────────────────────── */
.tw-faq-example {
  margin-top: 12px;
  border: 1px solid var(--border);
  background: var(--surface-1);
}

.tw-faq-example-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: var(--surface-3);
  border-bottom: 1px solid var(--border-dark);
}

.tw-faq-example-label i {
  color: var(--primary);
}

.tw-faq-example-body {
  margin: 0;
  padding: 12px;
  font-family: var(--font-family), Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── TIPS ─────────────────────────────────────────────── */
.tw-faq-tip {
  margin: 12px 0 0;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
  background: var(--tint-warning);
  border: 1px solid rgba(245, 158, 11, 0.32);
}

.tw-faq-tip i {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--warning);
  font-size: 13px;
}

.tw-faq-tip strong {
  color: var(--text-primary);
}

/* ── NO RESULTS ───────────────────────────────────────── */
.tw-faq-noresults {
  margin-top: 18px;
  padding: 32px 20px;
  text-align: center;
  border: 1px dashed var(--border);
  background: var(--surface-2);
}

.tw-faq-noresults > i {
  font-size: 28px;
  color: var(--text-muted);
  opacity: 0.5;
}

.tw-faq-noresults-title {
  margin: 12px 0 4px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.tw-faq-noresults-sub {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.tw-faq-noresults-btn,
.tw-faq-foot-bot-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 0;
  cursor: pointer;
  transition: background var(--transition-speed);
}

.tw-faq-noresults-btn:hover,
.tw-faq-foot-bot-btn:hover {
  background: var(--primary-hover);
}

/* ── FOOT ─────────────────────────────────────────────── */
.tw-faq-foot {
  margin-top: 18px;
}

.tw-faq-foot-bot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(39, 150, 242, 0.35);
  background: var(--tint-blue);
}

.tw-faq-foot-bot > i {
  flex: 0 0 auto;
  font-size: 24px;
  color: var(--primary);
}

.tw-faq-foot-bot-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tw-faq-foot-bot-text strong {
  font-size: 14px;
  color: var(--text-primary);
}

.tw-faq-foot-bot-text span {
  font-size: 13px;
  color: var(--text-secondary);
}

.tw-faq-foot-bot-btn {
  flex: 0 0 auto;
}

.tw-faq-foot-contact {
  margin: 12px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
}

.tw-faq-foot-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.tw-faq-foot-link:hover {
  text-decoration: underline;
}

/* ── RESPONSIVT ───────────────────────────────────────── */
@media (max-width: 768px) {
  .tw-faq {
    padding: 14px;
  }

  .tw-faq-hero {
    padding: 18px;
  }

  .tw-faq-hero-title {
    font-size: 23px;
  }

  .tw-faq-ask-bot {
    font-size: 12.5px;
  }

  .tw-faq-foot-bot {
    flex-wrap: wrap;
  }

  .tw-faq-foot-bot-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .tw-faq-hero-title {
    font-size: 20px;
  }

  .tw-faq-q-text {
    font-size: 14px;
  }

  .tw-faq-chip {
    font-size: 11px;
    padding: 7px 10px;
  }
}
