/* AFMAX Legal & Support pages — additional styles
   Extends styles.css for legal layout, TOC, FAQ accordion
   ====================================================== */

/* ============ LEGAL HERO ============ */
.legal-hero {
  padding: 140px 0 60px;
  background: linear-gradient(180deg, #F1E6DA 0%, #fff 100%);
}
.legal-hero h1 {
  font-family: var(--font-latin);
  font-weight: 800;
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--fg-1);
  margin-bottom: 16px;
}
[dir="rtl"] .legal-hero h1 { font-family: var(--font-arabic); letter-spacing: 0; line-height: 1.4; }
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 14px;
  color: var(--fg-3);
}
.legal-meta span { display: flex; align-items: center; gap: 6px; }
.legal-meta strong { font-weight: 600; color: var(--fg-2); }

/* ============ TRANSLATION NOTICE ============ */
.translation-notice {
  background: var(--afm-soft-green);
  border: 1px solid rgba(37,109,125,.15);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 28px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--afm-deep-teal);
}
[dir="rtl"] .translation-notice { font-family: var(--font-arabic); }

/* ============ LEGAL 2-COL LAYOUT ============ */
.legal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  padding: 48px 0 80px;
  align-items: start;
}
@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr; gap: 0; }
}

/* ============ TOC SIDEBAR ============ */
.toc {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--afm-gray-300) transparent;
}
[dir="rtl"] .toc { padding-right: 0; padding-left: 12px; }
.toc-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 14px;
}
.toc a {
  display: block;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--fg-3);
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: color 0.15s, border-color 0.15s;
  text-decoration: none;
}
[dir="rtl"] .toc a { border-left: none; border-right: 2px solid transparent; padding-left: 0; padding-right: 12px; }
.toc a:hover, .toc a.active { color: var(--accent); border-left-color: var(--accent); }
[dir="rtl"] .toc a:hover, [dir="rtl"] .toc a.active { border-right-color: var(--accent); border-left-color: transparent; }

/* Mobile: TOC as dropdown */
.toc-mobile-toggle {
  display: none;
  width: 100%;
  padding: 14px 18px;
  background: var(--afm-white);
  border: 1px solid var(--afm-border);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-1);
  cursor: pointer;
  margin-bottom: 24px;
  justify-content: space-between;
  align-items: center;
}
@media (max-width: 900px) {
  .toc { position: static; max-height: none; padding: 0; display: none; }
  .toc.open { display: block; margin-bottom: 24px; background: var(--afm-white); border: 1px solid var(--afm-border); border-radius: 14px; padding: 14px; }
  .toc a { padding-left: 8px; }
  [dir="rtl"] .toc a { padding-right: 8px; }
  .toc-mobile-toggle { display: flex; }
}

/* ============ LEGAL CONTENT ============ */
.legal-content {
  min-width: 0;
  font-family: var(--font-latin);
}
[dir="rtl"] .legal-content { font-family: var(--font-arabic); }
.legal-content h2 {
  font-weight: 700;
  font-size: 22px;
  color: var(--fg-1);
  margin: 40px 0 14px;
  padding-top: 20px;
  scroll-margin-top: 100px;
}
.legal-content h2:first-of-type { margin-top: 0; }
.legal-content p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--fg-2);
  margin-bottom: 14px;
}
.legal-content ul {
  margin: 8px 0 16px 22px;
  padding: 0;
}
[dir="rtl"] .legal-content ul { margin-left: 0; margin-right: 22px; }
.legal-content li {
  font-size: 15px;
  line-height: 1.75;
  color: var(--fg-2);
  margin-bottom: 6px;
}
.legal-content .closing {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--afm-border);
  font-weight: 600;
  font-size: 15px;
  color: var(--fg-1);
}

/* ============ SUPPORT PAGE ============ */
.support-hero {
  padding: 140px 0 60px;
  background: linear-gradient(180deg, #F1E6DA 0%, #fff 100%);
  text-align: center;
}
.support-hero h1 {
  font-family: var(--font-latin);
  font-weight: 800;
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -0.02em;
  color: var(--fg-1);
  margin-bottom: 12px;
}
[dir="rtl"] .support-hero h1 { font-family: var(--font-arabic); letter-spacing: 0; }
.support-hero p { font-size: 17px; color: var(--fg-3); max-width: 520px; margin: 0 auto; }
[dir="rtl"] .support-hero p { font-family: var(--font-arabic); }

/* Contact cards */
.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 48px 0;
}
@media (max-width: 700px) { .contact-cards { grid-template-columns: 1fr; } }
.contact-card {
  background: var(--afm-white);
  border: 1px solid var(--afm-border);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow-card);
  text-align: center;
  transition: box-shadow 0.25s, transform 0.25s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.contact-card:hover { box-shadow: var(--shadow-float); transform: translateY(-3px); }
.contact-card-icon {
  width: 54px; height: 54px; border-radius: 17px;
  background: var(--afm-ink);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.contact-card h3 { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; margin-bottom: 8px; }
[dir="rtl"] .contact-card h3 { font-family: var(--font-arabic); }
.contact-card p { font-size: 14px; line-height: 1.6; color: var(--fg-3); margin-bottom: 14px; }
[dir="rtl"] .contact-card p { font-family: var(--font-arabic); }
.contact-card .card-link { font-size: 14px; font-weight: 600; color: var(--accent); }

/* FAQ accordion */
.faq-section { padding: 32px 0 80px; }
.faq-title { font-weight: 800; font-size: 28px; text-align: center; margin-bottom: 32px; }
[dir="rtl"] .faq-title { font-family: var(--font-arabic); }
.faq-item {
  border: 1px solid var(--afm-border);
  border-radius: 18px;
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--afm-white);
  transition: box-shadow 0.2s;
}
.faq-item:hover { box-shadow: var(--shadow-sm); }
.faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg-1);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  gap: 14px;
}
[dir="rtl"] .faq-q { text-align: right; font-family: var(--font-arabic); }
.faq-q .chevron {
  width: 20px; height: 20px; flex-shrink: 0;
  transition: transform 0.25s;
}
.faq-item.open .faq-q .chevron { transform: rotate(180deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq-item.open .faq-a { max-height: 500px; }
.faq-a-inner {
  padding: 0 22px 20px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--fg-2);
}
[dir="rtl"] .faq-a-inner { font-family: var(--font-arabic); }
.faq-a-inner a { color: var(--accent); font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  .faq-a { transition: none; }
  .faq-q .chevron { transition: none; }
}
