/* ================================================================
   DriveSmarter — Shared styles for secondary pages
   (FAQ, Glossary, Terms, Privacy)
   ================================================================ */

/* ===== Page Layout ===== */
.page-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  min-height: 100vh;
}

/* ===== Topbar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-dim);
}

.topbar__brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent-cyan);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.topbar__nav {
  display: flex;
  gap: 20px;
}

.topbar__link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.topbar__link:hover,
.topbar__link--active {
  color: var(--accent-cyan);
}

/* ===== Disclaimer Banner ===== */
.disclaimer-banner {
  background: linear-gradient(135deg, rgba(255, 176, 32, 0.08), rgba(255, 77, 77, 0.06));
  border: 1px solid rgba(255, 176, 32, 0.2);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  margin-bottom: 40px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.disclaimer-banner__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: #ffb020;
  margin-top: 2px;
}

.disclaimer-banner__text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.disclaimer-banner__text strong {
  color: #ffb020;
  font-weight: 600;
}

/* ===== Page Header ===== */
.page-header {
  margin-bottom: 48px;
}

.page-header__title {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header__subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 560px;
}

/* ===== Last updated ===== */
.page-meta {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  margin-top: 8px;
}

/* ===== FAQ Accordion ===== */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
  transition: border-color 0.25s;
}

.faq-item:hover {
  border-color: var(--border-med);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 18px 24px;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: color 0.2s;
}

.faq-question:hover {
  color: var(--accent-cyan);
}

.faq-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: transform 0.3s ease, color 0.3s;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  color: var(--accent-cyan);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}

.faq-item.open .faq-answer {
  max-height: 600px;
  padding: 0 24px 20px;
}

.faq-answer p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.faq-answer p + p {
  margin-top: 10px;
}

.faq-category {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-top: 36px;
  margin-bottom: 12px;
  padding-left: 4px;
}

.faq-category:first-of-type {
  margin-top: 0;
}

/* ===== Glossary ===== */
.glossary-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.glossary-item {
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  padding: 18px 24px;
  transition: border-color 0.2s, transform 0.2s;
}

.glossary-item:hover {
  border-color: var(--border-med);
  transform: translateX(4px);
}

.glossary-term {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 4px;
  font-family: var(--font-mono);
}

.glossary-def {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.glossary-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.glossary-filter__btn {
  padding: 6px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid var(--border-dim);
  border-radius: 100px;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-display);
}

.glossary-filter__btn:hover,
.glossary-filter__btn--active {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(0, 224, 255, 0.06);
}

/* ===== Legal pages (T&C, Privacy) ===== */
.legal-content {
  counter-reset: legal-section;
}

.legal-section {
  margin-bottom: 36px;
  counter-increment: legal-section;
}

.legal-section__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  gap: 12px;
}

.legal-section__title::before {
  content: counter(legal-section, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 224, 255, 0.08);
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 1px;
}

.legal-section p,
.legal-section li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.legal-section p + p {
  margin-top: 10px;
}

.legal-section ul,
.legal-section ol {
  padding-left: 24px;
  margin-top: 8px;
}

.legal-section li + li {
  margin-top: 6px;
}

.legal-section li::marker {
  color: var(--text-dim);
}

.legal-highlight {
  background: rgba(0, 224, 255, 0.06);
  border-left: 3px solid var(--accent-cyan);
  padding: 14px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 16px 0;
}

.legal-highlight p {
  color: var(--text-primary) !important;
  font-weight: 500;
}

/* ===== Footer links for secondary pages ===== */
.footer__links {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.footer__link {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.5px;
}

.footer__link:hover {
  color: var(--accent-cyan);
}

.footer__disclaimer {
  margin-top: 16px;
  font-size: 0.68rem;
  color: var(--text-dim);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  opacity: 0.7;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .page-header__title {
    font-size: 1.8rem;
  }

  .topbar {
    padding: 12px 16px;
    flex-direction: column;
    gap: 10px;
  }

  .topbar__nav {
    gap: 12px;
  }

  .page-container {
    padding: 32px 16px 60px;
  }

  .faq-question {
    font-size: 0.88rem;
    padding: 14px 16px;
  }

  .legal-section__title {
    font-size: 0.95rem;
  }
}

/* ================================================================
   INSIGHTS PAGE — Auth Gate
   ================================================================ */
.insights-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.insights-gate.hidden {
  display: none;
}

.insights-gate__card {
  text-align: center;
  max-width: 460px;
  padding: 48px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
}

.insights-gate__icon {
  color: var(--accent-cyan);
  margin-bottom: 20px;
  opacity: 0.7;
}

.insights-gate__title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.insights-gate__text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.insights-gate__btn {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.insights-gate__fine-print {
  margin-top: 20px;
  font-size: 0.62rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.insights-gate__fine-print a {
  color: var(--accent-cyan);
  text-decoration: none;
}

/* ================================================================
   INSIGHTS PAGE — Content
   ================================================================ */
.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 28px;
}

/* Summary Banner */
.insights-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.insights-banner__stat {
  text-align: center;
  padding: 18px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
}

.insights-banner__value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.insights-banner__value--down {
  color: var(--fuel-color);
}

.insights-banner__label {
  display: block;
  font-size: 0.62rem;
  color: var(--text-dim);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Full-width card (spans both columns) */
.insight-card--full {
  grid-column: 1 / -1;
}

/* Trend badges on leaderboard */
.insight-trend {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.insight-trend--up {
  color: var(--ev-color);
  background: rgba(0, 230, 118, 0.1);
}

.insight-trend--down {
  color: var(--fuel-color);
  background: rgba(255, 77, 77, 0.1);
}

/* Commentary section */
.insight-commentary {
  margin-top: 28px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-cyan);
}

.insight-commentary__title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-cyan);
  margin-bottom: 12px;
}

.insight-commentary p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.insight-commentary ul {
  padding-left: 20px;
  margin: 0;
}

.insight-commentary li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 6px;
}

.insight-commentary li strong {
  color: var(--text-primary);
}

/* ================================================================
   INSIGHTS TEASER — Curiosity Hook (on calculator page)
   ================================================================ */
.insights-teaser {
  margin: 24px 0;
  padding: 0 8px;
}

.insights-teaser.hidden {
  display: none;
}

/* Header */
.insights-teaser__header {
  text-align: center;
  margin-bottom: 20px;
}

.insights-teaser__title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.insights-teaser__subtitle {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* Peek stats — 4 cards, last one blurred */
.insights-teaser__peek {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.teaser-stat {
  text-align: center;
  padding: 16px 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, transform 0.2s;
}

.teaser-stat:hover {
  border-color: rgba(0, 224, 255, 0.15);
  transform: translateY(-2px);
}

.teaser-stat__value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-cyan);
  line-height: 1;
}

.teaser-stat__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 8px;
}

.teaser-stat__detail {
  display: block;
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.3;
}

/* Blurred mystery stat */
.teaser-stat--blurred {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-style: dashed;
}

.teaser-stat--blurred .teaser-stat__value {
  color: rgba(0, 224, 255, 0.3);
  filter: blur(2px);
  font-size: 1.5rem;
}

.teaser-stat--blurred .teaser-stat__label {
  color: var(--text-secondary);
}

.teaser-stat--blurred::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 224, 255, 0.03), rgba(167, 139, 250, 0.03));
  pointer-events: none;
}

.teaser-stat--blurred:hover {
  border-color: rgba(167, 139, 250, 0.3);
}

/* Curiosity questions */
.insights-teaser__questions {
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.8;
}

.teaser-q {
  font-size: 0.72rem;
  font-style: italic;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.teaser-q:hover {
  color: var(--accent-cyan);
}

.teaser-q-sep {
  color: var(--text-dim);
  margin: 0 8px;
  font-size: 0.72rem;
}

/* CTA */
.insights-teaser__cta {
  text-align: center;
}

.insights-teaser__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  padding: 12px 28px;
}

.insights-teaser__note {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .insights-banner {
    grid-template-columns: 1fr 1fr;
  }

  .insights-teaser__peek {
    grid-template-columns: 1fr 1fr;
  }

  .insights-teaser__questions .teaser-q-sep {
    display: none;
  }

  .teaser-q {
    display: block;
  }
}

@media (max-width: 480px) {
  .insights-banner {
    grid-template-columns: 1fr;
  }

  .insights-gate__card {
    padding: 32px 20px;
  }
}
