/* Legal pages (/terms, /en/terms) in the homepage design language: the same
   tokens, header, mobile menu, buttons and footer as public/index.html and
   public/en/index.html, plus a reading layout for long legal text. Homepage
   rules are copied, not shared, because the homepage keeps its CSS inline. */

:root {
  --jn-black: #070707;
  --jn-ink: #11100f;
  --jn-muted: #6f6d67;
  --jn-soft: #efeee8;
  --jn-cream: #f8f7f2;
  --jn-white: #ffffff;
  --jn-line: rgba(17, 16, 15, 0.12);
  --jn-green: #044c40;
  --jn-green-2: #0d7a68;
  --jn-sage: #c4e3c1;
  --font-sans: "IBM Plex Sans Arabic", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --jn-serif: "Lora", Georgia, serif;
  --jn-sans: var(--font-sans);
}
html[lang="ar"] { --jn-serif: "Noto Naskh Arabic", "IBM Plex Sans Arabic", serif; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--jn-ink);
  background: var(--jn-white);
  font-family: var(--jn-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { border: 0; padding: 0; color: inherit; background: none; cursor: pointer; }
img, video { display: block; max-width: 100%; }

.section-shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.section-shell.wide { width: min(1320px, calc(100% - 32px)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 13px 26px; border-radius: 15px;
  font-size: 15px; font-weight: 700; line-height: 1;
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1), background 160ms cubic-bezier(0.22, 1, 0.36, 1), color 160ms cubic-bezier(0.22, 1, 0.36, 1);
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--jn-green-2); outline-offset: 4px; }
.btn.light { background: var(--jn-white); color: var(--jn-black); }
.btn.light:hover { background: var(--jn-sage); }

/* Header (homepage .join-nav, sitting on the dark title band) */
.join-mobile-panel { display: none; }
.join-nav { position: absolute; inset-inline: 0; top: 0; z-index: 4; display: flex; align-items: center; justify-content: center; padding: 24px 32px; }
.join-nav-inner { width: min(1120px, 100%); display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 20px; }
.join-logo img { height: 30px; width: auto; filter: brightness(0) invert(1); }
.join-links { display: flex; justify-content: center; gap: 18px; color: rgba(255,255,255,0.86); font-size: 13px; font-weight: 600; white-space: nowrap; }
.join-links a:hover { color: var(--jn-white); }
.join-actions { display: flex; align-items: center; gap: 14px; }
.join-lang { color: rgba(255,255,255,0.84); font-size: 14px; font-weight: 600; white-space: nowrap; }
.join-lang:hover { color: var(--jn-white); }
.join-menu-btn { display: none; width: 44px; height: 44px; border-radius: 999px; background: rgba(255,255,255,0.14); color: var(--jn-white); align-items: center; justify-content: center; }
.join-menu-btn span, .join-menu-btn span::before, .join-menu-btn span::after { content: ""; display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.join-menu-btn span::before { transform: translateY(-6px); }
.join-menu-btn span::after { transform: translateY(4px); }

/* Title band: the homepage hero frame, solid green instead of video */
.legal-hero {
  position: relative;
  margin: 12px;
  border-radius: 28px;
  background: var(--jn-green);
  color: var(--jn-white);
  overflow: hidden;
}
.legal-hero-content { padding: 150px 24px 84px; text-align: center; }
.legal-hero h1 {
  max-width: 820px; margin: 0 auto;
  font-family: var(--jn-serif); font-size: clamp(40px, 5.4vw, 68px); font-weight: 600; line-height: 1.02;
  text-wrap: balance;
}
.legal-hero p { max-width: 620px; margin: 20px auto 0; color: rgba(255,255,255,0.78); font-size: clamp(16px, 1.6vw, 19px); line-height: 1.7; }
.legal-dates { margin-top: 26px !important; color: rgba(255,255,255,0.6) !important; font-size: 13px !important; }
.legal-dates strong { color: rgba(255,255,255,0.82); font-weight: 600; }

/* Reading layout */
.legal-body { width: min(760px, calc(100% - 40px)); margin: 0 auto; padding: 72px 0 96px; }
.legal-summary { margin: 0 0 56px; padding: 32px 34px; border-radius: 24px; background: var(--jn-cream); }
.legal-summary h2 { margin: 0 0 18px; font-family: var(--jn-serif); font-size: 28px; font-weight: 600; line-height: 1.15; }
.legal-summary ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.legal-summary li { position: relative; padding-inline-start: 34px; color: var(--jn-ink); font-size: 16px; line-height: 1.65; }
.legal-summary li::before {
  content: "✓"; position: absolute; inset-inline-start: 0; top: 2px;
  width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 50%; background: var(--jn-green); color: var(--jn-white); font-size: 12px; font-weight: 700;
}
.legal-summary strong { font-weight: 700; }
.legal-body > h2 {
  margin: 48px 0 14px;
  font-family: var(--jn-serif); font-size: clamp(24px, 2.6vw, 30px); font-weight: 600; line-height: 1.2;
}
.legal-body > p, .legal-body > ul li { color: #3d3b37; font-size: 16.5px; line-height: 1.8; }
.legal-body > p { margin: 0 0 16px; }
.legal-body > ul { margin: 0 0 16px; padding-inline-start: 22px; }
.legal-body > ul li { margin-bottom: 10px; }
.legal-body > ul li::marker { color: var(--jn-green-2); }
.legal-body strong { color: var(--jn-ink); }
.legal-body a { color: var(--jn-green); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(4, 76, 64, 0.35); }
.legal-body a:hover { text-decoration-color: currentColor; }

/* Footer (homepage .join-footer) */
.join-footer { padding: 70px 0 34px; color: var(--jn-white); background: var(--jn-black); }
.footer-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.footer-logo img { height: 32px; width: auto; filter: brightness(0) invert(1); }
.footer-tag { max-width: 280px; margin: 22px 0 0; color: rgba(255,255,255,0.62); font-size: 14px; line-height: 1.7; }
.join-footer h3 { margin: 0 0 18px; color: rgba(255,255,255,0.52); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.join-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.join-footer a { color: rgba(255,255,255,0.82); font-size: 14px; font-weight: 600; }
.join-footer a:hover { color: var(--jn-white); }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding-top: 26px; color: rgba(255,255,255,0.62); font-size: 13px; }

@media (max-width: 1100px) {
  .join-nav-inner { grid-template-columns: 1fr auto; }
  .join-links, .join-actions .join-lang, .join-actions .btn { display: none; }
  .join-menu-btn { display: inline-flex; }
  .join-mobile-panel {
    position: fixed; inset: 12px; z-index: 100; display: none;
    padding: 78px 24px 24px; border-radius: 24px;
    background: var(--jn-black); color: var(--jn-white);
    max-height: calc(100svh - 24px); overflow-y: auto;
  }
  .join-mobile-panel.open { display: block; }
  .join-mobile-panel nav { display: grid; gap: 4px; }
  .join-mobile-panel a { display: block; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.12); color: rgba(255,255,255,0.86); font-size: 18px; font-weight: 700; line-height: 1.2; }
  .join-mobile-panel .btn { width: 100%; min-height: 46px; margin-top: 18px; border-bottom: 0; color: var(--jn-black); }
  .join-mobile-close { position: absolute; top: 20px; inset-inline-end: 20px; width: 44px; height: 44px; border-radius: 999px; background: rgba(255,255,255,0.12); color: var(--jn-white); font-size: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .section-shell, .section-shell.wide { width: min(100% - 28px, 1120px); }
  .legal-hero { margin: 8px; border-radius: 22px; }
  .join-nav { padding: 18px; }
  .legal-hero-content { padding: 104px 18px 56px; }
  .legal-body { width: min(100% - 28px, 760px); padding: 48px 0 72px; }
  .legal-summary { padding: 24px 20px; border-radius: 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
