/* ============================================================
   دفع المولدات · Molidat Pay — Privacy Policy
   Clean, modern, high-trust documentation layout.
   - Warm near-white canvas; hairline borders do the structural
     work; the brand red (#AA1B17) is a precise accent, not a wash.
   - Sticky sidebar table of contents with scroll-spy on desktop;
     native disclosure on mobile.
   - Fully bilingual: Cairo drives Arabic (rtl), Inter drives the
     Latin (ltr). Everything mirrors via CSS logical properties.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* brand */
  --primary:       #AA1B17;
  --primary-dark:  #8E1612;
  --primary-deep:  #6E110E;
  --wash:          #FBEDEC;
  --wash-strong:   #F7E9E8;

  /* surfaces & ink */
  --bg:            #FDFBFA;
  --surface:       #FFFFFF;
  --ink:           #2D2B2B;
  --ink-soft:      #54514F;
  --muted:         #877F7C;
  --line:          #ECE5E3;
  --line-strong:   #DFD6D3;

  /* shape & depth (restrained) */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(46, 16, 14, 0.04);
  --shadow-md: 0 8px 30px -12px rgba(110, 17, 14, 0.16);

  /* layout */
  --maxw: 1180px;
  --content-maxw: 760px;
  --topbar-h: 64px;
  --gutter: clamp(20px, 5vw, 56px);

  /* type */
  --font-ar: 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-en: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --lh: 1.78;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: var(--font-ar);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 24px);
  -webkit-text-size-adjust: 100%;
}
html[lang="en"] { font-family: var(--font-en); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* warm, near-invisible page tint for depth without "gradient slop" */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 520px at 100% -10%, var(--wash) 0%, transparent 60%),
    radial-gradient(900px 480px at 0% -8%, #FFF6F5 0%, transparent 55%);
  opacity: 0.7;
  pointer-events: none;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; }

img { max-width: 100%; display: block; }

::selection { background: var(--wash-strong); color: var(--primary-deep); }

:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Reading progress (the one flourish) ---------- */
.progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 3px;
  z-index: 60;
  background: transparent;
  pointer-events: none;
}
.progress__bar {
  block-size: 100%;
  inline-size: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-deep));
  transition: inline-size 0.08s linear;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  transform: translateY(-160%);
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  z-index: 100;
  font-weight: 600;
  transition: transform 0.18s ease;
}
.skip-link:focus { transform: translateY(0); text-decoration: none; color: #fff; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  block-size: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-inline: var(--gutter);
  background: rgba(253, 251, 250, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-block-end: 1px solid var(--line);
}
.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}
.topbar__brand:hover { text-decoration: none; color: var(--ink); }
.topbar__logo {
  inline-size: 38px;
  block-size: 38px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.topbar__name {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.topbar__name > span { font-weight: 700; font-size: 0.98rem; letter-spacing: -0.01em; }
.topbar__name small { color: var(--muted); font-size: 0.74rem; font-weight: 500; }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 16px;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s, box-shadow 0.18s;
}
.lang-toggle svg { inline-size: 17px; block-size: 17px; color: var(--primary); }
.lang-toggle:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding-block: clamp(48px, 8vw, 92px) clamp(36px, 6vw, 64px);
  padding-inline: var(--gutter);
  max-inline-size: 760px;
  margin-inline: auto;
}
.hero__logo-wrap {
  inline-size: 84px;
  block-size: 84px;
  margin-inline: auto;
  margin-block-end: 26px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
  position: relative;
}
.hero__logo-wrap img { inline-size: 60px; block-size: 60px; border-radius: 15px; }

.hero__eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
  margin-block-end: 14px;
}
.hero__title {
  font-size: clamp(2rem, 5.5vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}
html[lang="ar"] .hero__title { letter-spacing: 0; line-height: 1.25; }
.hero__subtitle {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: 600;
  color: var(--primary-dark);
  margin-block-start: 8px;
}
.hero__tagline {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-inline-size: 56ch;
  margin-inline: auto;
  margin-block-start: 18px;
  text-wrap: pretty;
}
.hero__date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-block-start: 26px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.hero__date svg { inline-size: 16px; block-size: 16px; color: var(--primary); }

/* ---------- Page layout: sidebar + content ---------- */
.layout {
  max-inline-size: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block-end: 40px;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 4vw, 56px);
}
@media (min-width: 1024px) {
  .layout {
    grid-template-columns: 248px minmax(0, 1fr);
    align-items: start;
  }
}

/* ---------- Sidebar TOC ---------- */
.toc {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
@media (min-width: 1024px) {
  .toc {
    position: sticky;
    inset-block-start: calc(var(--topbar-h) + 20px);
    max-block-size: calc(100vh - var(--topbar-h) - 40px);
    display: flex;
    flex-direction: column;
    border-radius: var(--r-lg);
  }
}
.toc__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.toc__summary::-webkit-details-marker { display: none; }
.toc__summary svg.lead { inline-size: 18px; block-size: 18px; color: var(--primary); }
.toc__summary .chev {
  inline-size: 18px; block-size: 18px;
  margin-inline-start: auto;
  color: var(--muted);
  transition: transform 0.2s ease;
}
.toc[open] .toc__summary .chev { transform: rotate(180deg); }

.toc__list {
  list-style: none;
  padding: 6px;
  border-block-start: 1px solid var(--line);
  overflow-y: auto;
  scrollbar-width: thin;
}
.toc__list a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  transition: background 0.15s, color 0.15s;
}
.toc__list a:hover { background: var(--wash); color: var(--primary-dark); text-decoration: none; }
.toc__list a .n {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-inline-size: 1.4em;
}
.toc__list a.active {
  background: var(--wash);
  color: var(--primary-dark);
  font-weight: 700;
}
.toc__list a.active .n { color: var(--primary); }

@media (min-width: 1024px) {
  /* On desktop the disclosure stays open; hide the toggle affordance. */
  .toc__summary { cursor: default; }
  .toc__summary .chev { display: none; }
}

/* ---------- Content column ---------- */
.content { max-inline-size: var(--content-maxw); inline-size: 100%; }

/* Flowing section — no boxed card; a hairline divider between */
.section {
  padding-block: clamp(28px, 4vw, 44px);
  border-block-end: 1px solid var(--line);
}
.section:first-of-type { padding-block-start: 4px; }

.section__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-block-end: 18px;
}
.section__num {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  padding-block-start: 4px;
}
.section__title {
  font-size: clamp(1.32rem, 3vw, 1.72rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--ink);
}
html[lang="ar"] .section__title { letter-spacing: 0; }

.section__body > * + * { margin-block-start: 1rem; }
.section__body p { color: var(--ink-soft); text-wrap: pretty; }

.subhead {
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--ink);
  margin-block-start: 1.6rem !important;
  margin-block-end: 0.4rem;
}

/* ---------- Lists ---------- */
.list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.list li {
  position: relative;
  padding-inline-start: 30px;
  color: var(--ink-soft);
}
.list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 4px;
  inset-block-start: 0.62em;
  inline-size: 7px;
  block-size: 7px;
  border-radius: 3px;
  background: var(--primary);
  transform: rotate(45deg);
}
/* "Does not collect" list — red ✕ markers */
.list--cross li::before {
  content: "";
  inset-block-start: 0.34em;
  inset-inline-start: 2px;
  inline-size: 18px;
  block-size: 18px;
  border-radius: 50%;
  background: var(--wash);
  transform: none;
}
.list--cross li::after {
  content: "";
  position: absolute;
  inset-inline-start: 7px;
  inset-block-start: 0.62em;
  inline-size: 8px;
  block-size: 8px;
  background:
    linear-gradient(45deg, transparent 42%, var(--primary) 42% 58%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, var(--primary) 42% 58%, transparent 58%);
}

/* ---------- Callout / notice ---------- */
.callout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--wash);
  border: 1px solid #F2D9D6;
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-block-start: 1.2rem !important;
}
.callout p { color: var(--primary-deep); font-size: 0.97rem; }
.callout a { color: var(--primary-dark); font-weight: 700; }
.callout__icon {
  flex: none;
  inline-size: 36px;
  block-size: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--primary);
  border: 1px solid #F2D9D6;
}
.callout__icon svg { inline-size: 19px; block-size: 19px; }
.callout--warn { background: #FFF6E9; border-color: #F3E1C0; }
.callout--warn p { color: #7A4D08; }
.callout--warn .callout__icon { color: #B57708; border-color: #F3E1C0; }

/* ---------- Permission / feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-block-start: 1.2rem;
}
@media (min-width: 560px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
}
.feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.feature:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.feature__icon {
  flex: none;
  inline-size: 42px;
  block-size: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--wash);
  color: var(--primary);
}
.feature__icon svg { inline-size: 21px; block-size: 21px; }
.feature__title { font-weight: 700; color: var(--ink); margin-block-end: 4px; }
.feature__desc { font-size: 0.92rem; color: var(--ink-soft); line-height: 1.65; }

/* ---------- Account deletion (prominent) ---------- */
.danger {
  scroll-margin-block-start: calc(var(--topbar-h) + 24px);
  border: 1.5px solid #EBC4C1;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  margin-block: clamp(28px, 4vw, 44px);
}
.danger__banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px clamp(20px, 4vw, 30px);
  background: linear-gradient(120deg, var(--primary), var(--primary-deep));
  color: #fff;
}
.danger__icon {
  flex: none;
  inline-size: 48px;
  block-size: 48px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.danger__icon svg { inline-size: 24px; block-size: 24px; color: #fff; }
.danger__num {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  margin-block-end: 2px;
}
.danger__banner h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 800; line-height: 1.2; }
.danger__body { padding: clamp(20px, 4vw, 30px); }
.danger__body > * + * { margin-block-start: 1rem; }
.danger__body > p { color: var(--ink-soft); }

/* numbered steps */
.steps {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-block-start: 0.6rem;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 14px 16px;
  padding-inline-start: 56px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 0.96rem;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 14px;
  inset-block-start: 50%;
  transform: translateY(-50%);
  inline-size: 28px;
  block-size: 28px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

/* deleted / retained split */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-block-start: 1.4rem !important;
}
@media (min-width: 620px) { .split { grid-template-columns: 1fr 1fr; } }
.subcard {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  background: var(--surface);
}
.subcard__title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  color: var(--ink);
  margin-block-end: 12px;
  font-size: 0.96rem;
}
.subcard__title svg { inline-size: 18px; block-size: 18px; }
.subcard--del { background: var(--wash); border-color: #F2D9D6; }
.subcard--del .subcard__title { color: var(--primary-dark); }
.subcard--del .list li::before { background: var(--primary); }
.subcard--retain .subcard__title { color: var(--ink); }
.subcard--retain .list li::before { background: var(--muted); }

/* ---------- Contact cards ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-block-start: 1.2rem;
}
@media (min-width: 560px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px;
  background: var(--surface);
  text-align: center;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.contact-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.contact-card__icon {
  inline-size: 48px;
  block-size: 48px;
  margin-inline: auto;
  margin-block-end: 14px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--wash);
  color: var(--primary);
}
.contact-card__icon svg { inline-size: 23px; block-size: 23px; }
.contact-card__label { font-weight: 700; color: var(--ink); font-size: 1.02rem; }
.contact-card__desc { color: var(--muted); font-size: 0.9rem; margin-block: 6px 14px; }
.contact-card__email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: var(--r-pill);
  border: 1px solid #F2D9D6;
  background: var(--wash);
  color: var(--primary-dark);
  font-size: 0.92rem;
}
.contact-card__email:hover { background: var(--wash-strong); text-decoration: none; }
.contact-card__email svg { inline-size: 16px; block-size: 16px; }

/* ---------- Consent notice ---------- */
.consent {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-block-start: clamp(28px, 4vw, 44px);
  padding: 24px clamp(20px, 4vw, 28px);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--wash-strong), #FFF7F6);
  border: 1px solid #F2D9D6;
}
.consent__icon {
  flex: none;
  inline-size: 44px;
  block-size: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--primary);
  border: 1px solid #F2D9D6;
}
.consent__icon svg { inline-size: 22px; block-size: 22px; }
.consent p { color: var(--primary-deep); font-weight: 600; align-self: center; }

/* ---------- Footer ---------- */
.footer {
  margin-block-start: 48px;
  background: var(--primary-deep);
  color: #fff;
  text-align: center;
  padding: clamp(40px, 6vw, 60px) var(--gutter);
}
.footer__logo-wrap {
  inline-size: 60px;
  block-size: 60px;
  margin-inline: auto;
  margin-block-end: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
}
.footer__logo-wrap img { inline-size: 42px; block-size: 42px; border-radius: 11px; }
.footer__name { font-weight: 800; font-size: 1.2rem; line-height: 1.3; }
.footer__name small { display: block; font-weight: 400; font-size: 0.84rem; color: rgba(255,255,255,0.72); margin-block-start: 4px; }
.footer__contact {
  margin-block-start: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 22px;
  font-size: 0.95rem;
}
.footer__contact a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  transition: color 0.18s ease;
}
.footer__contact a:hover { color: #fff; }
.footer__contact svg { inline-size: 17px; block-size: 17px; opacity: 0.85; }
.footer__updated {
  margin-block-start: 10px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}
.footer__divider {
  border: 0;
  block-size: 1px;
  background: rgba(255, 255, 255, 0.16);
  max-inline-size: 240px;
  margin: 26px auto;
}
.footer__legal { color: rgba(255, 255, 255, 0.66); font-size: 0.82rem; line-height: 1.7; }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 1023px) {
  .toc { margin-block-end: 4px; }
}
@media (max-width: 420px) {
  body { font-size: 1rem; }
  .topbar__name small { display: none; }
}
