/* ============================================================
   LEGAL PAGES — shared styles
   Applies to: page-faq.php, page-terms.php, page-privacy.php,
               page-refund.php
   ============================================================ */

/* ─── Hero overrides ──────────────────────────────────────── */
.legal-hero .sorig-breadcrumb__title,
.faq-hero .sorig-breadcrumb__title {
  color: #fff !important;
}
.legal-hero .sorig-breadcrumb__kicker,
.faq-hero .sorig-breadcrumb__kicker {
  border-radius: 999px !important;
}

/* ─── Shared page shell ──────────────────────────────────── */
.legal-page-section,
.faq-page-section {
  padding: 72px 0 96px;
  background: #f8f9fc;
}

.legal-page-container {
  width: min(1180px, calc(100% - 40px));
  max-width: none;
  margin-inline: auto;
}

.faq-page-container {
  max-width: 900px;
  margin-inline: auto;
}

/* Effective date stamp */
.legal-effective-date {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 48px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

/* ─── Legal sections ─────────────────────────────────────── */
.legal-section {
  margin-bottom: 52px;
}
.legal-section:last-child {
  margin-bottom: 0;
}

.legal-section__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink-900, #0f172a);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-left: 4px solid var(--color-primary, #1d4ed8);
  padding-left: 14px;
  line-height: 1.3;
}

.legal-section__subtitle {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink-800, #1e293b);
  margin: 24px 0 10px;
}

.legal-section p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink-700, #334155);
  margin-bottom: 14px;
}
.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section a {
  color: var(--color-primary, #1d4ed8);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-section a:hover {
  color: var(--color-primary-dark, #1e40af);
}

/* Lists */
.legal-list {
  margin: 12px 0 18px 0;
  padding-left: 20px;
  list-style: none;
}
.legal-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  font-size: 0.975rem;
  line-height: 1.75;
  color: var(--ink-700, #334155);
}
.legal-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-primary, #1d4ed8);
  flex-shrink: 0;
}

/* Ordered variant */
.legal-list--ordered {
  list-style: none;
  counter-reset: legal-counter;
  padding-left: 0;
}
.legal-list--ordered li {
  counter-increment: legal-counter;
  padding-left: 38px;
}
.legal-list--ordered li::before {
  content: counter(legal-counter);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary, #1d4ed8);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 5px;
  left: 0;
}

/* Contact block at bottom */
.legal-section--contact {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px 36px;
}

.legal-contact-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.legal-contact-list li {
  font-size: 0.975rem;
  line-height: 1.75;
  color: var(--ink-700, #334155);
  margin-bottom: 4px;
}
.legal-contact-list li::before {
  display: none;
}

/* ─── Policy table ───────────────────────────────────────── */
.policy-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.policy-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.925rem;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}

.policy-table thead tr {
  background: var(--color-primary, #1d4ed8);
  color: #fff;
}

.policy-table thead th {
  padding: 14px 18px;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

.policy-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}
.policy-table tbody tr:nth-child(even) {
  background: #f8fafc;
}
.policy-table tbody tr:last-child {
  border-bottom: none;
}
.policy-table tbody tr:hover {
  background: #eff6ff;
}

.policy-table tbody td {
  padding: 13px 18px;
  color: var(--ink-700, #334155);
  line-height: 1.6;
  vertical-align: top;
}

/* Refund status badges */
.refund-positive {
  color: #15803d;
  font-weight: 600;
}
.refund-partial {
  color: #b45309;
  font-weight: 600;
}
.refund-none {
  color: #b91c1c;
  font-weight: 600;
}

.policy-table-note {
  font-size: 0.82rem;
  color: #6b7280;
  margin-top: 8px;
  margin-bottom: 0;
}

/* ─── FAQ Page ───────────────────────────────────────────── */
.faq-empty-notice {
  text-align: center;
  font-size: 1rem;
  color: #6b7280;
  padding: 48px 0;
}

/* FAQ Group */
.faq-group {
  margin-bottom: 48px;
}
.faq-group:last-child {
  margin-bottom: 0;
}

.faq-group__label {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-primary, #1d4ed8);
  background: rgba(29, 78, 216, 0.08);
  border: 1px solid rgba(29, 78, 216, 0.2);
  border-radius: 999px;
  padding: 5px 16px;
  margin-bottom: 20px;
}

.faq-group__items {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

/* FAQ accordion item */
.faq-item {
  border-bottom: 1px solid #e5e7eb;
  transition: background 0.15s;
}
.faq-item:last-child {
  border-bottom: none;
}
.faq-item[open] {
  background: #f8faff;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
  -webkit-user-select: none;
  user-select: none;
  transition: background 0.15s;
}
.faq-question::-webkit-details-marker {
  display: none;
}
.faq-question::marker {
  display: none;
}
.faq-question:hover {
  background: #f0f6ff;
}

.faq-question__text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-900, #0f172a);
  line-height: 1.45;
  flex: 1;
}

/* Animated arrow icon */
.faq-question__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(29, 78, 216, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.2s, transform 0.3s;
}
.faq-question__icon::before,
.faq-question__icon::after {
  content: '';
  position: absolute;
  background: var(--color-primary, #1d4ed8);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
/* Horizontal bar */
.faq-question__icon::before {
  width: 12px;
  height: 2px;
}
/* Vertical bar (forms +, hidden when open) */
.faq-question__icon::after {
  width: 2px;
  height: 12px;
}

.faq-item[open] .faq-question__icon {
  background: var(--color-primary, #1d4ed8);
  transform: rotate(45deg);
}
.faq-item[open] .faq-question__icon::before,
.faq-item[open] .faq-question__icon::after {
  background: #fff;
}

/* Answer content */
.faq-answer {
  padding: 0 24px 22px 24px;
  font-size: 0.97rem;
  line-height: 1.8;
  color: var(--ink-600, #475569);
}
.faq-answer p {
  margin: 0 0 10px;
}
.faq-answer p:last-child {
  margin-bottom: 0;
}
.faq-answer a {
  color: var(--color-primary, #1d4ed8);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .legal-page-section,
  .faq-page-section {
    padding: 48px 0 64px;
  }

  .legal-page-container,
  .faq-page-container {
    padding-inline: 20px;
  }

  .legal-section__title {
    font-size: 1.15rem;
  }

  .legal-section--contact {
    padding: 24px 20px;
  }

  .policy-table-wrapper {
    border-radius: 8px;
  }

  .faq-question {
    padding: 16px 18px;
  }

  .faq-answer {
    padding: 0 18px 18px;
  }

  .faq-question__text {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .legal-section__title {
    font-size: 1.05rem;
    padding-left: 10px;
  }

  .policy-table {
    font-size: 0.825rem;
  }
  .policy-table thead th,
  .policy-table tbody td {
    padding: 10px 12px;
  }
}
