/* =========================================================
   باي — الصفحات القانونية (الخصوصية / الشروط / حذف الحساب)
   تُحمَّل بعد style.css وتعتمد متغيراته.
   ========================================================= */

/* شريط التنقل ثابت الخلفية في الصفحات القانونية (لا Hero خلفه) */
.legal-page .navbar {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(15, 23, 42, .06), var(--shadow-sm);
}
.legal-nav { display: flex; align-items: center; gap: 12px; }
.legal-nav .home-link {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--slate-700);
  padding: 8px 12px;
  border-radius: 999px;
  transition: color .25s, background .25s;
}
.legal-nav .home-link:hover { color: var(--primary); background: var(--primary-50); }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--slate-200);
  background: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .92rem;
  color: var(--navy);
  transition: border-color .25s, color .25s;
}
.lang-toggle:hover { border-color: var(--primary); color: var(--primary); }
.lang-toggle svg { width: 18px; height: 18px; }

/* عرض لغة واحدة (بدون JS تظهر اللغتان متتاليتين) */
html[data-lang="ar"] [data-l="en"],
html[data-lang="en"] [data-l="ar"] { display: none !important; }
[data-l="en"] { direction: ltr; text-align: left; }
[data-l="ar"] { direction: rtl; text-align: right; }

/* ---------- رأس الصفحة ---------- */
.legal-hero {
  padding: calc(var(--nav-h) + 56px) 0 48px;
  background:
    radial-gradient(600px 300px at 85% 0%, rgba(59, 130, 246, .14), transparent 70%),
    linear-gradient(180deg, var(--primary-50), var(--bg));
  border-bottom: 1px solid var(--slate-100);
}
.legal-hero h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); margin: 16px 0 10px; }
.legal-hero .lead { color: var(--slate-500); font-size: 1.1rem; max-width: 720px; }
.updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--primary-100);
  color: var(--primary-dark);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .92rem;
}
.updated svg { width: 16px; height: 16px; }

/* ---------- المحتوى ---------- */
.legal-wrap { max-width: 860px; margin-inline: auto; padding: 48px 20px 88px; }

.legal-toc {
  background: var(--bg-soft);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 40px;
}
.legal-toc strong { font-family: var(--font-head); color: var(--navy); display: block; margin-bottom: 10px; }
.legal-toc ol { padding-inline-start: 22px; columns: 2; column-gap: 32px; }
.legal-toc li { margin-bottom: 6px; break-inside: avoid; }
.legal-toc a { color: var(--primary-dark); }
.legal-toc a:hover { text-decoration: underline; }

.legal-body section { scroll-margin-top: calc(var(--nav-h) + 16px); margin-bottom: 40px; }
.legal-body h2 {
  font-size: 1.45rem;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-100);
}
.legal-body h3 { font-size: 1.1rem; font-weight: 700; margin: 22px 0 8px; }
.legal-body p { margin-bottom: 12px; font-size: 1.05rem; }
.legal-body ul, .legal-body ol { padding-inline-start: 24px; margin-bottom: 14px; }
.legal-body ul { list-style: disc; }
.legal-body ol { list-style: decimal; }
.legal-body li { margin-bottom: 8px; font-size: 1.05rem; }
.legal-body li::marker { color: var(--primary); }
.legal-body a { color: var(--primary-dark); font-weight: 700; }
.legal-body a:hover { text-decoration: underline; }
.legal-body strong { color: var(--navy); }

.note {
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-inline-start: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 18px 0;
}
.note p:last-child, .note ul:last-child { margin-bottom: 0; }
.note.warn { background: #FFFBEB; border-color: #FDE68A; border-inline-start-color: var(--warning); }

.table-scroll { overflow-x: auto; margin: 16px 0 20px; border: 1px solid var(--slate-200); border-radius: var(--radius-sm); }
.legal-table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: .98rem; }
.legal-table th, .legal-table td { padding: 12px 16px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--slate-200); }
.legal-table th { background: var(--bg-soft); font-family: var(--font-head); color: var(--navy); font-weight: 700; }
.legal-table tr:last-child td { border-bottom: 0; }

.wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 999px;
  background: #25D366;
  color: #fff !important;
  font-family: var(--font-head);
  font-weight: 700;
  box-shadow: 0 10px 24px -10px rgba(37, 211, 102, .7);
  transition: transform .25s var(--ease);
}
.wa-btn:hover { transform: translateY(-2px); text-decoration: none !important; }
.wa-btn svg { width: 20px; height: 20px; }

/* ---------- نموذج حذف الحساب ---------- */
.form-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px;
  margin-bottom: 48px;
}
.form-card h2 { border: 0; padding: 0; margin-bottom: 6px; }
.form-card .form-sub { color: var(--slate-500); margin-bottom: 24px; }
.field { margin-bottom: 20px; }
.field > label, .field > .label {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}
.field .opt { font-weight: 500; color: var(--slate-400); font-size: .9rem; }
.field input[type="tel"], .field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 1.05rem;
  color: var(--navy);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.field input[type="tel"] { direction: ltr; text-align: left; letter-spacing: .5px; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .15);
}
.field input.invalid { border-color: #DC2626; }
.field .hint { font-size: .9rem; color: var(--slate-500); margin-top: 6px; }
.field .err { font-size: .92rem; color: #DC2626; margin-top: 6px; min-height: 1.2em; }

.role-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.role-choice label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--slate-700);
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.role-choice input { position: absolute; opacity: 0; pointer-events: none; }
.role-choice label:has(input:checked) { border-color: var(--primary); background: var(--primary-50); color: var(--primary-dark); }
.role-choice label:has(input:focus-visible) { box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); }

/* فخّ البوتات: مخفيّ بالقصّ لا بالإزاحة (الإزاحة لليسار تُنشئ تمريراً أفقياً في RTL) */
.hp { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .98rem; cursor: pointer; }
.consent input { margin-top: 6px; width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }

.btn-danger {
  background: #DC2626;
  color: #fff;
  width: 100%;
  box-shadow: 0 12px 28px -10px rgba(220, 38, 38, .55);
}
.btn-danger:hover { transform: translateY(-2px); background: #B91C1C; }
.btn-danger[disabled] { opacity: .6; cursor: not-allowed; transform: none; }

.form-msg { margin-top: 16px; padding: 14px 18px; border-radius: var(--radius-sm); font-weight: 500; display: none; }
.form-msg.show { display: block; }
.form-msg.error { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }

.form-success { text-align: center; padding: 16px 0; display: none; }
.form-success.show { display: block; }
.form-success .tick {
  width: 72px; height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #ECFDF5;
  color: var(--success);
  display: grid; place-items: center;
  font-size: 2rem;
  font-weight: 900;
}
.form-success h3 { font-size: 1.4rem; margin-bottom: 8px; }

/* ---------- تذييل مبسّط ---------- */
.legal-footer { background: var(--navy); color: var(--slate-400); padding: 36px 0; }
.legal-footer .container { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; }
.legal-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.legal-links a { transition: color .25s; }
.legal-links a:hover, .legal-links a[aria-current="page"] { color: #fff; }

/* روابط قانونية في تذييل الصفحة الرئيسية */
.footer-bottom .legal-links { order: 2; }

@media (max-width: 600px) {
  .legal-hero { padding-top: calc(var(--nav-h) + 32px); }
  .legal-toc ol { columns: 1; }
  .form-card { padding: 22px 18px; }
  .legal-nav .home-link { display: none; }
  .legal-footer .container { justify-content: center; text-align: center; }
  .legal-links { justify-content: center; }
}

.field > label.consent { font-family: var(--font-body); font-weight: 500; color: var(--slate-700); margin-bottom: 0; }
