/* Five City website — privacy, support and account deletion.
   Tokens mirror apps/mobile/src/theme/colors.ts (obsidian-blue base, gold
   accent). Muted/faint text alphas are raised slightly (0.55→0.64,
   0.32→0.46) so small legal text meets WCAG AA contrast on the web.
   One stylesheet serves both directions: use logical properties
   (margin-inline-*, padding-inline-*, text-align: start) — never left/right. */

@font-face { font-family: 'Outfit'; src: url('/assets/fonts/Outfit-300.ttf') format('truetype'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('/assets/fonts/Outfit-400.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('/assets/fonts/Outfit-600.ttf') format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
/* Arabic glyphs only — English pages never download these files. */
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('/assets/fonts/IBMPlexSansArabic-400.ttf') format('truetype'); font-weight: 300 400; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('/assets/fonts/IBMPlexSansArabic-600.ttf') format('truetype'); font-weight: 500 700; font-style: normal; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }

:root {
  --bg: #090D15;
  --bg-top: #121826;
  --card: rgba(255, 255, 255, 0.035);
  --card-border: rgba(255, 255, 255, 0.08);
  --surface: rgba(255, 255, 255, 0.03);
  --surface-raised: rgba(255, 255, 255, 0.06);
  --hairline: rgba(255, 255, 255, 0.05);
  --hairline-hi: rgba(255, 255, 255, 0.10);
  --text: #F4F4F2;
  --text-body: rgba(244, 244, 242, 0.84);
  --text-muted: rgba(244, 244, 242, 0.64);
  --text-faint: rgba(244, 244, 242, 0.46);
  --gold: #F5A623;
  --gold-hover: #FFB84A;
  --gold-pressed: #D9901A;
  --on-gold: #171106;
  --gold-glow: rgba(245, 166, 35, 0.35);
  --gold-ring: rgba(245, 166, 35, 0.55);
  --gold-dim: rgba(245, 166, 35, 0.28);
  --gold-wash: rgba(245, 166, 35, 0.06);
  --glass: rgba(9, 13, 21, 0.74);
  --input: rgba(13, 18, 29, 0.6);
  --danger: #E5484D;
  --danger-wash: rgba(229, 72, 77, 0.12);
  --success: #46A758;
  --success-wash: rgba(70, 167, 88, 0.12);
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 18px;
  --pill: 999px;
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-ar: 'IBM Plex Sans Arabic', 'Outfit', system-ui, -apple-system, 'Segoe UI', Tahoma, Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 0% -8%, rgba(245, 166, 35, 0.10), transparent 62%),
    linear-gradient(180deg, var(--bg-top) 0, var(--bg) 560px);
  background-repeat: no-repeat;
  color: var(--text-body);
  font: 400 16px/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html[dir='rtl'] body {
  background-image:
    radial-gradient(900px 520px at 100% -8%, rgba(245, 166, 35, 0.10), transparent 62%),
    linear-gradient(180deg, var(--bg-top) 0, var(--bg) 560px);
}
html[lang='ar'] body { font-family: var(--font-ar); line-height: 1.85; }
/* Arabic blocks embedded in an English page (e.g. 404.html). */
div[lang='ar'] { font-family: var(--font-ar); line-height: 1.85; }

img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
bdi, .ltr { unicode-bidi: isolate; }

a { color: var(--gold); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold-hover); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.skip-link {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50;
  background: var(--gold); color: var(--on-gold); padding: 8px 14px; border-radius: var(--pill);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ── Header ─────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--hairline);
}
.header-inner {
  max-width: 1040px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font-weight: 600; font-size: 14px; letter-spacing: 0.2em; text-transform: uppercase;
  font-family: var(--font);
}
.brand:hover { color: var(--text); }
.brand img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 0 18px rgba(245, 166, 35, 0.18); }
.nav { order: 2; display: flex; gap: 2px; margin-inline-start: auto; }
.nav a {
  color: var(--text-muted); text-decoration: none; white-space: nowrap;
  padding: 7px 12px; border-radius: var(--pill); font-size: 14.5px;
}
.nav a:hover { color: var(--text); background: var(--surface-raised); }
.nav a[aria-current='page'] { color: var(--gold); background: var(--gold-wash); }
.lang-switch {
  order: 3; color: var(--gold); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--gold-dim); border-radius: var(--pill);
  padding: 6px 14px; font-size: 14px; line-height: 1.5;
}
.lang-switch:hover { background: var(--gold-wash); color: var(--gold-hover); }
.lang-switch:lang(ar) { font-family: var(--font-ar); }
.lang-switch:lang(en) { font-family: var(--font); }

@media (max-width: 720px) {
  .header-inner { padding: 10px 16px; }
  .lang-switch { order: 2; margin-inline-start: auto; }
  .nav {
    order: 3; width: 100%; margin-inline-start: -4px; margin-inline-end: -4px;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 10px; font-size: 14px; }
}

/* ── Layout & type ──────────────────────────────────────────────── */
main { display: block; max-width: 780px; margin: 0 auto; padding: 44px 20px 72px; }
main.wide { max-width: 1040px; }
@media (max-width: 720px) { main { padding: 28px 16px 56px; } }

h1, h2, h3 { color: var(--text); line-height: 1.25; }
h1 { font-size: clamp(30px, 6vw, 42px); font-weight: 600; letter-spacing: -0.01em; margin: 0 0 12px; }
h2 { font-size: 22px; font-weight: 600; margin: 48px 0 12px; }
h3 { font-size: 17.5px; font-weight: 600; margin: 26px 0 8px; }
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 16px; padding-inline-start: 22px; }
li { margin: 6px 0; }
li::marker { color: var(--gold); }
strong { color: var(--text); font-weight: 600; }
html[lang='ar'] h1 { letter-spacing: 0; line-height: 1.4; }
html[lang='ar'] h2, html[lang='ar'] h3 { line-height: 1.5; }

.eyebrow {
  margin: 0 0 10px; color: var(--gold);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
}
html[lang='ar'] .eyebrow { font-size: 14px; letter-spacing: 0; text-transform: none; }
.lead { font-size: 18.5px; color: var(--text-muted); margin-bottom: 20px; }
.meta { color: var(--text-faint); font-size: 14.5px; margin-bottom: 28px; }
.fine { color: var(--text-faint); font-size: 14px; margin: 14px 0 0; }
.section-title { margin-top: 56px; }

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius-xl); padding: 20px 22px;
}
.card > :last-child { margin-bottom: 0; }
.card.gold { background: var(--gold-wash); border-color: var(--gold-dim); }
.spaced { margin-top: 40px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.h-small {
  font-size: 12px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 10px;
}
html[lang='ar'] .h-small { font-size: 14.5px; letter-spacing: 0; text-transform: none; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.feature h3 { margin: 12px 0 6px; }
.feature p { color: var(--text-muted); font-size: 15.5px; margin: 0; }
.feature-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  color: var(--gold); background: var(--gold-wash); border: 1px solid var(--gold-dim);
}
.feature-icon svg { width: 22px; height: 22px; }

.link-card { display: block; text-decoration: none; color: inherit; transition: border-color 0.15s, background 0.15s; }
.link-card:hover { border-color: var(--gold-dim); background: var(--gold-wash); color: inherit; }
.link-card h3 { margin: 0 0 6px; }
.link-card h3::after { content: ' →'; color: var(--gold); }
html[dir='rtl'] .link-card h3::after { content: ' ←'; }
.link-card p { margin: 0; color: var(--text-muted); font-size: 15.5px; }

/* ── Home hero ──────────────────────────────────────────────────── */
.hero { text-align: center; padding: 18px 0 8px; }
.hero-icon { width: 120px; height: 120px; border-radius: 28px; box-shadow: 0 0 70px rgba(245, 166, 35, 0.22), 0 0 0 1px var(--gold-dim); }
.hero h1 {
  margin: 22px 0 12px; font-weight: 300; text-transform: uppercase;
  letter-spacing: 0.16em; font-size: clamp(36px, 8vw, 60px);
}
html[lang='ar'] .hero h1 { text-transform: none; letter-spacing: 0; font-weight: 600; }
.hero .lead { max-width: 580px; margin-inline: auto; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; margin: 22px 0 0;
  padding: 5px 13px; border-radius: var(--pill); border: 1px solid var(--gold-dim);
  color: var(--gold); font-size: 11.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
}
html[lang='ar'] .badge { font-size: 13.5px; letter-spacing: 0; text-transform: none; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold-glow); }
.pill-note {
  text-align: center; margin: 22px 0 0; color: var(--text-muted);
  font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
}
html[lang='ar'] .pill-note { font-size: 15px; letter-spacing: 0; text-transform: none; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn-row.center { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: var(--pill);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  font: inherit; font-size: 15.5px; font-weight: 600; line-height: 1.2;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s, color 0.15s;
}
.btn-gold { background: var(--gold); color: var(--on-gold); }
.btn-gold:hover { background: var(--gold-hover); color: var(--on-gold); }
.btn-gold:active { background: var(--gold-pressed); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--hairline-hi); }
.btn-ghost:hover { border-color: var(--gold-dim); color: var(--text); background: var(--gold-wash); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #F25F63; color: #fff; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ── Legal content ──────────────────────────────────────────────── */
.summary { margin: 0 0 30px; }
.summary ul { margin: 0; }
.toc { margin: 0 0 8px; }
.toc ol { columns: 2; column-gap: 28px; margin: 0; font-size: 15px; }
.toc li { break-inside: avoid; margin: 4px 0; }
.toc a { color: var(--text-muted); text-decoration: none; }
.toc a:hover { color: var(--gold); }
@media (max-width: 560px) { .toc ol { columns: 1; } }

.data-table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 18px; }
.data-table th, .data-table td {
  text-align: start; vertical-align: top; padding: 12px 14px 12px 0;
  border-bottom: 1px solid var(--hairline-hi);
}
html[dir='rtl'] .data-table th, html[dir='rtl'] .data-table td { padding: 12px 0 12px 14px; }
.data-table th {
  color: var(--text-faint); font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
}
html[lang='ar'] .data-table th { font-size: 13.5px; letter-spacing: 0; text-transform: none; }
.data-table td:first-child { color: var(--text); }
.data-table td:first-child strong { display: block; }
@media (max-width: 720px) {
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr {
    background: var(--card); border: 1px solid var(--card-border);
    border-radius: var(--radius-lg); padding: 8px 16px; margin-bottom: 12px;
  }
  .data-table td, html[dir='rtl'] .data-table td { border: 0; padding: 7px 0; }
  .data-table td::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    color: var(--gold); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  }
  html[lang='ar'] .data-table td::before { font-size: 13px; letter-spacing: 0; text-transform: none; }
}

.note {
  border-inline-start: 2px solid var(--gold); background: var(--gold-wash);
  padding: 12px 16px; border-radius: 0 var(--radius-md) var(--radius-md) 0; margin: 16px 0;
}
html[dir='rtl'] .note { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.note > :last-child { margin-bottom: 0; }

.path { color: var(--text); font-weight: 600; white-space: nowrap; }

details {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 0 18px; margin: 10px 0;
}
details[open] { border-color: var(--hairline-hi); }
summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 14px;
  padding: 15px 0; color: var(--text); font-weight: 600;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; color: var(--gold); font-weight: 400; font-size: 22px; line-height: 1; flex: none; }
details[open] summary::after { content: '\2212'; }
details > :not(summary) { margin-top: 0; }
details > :last-child { padding-bottom: 14px; margin-bottom: 0; }

/* ── Support ────────────────────────────────────────────────────── */
.contact-card { margin: 8px 0 8px; }
.contact-email { font-size: clamp(20px, 5vw, 26px); font-weight: 600; margin: 4px 0 12px; overflow-wrap: anywhere; }
.contact-email a { text-decoration: none; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding-inline-start: 18px; position: relative; }
.plain li::before { content: ''; position: absolute; inset-inline-start: 0; top: 0.72em; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

/* ── Account deletion ───────────────────────────────────────────── */
.step-num {
  display: inline-grid; place-items: center; width: 30px; height: 30px; margin-inline-end: 10px;
  border-radius: 50%; border: 1px solid var(--gold-ring); color: var(--gold);
  font-size: 15px; font-weight: 600; vertical-align: 2px;
}
.form-card { margin-top: 14px; }
.form-card h3 { margin-top: 0; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { color: var(--text); font-size: 15px; font-weight: 600; }
.input {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--hairline-hi); background: var(--input); color: var(--text);
  font: inherit; font-size: 16px; /* 16px stops iOS zoom-on-focus */
}
.input:focus { outline: none; border-color: var(--gold-ring); box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.18); }
html[dir='rtl'] .input[dir='ltr'] { text-align: right; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 16px; color: var(--text); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 4px 0 0; flex: none; accent-color: var(--gold); }
.who {
  background: var(--surface-raised); border: 1px solid var(--hairline-hi);
  border-radius: var(--radius-md); padding: 12px 14px; color: var(--text); overflow-wrap: anywhere;
}
.alert { border-radius: var(--radius-md); padding: 12px 14px; font-size: 15px; margin: 0 0 14px; color: var(--text); }
.alert-error { background: var(--danger-wash); border: 1px solid rgba(229, 72, 77, 0.5); }
.alert-success { background: var(--success-wash); border: 1px solid rgba(70, 167, 88, 0.5); }
.alert-info { background: var(--gold-wash); border: 1px solid var(--gold-dim); }
.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-inline-start: 28px; }
.checklist li::before {
  content: ''; position: absolute; inset-inline-start: 2px; top: 0.5em;
  width: 12px; height: 7px; border-inline-start: 2px solid var(--gold); border-bottom: 2px solid var(--gold);
  transform: rotate(-45deg);
}
html[dir='rtl'] .checklist li::before { transform: rotate(45deg) scaleX(-1); }

/* ── Footer ─────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--hairline); }
.footer-inner {
  max-width: 1040px; margin: 0 auto; padding: 28px 20px 44px;
  display: grid; gap: 12px; color: var(--text-faint); font-size: 14px;
}
.footer-inner p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--gold); }

/* ── Print (legal pages) ────────────────────────────────────────── */
@media print {
  body { background: #fff; color: #000; }
  .site-header, .skip-link, .footer-links, #web-delete { display: none !important; }
  h1, h2, h3, strong, .data-table td:first-child { color: #000; }
  a { color: #000; }
  .card, details, .data-table tr { background: none; border-color: #999; }
}
