/* Al Firdaws Media — Brand System v3
   Colors are taken from the official logo files (design/brand/source).
   Arabic + headings: Cairo · Latin body: Inter · Icons: Lucide only. */

@import url("/static/fonts/cairo/cairo.css");

:root {
  --afm-red: #FF2828;
  --afm-red-600: #E01E1E;
  --afm-blue: #004AAD;
  --afm-blue-600: #003B8C;
  --afm-navy: #0A1430;
  --afm-green: #12A150;
  --afm-amber: #F59E0B;

  --bg: #F6F8FC;
  --surface: #FFFFFF;
  --surface-2: #EFF3FA;
  --ink: #0A1430;
  --ink-2: #33405C;
  --muted: #66728A;
  --line: #E2E8F2;
  --link: #004AAD;
  --primary: #004AAD;
  --primary-hover: #003B8C;
  --primary-soft: #EAF1FC;
  --accent-soft: #FFEDED;
  --shadow-sm: 0 1px 2px rgba(10, 20, 48, .06);
  --shadow: 0 12px 32px rgba(10, 20, 48, .08);
  --shadow-lg: 0 30px 70px rgba(10, 20, 48, .14);

  --font-head: "Cairo", "Inter", system-ui, sans-serif;
  --font-body: "Inter", "Cairo", system-ui, sans-serif;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 22px;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #070C1A;
  --surface: #0E1528;
  --surface-2: #141D35;
  --ink: #F3F6FC;
  --ink-2: #C9D2E3;
  --muted: #8E9AB2;
  --line: rgba(255, 255, 255, .09);
  --link: #7FB0FF;
  --primary: #1257C4;
  --primary-hover: #0E4AA8;
  --primary-soft: rgba(18, 87, 196, .16);
  --accent-soft: rgba(255, 40, 40, .14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 12px 32px rgba(0, 0, 0, .35);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--ink); margin: 0; line-height: 1.3; letter-spacing: 0; }
p { margin: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
[dir="ltr"] .afm-flip { transform: scaleX(-1); }
.afm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.afm-container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.afm-brand-name { font-family: "Inter", system-ui, sans-serif; font-weight: 700; unicode-bidi: isolate; }

/* ---------- Icons ---------- */
.afm-ico { width: 20px; height: 20px; flex: none; stroke-width: 2; }
i[data-lucide] { display: inline-flex; width: 20px; height: 20px; flex: none; }

/* ---------- Logo ---------- */
.afm-logo { display: inline-flex; align-items: center; flex: none; }
.afm-logo img { height: 34px; width: auto; }

/* ---------- Buttons ---------- */
.afm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
  font-family: var(--font-head); font-weight: 700; font-size: 15px; line-height: 1;
  cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.afm-btn:active { transform: translateY(1px); }
.afm-btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(0, 74, 173, .25); }
.afm-btn-primary:hover { background: var(--primary-hover); }
.afm-btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.afm-btn-ghost:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.afm-btn-light { background: #fff; color: var(--afm-navy); }
.afm-btn-block { width: 100%; }
.afm-btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.afm-icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  font: 700 13px/1 "Inter", system-ui, sans-serif;
}
.afm-icon-btn:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.afm-icon-btn i[data-lucide], .afm-icon-btn svg { width: 18px; height: 18px; }

/* ---------- Badges ---------- */
.afm-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--primary-soft); color: var(--link); font: 700 13px/1.4 var(--font-head);
}
.afm-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--afm-green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--afm-green) 20%, transparent); }
.afm-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font: 700 12px/1.6 var(--font-head); white-space: nowrap; }
.afm-badge.live { background: var(--accent-soft); color: var(--afm-red); }
.afm-badge.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: afm-pulse 1.6s infinite; }
.afm-badge.ok { background: color-mix(in srgb, var(--afm-green) 14%, transparent); color: var(--afm-green); }
.afm-badge.wait { background: var(--primary-soft); color: var(--link); }
@keyframes afm-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .afm-badge.live::before { animation: none; } html { scroll-behavior: auto; } }

/* ---------- Header ---------- */
.afm-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--line); }
.afm-header-row { display: flex; align-items: center; gap: 16px; min-height: 72px; }
.afm-nav { display: flex; gap: 4px; margin-inline-start: auto; }
.afm-nav a { color: var(--ink-2); font: 600 15px/1 var(--font-head); padding: 10px 14px; border-radius: 10px; }
.afm-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.afm-header-tools { display: flex; align-items: center; gap: 8px; margin-inline-start: 8px; }

/* ---------- Hero ---------- */
.afm-hero { padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 8vw, 104px); position: relative; }
.afm-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 300px at 85% 0%, color-mix(in srgb, var(--afm-blue) 12%, transparent), transparent 70%),
    radial-gradient(500px 280px at 10% 30%, color-mix(in srgb, var(--afm-red) 8%, transparent), transparent 70%);
}
.afm-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.afm-hero h1 { font-size: clamp(28px, 3.1vw, 42px); font-weight: 900; line-height: 1.4; margin: 20px 0 18px; text-wrap: balance; }
.afm-hero h1 .accent { color: var(--afm-red); }
.afm-hero .lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-2); max-width: 560px; }
.afm-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.afm-proof { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 28px; color: var(--muted); font-size: 14px; font-weight: 500; }
.afm-proof span { display: inline-flex; align-items: center; gap: 8px; }
.afm-proof i[data-lucide], .afm-proof svg { width: 18px; height: 18px; color: var(--afm-green); }

/* Product preview (illustrative) */
.afm-preview { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.afm-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.afm-preview-head .dots { display: flex; gap: 6px; }
.afm-preview-head .dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.afm-preview-head .title { font: 700 14px/1.4 var(--font-head); color: var(--ink-2); }
.afm-preview-head .note { font-size: 12px; color: var(--muted); }
.afm-preview-body { padding: 18px; display: grid; gap: 14px; }
.afm-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.afm-tile { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: var(--bg); min-width: 0; }
.afm-tile .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.afm-tile .v { font: 800 26px/1.3 var(--font-head); margin-top: 6px; }
.afm-tile .s { font-size: 12px; color: var(--muted); }
.afm-tile.live { background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--bg); }
.afm-queue { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.afm-queue-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; }
.afm-queue-row + .afm-queue-row { border-top: 1px solid var(--line); }
.afm-queue-row .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--link); }
.afm-queue-row .ic svg, .afm-queue-row .ic i[data-lucide] { width: 18px; height: 18px; }
.afm-queue-row .t { font: 700 14px/1.4 var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.afm-queue-row .m { font-size: 12px; color: var(--muted); }

/* ---------- Sections ---------- */
.afm-section { padding: clamp(56px, 8vw, 96px) 0; }
.afm-section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.afm-section-head { max-width: 720px; margin-bottom: clamp(28px, 4vw, 48px); }
.afm-section-head.center { margin-inline: auto; text-align: center; }
.afm-kicker { font: 800 18px/1.4 var(--font-head); color: var(--afm-red); margin-bottom: 10px; }
.afm-section-head h2 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 800; }
.afm-section-head p { color: var(--ink-2); margin-top: 12px; font-size: 17px; }

.afm-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.afm-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-sm); transition: box-shadow .2s ease, transform .2s ease; min-width: 0; }
.afm-section.alt .afm-card { background: var(--bg); }
.afm-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.afm-card .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--link); margin-bottom: 16px; }
.afm-card .ic.red { background: var(--accent-soft); color: var(--afm-red); }
.afm-card .ic svg, .afm-card .ic i[data-lucide] { width: 22px; height: 22px; }
.afm-card h3 { font-size: 19px; font-weight: 800; margin-bottom: 8px; }
.afm-card p { color: var(--ink-2); font-size: 15px; }

.afm-faq { max-width: 860px; margin-inline: auto; display: grid; gap: 12px; }
.afm-faq details { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 20px; overflow: hidden; }
.afm-faq summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; font: 700 16px/1.6 var(--font-head); }
.afm-faq summary::-webkit-details-marker { display: none; }
.afm-faq summary::after { content: ""; flex: none; width: 9px; height: 9px; margin-inline-end: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-2px) rotate(45deg); transition: transform .2s ease; }
.afm-faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.afm-faq details p { padding: 0 0 16px; color: var(--ink-2); }

/* ---------- Footer ---------- */
/* ---------- Auth (login) ---------- */
.afm-auth { min-height: 100vh; min-height: 100dvh; display: flex; }
.afm-auth-form { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 24px var(--gutter); background: var(--bg); }
.afm-auth-top { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.afm-auth-card { width: 100%; max-width: 440px; margin: auto; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.afm-auth-logo { display: flex; justify-content: center; margin-bottom: 24px; }
.afm-auth-logo img { height: 40px; width: auto; }
.afm-auth-card .afm-input { background: var(--bg); }
.afm-auth-card h1 { font-size: clamp(28px, 3vw, 34px); font-weight: 800; }
.afm-auth-card .sub { color: var(--ink-2); margin-top: 8px; }
.afm-error { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--afm-red-600); font-size: 14px; font-weight: 600; }
:root[data-theme="dark"] .afm-error { color: #FF8A8A; }
.afm-form { margin-top: 24px; display: grid; gap: 18px; }
.afm-field label { display: block; font: 700 14px/1.5 var(--font-head); margin-bottom: 8px; }
.afm-input-wrap { position: relative; }
.afm-input {
  width: 100%; height: 50px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 16px; transition: border-color .15s ease, box-shadow .15s ease;
}
.afm-input::placeholder { color: var(--muted); }
.afm-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.afm-input[dir="ltr"] { text-align: left; }
.afm-input.has-toggle { padding-right: 52px; }
.afm-pass-toggle { position: absolute; top: 5px; right: 6px; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.afm-pass-toggle:hover { background: var(--surface-2); color: var(--ink); }
.afm-pass-toggle svg, .afm-pass-toggle i[data-lucide] { width: 20px; height: 20px; }
.afm-form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.afm-check-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink-2); }
.afm-check-label input { width: 18px; height: 18px; accent-color: var(--primary); }
.afm-legal { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.9; }
.afm-success { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--afm-green) 12%, transparent); color: var(--ink); font-size: 14px; font-weight: 600; }
.afm-input-code { text-align: center; font-size: 20px; letter-spacing: 3px; }
.afm-auth-back { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; font-size: 14px; font-weight: 600; }
.afm-auth-back svg, .afm-auth-back i[data-lucide] { width: 16px; height: 16px; }
.afm-auth-card .sub + .afm-error { margin-top: 16px; }
section[id] { scroll-margin-top: 84px; }
.afm-menu-btn { display: none; }

/* ---------- Plans ---------- */
.afm-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.afm-plan { display: flex; flex-direction: column; gap: 18px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.afm-plan h3 { font-size: 20px; font-weight: 800; }
.afm-ent-label { color: var(--muted); font-size: 14px; margin-top: 2px; }
@media (min-width: 1025px) { .afm-plan-enterprise { grid-column: 2; } }
.afm-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.afm-price b { font: 900 34px/1.2 var(--font-head); color: var(--ink); font-variant-numeric: tabular-nums; }
.afm-price span { color: var(--muted); font-size: 14px; }
.afm-limits { list-style: none; margin: 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; flex: 1; }
.afm-limits li { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 15px; min-width: 0; }
.afm-limits li svg, .afm-limits li i[data-lucide] { width: 18px; height: 18px; color: var(--link); flex: none; }
.afm-limits b { color: var(--ink); font-variant-numeric: tabular-nums; }
.afm-subhead { font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; margin: clamp(40px, 6vw, 64px) 0 20px; }
.afm-storage { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.afm-storage .afm-plan h3 { display: flex; align-items: center; gap: 10px; }
.afm-storage .afm-plan h3 svg, .afm-storage .afm-plan h3 i[data-lucide] { width: 22px; height: 22px; color: var(--link); flex: none; }
.afm-storage .afm-price b { font-size: 28px; }
.afm-pay { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.afm-pay-item { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 100px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); font: 700 17px/1.4 var(--font-head); min-width: 0; }
.afm-pay-item img { width: 72px; height: 72px; object-fit: contain; flex: none; background: #fff; border-radius: 14px; }
.afm-pay-item img.afm-pay-tight { padding: 16px; }

/* ---------- WhatsApp ---------- */
.afm-wa-ico { width: 22px; height: 22px; flex: none; }
.afm-btn-wa { background: #128C4B; color: #fff; }
.afm-btn-wa:hover { background: #0E7A40; }
.afm-wa-float { position: fixed; z-index: 60; inset-inline-end: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #128C4B; color: #fff; box-shadow: 0 10px 26px rgba(10, 20, 48, .3); transition: background .15s ease; }
.afm-wa-float:hover { background: #0E7A40; }
.afm-wa-float .afm-wa-ico { width: 30px; height: 30px; }

/* ---------- Footer ---------- */
.afm-footer { padding: clamp(40px, 6vw, 72px) 0 28px; }
.afm-footer-card { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: clamp(28px, 5vw, 48px); border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); }
:root[data-theme="dark"] .afm-footer-card { background: var(--surface-2); }
.afm-footer-card img { height: 44px; width: auto; }
.afm-footer-card .statement { font: 800 clamp(22px, 3vw, 32px)/1.4 var(--font-head); margin-top: 8px; }
.afm-footer-card .support { color: var(--ink-2); font-size: 17px; }
.afm-footer-card .afm-btn { margin-top: 6px; }
.afm-footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 24px; margin-top: 20px; color: var(--muted); font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .afm-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .afm-features, .afm-plans, .afm-storage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .afm-menu-btn { display: inline-grid; }
  .afm-header-tools { margin-inline-start: auto; }
  .afm-nav { display: none; position: absolute; inset-inline: 0; top: 100%; margin: 0; flex-direction: column; gap: 2px; padding: 10px var(--gutter) 14px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .afm-nav.open { display: flex; }
  .afm-nav a { padding: 14px 12px; font-size: 16px; }
}
@media (max-width: 640px) {
  .afm-features, .afm-plans, .afm-pay { grid-template-columns: minmax(0, 1fr); }
  .afm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .afm-tiles .afm-tile:first-child { grid-column: 1 / -1; }
  .afm-header-row { min-height: 64px; gap: 10px; }
  .afm-logo img { height: 22px; }
  .afm-header-tools { gap: 6px; margin-inline-start: auto; }
  .afm-header-tools .afm-icon-btn { width: 40px; height: 40px; }
  .afm-header .afm-btn { min-height: 40px; height: 40px; }
  .afm-header .afm-btn .label { display: none; }
  .afm-header .afm-btn { width: 40px; padding: 0; }
  .afm-hero-cta .afm-btn { flex: 1 1 100%; }
  .afm-auth-card { padding: 24px 20px; }
  .afm-footer { padding-bottom: 88px; }
}
@media (max-width: 350px) {
  .afm-logo img { height: 18px; }
  .afm-header-tools .afm-icon-btn { width: 36px; height: 36px; }
  .afm-header .afm-btn { width: 36px; min-height: 36px; height: 36px; }
}
@media (max-width: 400px) {
  .afm-storage { grid-template-columns: minmax(0, 1fr); }
}
