/* ═══════════════════════════════════════════════════════════════
   AHMAD MOTIVATION — Legal / compliance pages + shared legal footer
   Dark / gold premium identity · Arabic RTL · responsive.
   Standalone (does not depend on am-theme.css). Loaded after
   styles.css on the legal pages, and provides .legal-footer used
   both on the legal pages and injected site-wide by am-shell.js.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --lg-bg: #0b0f19;
  --lg-panel: #121622;
  --lg-gold: #ffd700;
  --lg-gold-soft: #d4af37;
  --lg-ink: #0b0f19;
  --lg-text: #d7d3c6;
  --lg-strong: #f4efe0;
  --lg-muted: #9b957e;
  --lg-line: rgba(212, 175, 55, 0.22);
}

body.legal-body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 80% -8%, rgba(212, 175, 55, 0.08), transparent 55%),
    radial-gradient(700px 480px at 4% 6%, rgba(40, 60, 130, 0.10), transparent 60%),
    var(--lg-bg);
  color: var(--lg-text);
  font-family: 'Tajawal', 'Cairo', 'Poppins', sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Top bar ─── */
.legal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--lg-line);
  background: rgba(9, 12, 20, 0.6);
  backdrop-filter: blur(6px);
}
.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.legal-brand img { width: 34px; height: 34px; }
.legal-brand span {
  font-weight: 800;
  font-size: 18px;
  color: var(--lg-gold);
  letter-spacing: 0.3px;
}
.legal-back {
  color: var(--lg-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border: 1px solid var(--lg-line);
  border-radius: 10px;
  transition: 0.2s;
}
.legal-back:hover { color: var(--lg-gold); border-color: var(--lg-gold); }

/* ─── Page container ─── */
.legal-page {
  flex: 1;
  width: min(880px, 100%);
  margin: 0 auto;
  padding: clamp(26px, 5vw, 56px) clamp(16px, 4vw, 32px) 60px;
  box-sizing: border-box;
}

.legal-hero {
  border: 1px solid var(--lg-line);
  border-radius: 20px;
  padding: 30px 32px;
  margin-bottom: 26px;
  background:
    radial-gradient(500px 220px at 92% 0%, rgba(212, 175, 55, 0.12), transparent 55%),
    linear-gradient(135deg, #12151f, #0b0f19);
  position: relative;
  overflow: hidden;
}
.legal-hero::before {
  content: '';
  position: absolute; top: 0; right: 0; left: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--lg-gold) 45%, var(--lg-gold-soft), transparent);
}
.legal-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
  color: var(--lg-strong);
}
.legal-hero p {
  margin: 0;
  color: var(--lg-muted);
  font-size: 14px;
  line-height: 1.8;
}
.legal-updated {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  color: var(--lg-gold);
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--lg-line);
  border-radius: 999px;
  padding: 5px 13px;
}

/* ─── Sections ─── */
.legal-section {
  border: 1px solid rgba(212, 175, 55, 0.14);
  border-radius: 16px;
  padding: 24px 26px;
  margin-bottom: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.022), rgba(255, 255, 255, 0.004));
}
.legal-section h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 800;
  color: var(--lg-gold);
  display: flex;
  align-items: center;
  gap: 10px;
}
.legal-section h2::before {
  content: '';
  width: 5px; height: 18px; border-radius: 3px;
  background: linear-gradient(180deg, var(--lg-gold), var(--lg-gold-soft));
  flex-shrink: 0;
}
.legal-section h3 {
  margin: 18px 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--lg-strong);
}
.legal-section p { margin: 0 0 12px; line-height: 2; font-size: 14.5px; }
.legal-section ul { margin: 0 0 12px; padding-inline-start: 22px; }
.legal-section li { line-height: 1.95; font-size: 14.5px; margin-bottom: 6px; }
.legal-section a { color: var(--lg-gold); }
.legal-section strong { color: var(--lg-strong); }

/* Editable placeholder — obvious but intentional-looking */
.legal-ph {
  color: #ffdf7a;
  background: rgba(212, 175, 55, 0.10);
  border: 1px dashed rgba(212, 175, 55, 0.45);
  border-radius: 6px;
  padding: 1px 8px;
  font-weight: 700;
  white-space: nowrap;
}

/* Callout note */
.legal-note {
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-right: 4px solid var(--lg-gold);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 4px 0 12px;
  background: rgba(212, 175, 55, 0.06);
  font-size: 14px;
  line-height: 1.9;
  color: var(--lg-strong);
}

/* Contact grid */
.legal-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 6px;
}
.legal-contact-card {
  border: 1px solid rgba(212, 175, 55, 0.16);
  border-radius: 14px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.02);
}
.legal-contact-card .lbl { font-size: 12px; color: var(--lg-muted); margin-bottom: 6px; font-weight: 700; }
.legal-contact-card .val { font-size: 15px; color: var(--lg-strong); font-weight: 700; }
.legal-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.legal-chip {
  display: inline-flex;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--lg-gold);
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--lg-line);
}

/* ─── Pricing cards ─── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 6px;
}
.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 18px;
  padding: 26px 24px;
  background:
    radial-gradient(400px 180px at 92% 0%, rgba(212, 175, 55, 0.10), transparent 55%),
    linear-gradient(135deg, #12151f, #0b0f19);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.pricing-card:hover {
  transform: translateY(-5px);
  border-color: var(--lg-gold);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 24px rgba(212, 175, 55, 0.08);
}
.pricing-card.featured {
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.25), 0 16px 44px rgba(0, 0, 0, 0.4);
}
.pricing-badge {
  position: absolute;
  top: 14px;
  inset-inline-start: 16px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: var(--lg-ink);
  background: linear-gradient(135deg, #ffd700, #d4af37);
}
.pricing-name {
  font-size: 1.25em;
  font-weight: 800;
  color: var(--lg-strong);
  margin-bottom: 10px;
}
.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.14);
}
.pricing-price .amount {
  color: var(--lg-gold);
  font-size: 1.35em;
  font-weight: 800;
}
.pricing-includes {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.pricing-includes li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--lg-text);
  font-size: 14px;
  line-height: 1.6;
}
.pricing-includes li::before {
  content: '✓';
  color: var(--lg-gold);
  font-weight: 800;
  flex-shrink: 0;
}
.pricing-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: auto;
}
.pricing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: 0.2s;
}
.pricing-btn.primary {
  color: var(--lg-ink);
  background: linear-gradient(135deg, #ffd700, #d4af37);
  border: 0;
}
.pricing-btn.primary:hover { filter: brightness(1.06); }
.pricing-btn.ghost {
  color: var(--lg-strong);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--lg-line);
}
.pricing-btn.ghost:hover { border-color: var(--lg-gold); color: var(--lg-gold); }
.pricing-btn.pricing-disabled {
  pointer-events: none;
  cursor: default;
}

/* ─── CTA button row (public/course pages) ─── */
.am-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 22px 0 4px;
}
.am-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  font-family: 'Tajawal', 'Cairo', sans-serif;
  transition: 0.2s;
}
.am-cta-btn.gold {
  color: #1a1405;
  background: linear-gradient(135deg, #ffd700, #d4af37);
  border: 0;
  box-shadow: 0 8px 22px rgba(212, 175, 55, 0.28);
}
.am-cta-btn.gold:hover { filter: brightness(1.06); }
.am-cta-btn.outline {
  color: #f0c764;
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.4);
}
.am-cta-btn.outline:hover { background: rgba(212, 175, 55, 0.14); }

/* ─── Shared legal footer (also injected by am-shell.js) ─── */
.legal-footer {
  border-top: 1px solid var(--lg-line);
  background: rgba(9, 12, 20, 0.72);
  padding: 26px clamp(16px, 4vw, 40px) 22px;
  margin-top: 30px;
}
.legal-footer-inner {
  width: min(1100px, 100%);
  margin: 0 auto;
}
.legal-footer-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--lg-gold);
  margin-bottom: 12px;
}
.legal-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 14px;
}
.legal-footer-links a {
  color: var(--lg-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.2s;
}
.legal-footer-links a:hover { color: var(--lg-gold); }
.legal-footer-copy {
  font-size: 12px;
  color: var(--lg-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 12px;
}

/* When injected inside the subscriber app column, keep it flush */
.dashboard-main .legal-footer {
  border-radius: 16px;
  border: 1px solid var(--lg-line);
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.015);
}

@media (max-width: 600px) {
  .legal-hero { padding: 22px 18px; }
  .legal-section { padding: 18px 16px; }
}
