/* =========================================================
   فين (Feen) — Design tokens & shared styles
   Works for both directions: Arabic pages set dir="rtl" on
   <html>, English legal pages set dir="ltr". All layout uses
   logical CSS properties so both directions render correctly
   from this single stylesheet.
   ========================================================= */

:root {
  /* Color tokens */
  --bg: #05070d;
  --bg-elevated: #090c16;
  --surface: #10162a;
  --surface-2: #151c36;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #eef1fb;
  --text-muted: #9aa4c4;
  --text-faint: #5c6690;

  --blue-600: #2748c9;
  --blue-500: #3b63f6;
  --blue-400: #5b8bff;
  --teal-400: #4fd1e0;
  --purple-400: #7c6cf0;

  --accent-gradient: linear-gradient(135deg, #26339e 0%, #3b63f6 48%, #4fd1e0 100%);
  --accent-gradient-soft: linear-gradient(135deg, rgba(59, 99, 246, 0.18) 0%, rgba(79, 209, 224, 0.14) 100%);
  --text-gradient: linear-gradient(90deg, #7c6cf0 0%, #3b63f6 55%, #4fd1e0 100%);

  --success: #35d399;
  --error: #ff6b6b;

  /* Type scale */
  --fs-100: 0.8125rem;
  --fs-200: 0.9375rem;
  --fs-300: 1rem;
  --fs-400: 1.125rem;
  --fs-500: 1.375rem;
  --fs-600: 1.75rem;
  --fs-700: clamp(2.25rem, 1.9rem + 1.5vw, 3rem);
  --fs-800: clamp(2.75rem, 2.1rem + 2.8vw, 4.25rem);

  /* Spacing scale (8px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-soft: 0 20px 60px -20px rgba(10, 20, 60, 0.55);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Cairo", "Tajawal", "Segoe UI", system-ui, sans-serif;
  font-size: var(--fs-300);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

html[dir="ltr"] body,
body.lang-en {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }

h1, h2, h3, h4 {
  margin: 0 0 var(--sp-4);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-800); line-height: 1.12; }
h2 { font-size: var(--fs-700); }
h3 { font-size: var(--fs-500); }
p { margin: 0 0 var(--sp-4); color: var(--text-muted); }

.container {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

/* ---------- Background texture ---------- */
body {
  background-image:
    radial-gradient(700px 480px at 85% -10%, rgba(59, 99, 246, 0.25), transparent 60%),
    radial-gradient(600px 420px at -10% 20%, rgba(124, 108, 240, 0.16), transparent 60%),
    radial-gradient(900px 600px at 50% 120%, rgba(79, 209, 224, 0.10), transparent 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  inset-inline-start: var(--sp-4);
  top: -60px;
  background: var(--blue-500);
  color: #fff;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top 0.2s var(--ease-out);
}
.skip-link:focus { top: var(--sp-3); }

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--teal-400);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(5, 7, 13, 0.72);
  border-block-end: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-block: var(--sp-3);
}
.brand { display: flex; align-items: center; gap: var(--sp-2); }
.brand img { width: 40px; height: 40px; }
.brand span {
  font-weight: 800;
  font-size: var(--fs-500);
  background: var(--text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.main-nav { display: flex; align-items: center; gap: var(--sp-6); }
.main-nav ul { display: flex; gap: var(--sp-5); }
.main-nav a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: var(--fs-200);
  padding-block: var(--sp-2);
  position: relative;
  transition: color 0.2s var(--ease-out);
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--text); }
.main-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -2px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--accent-gradient);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.85em 1.6em;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: var(--fs-300);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), background 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 12px 30px -10px rgba(59, 99, 246, 0.55);
}
.btn-primary:hover { box-shadow: 0 16px 36px -8px rgba(79, 209, 224, 0.5); transform: translateY(-2px); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--teal-400); }
.btn-disabled, .btn[aria-disabled="true"] {
  background: var(--surface);
  color: var(--text-faint);
  border-color: var(--border);
  cursor: not-allowed;
}
.btn-block { width: 100%; }
.btn-sm { padding: 0.6em 1.2em; font-size: var(--fs-200); }

/* ---------- Store badges ---------- */
.store-badges { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.store-badge {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-5);
  min-width: 210px;
  transition: transform 0.2s var(--ease-out), border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.store-badge:hover { transform: translateY(-3px); border-color: var(--blue-400); box-shadow: var(--shadow-soft); }
.store-badge svg { width: 30px; height: 30px; flex-shrink: 0; color: var(--teal-400); }
.store-badge .label-eyebrow { display: block; font-size: var(--fs-100); color: var(--text-muted); }
.store-badge .label-main { display: block; font-size: var(--fs-400); font-weight: 700; }
.store-badge.is-soon {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}
.store-badge.is-soon svg { color: var(--text-faint); }

/* ---------- Hero ---------- */
.hero {
  padding-block: var(--sp-9) var(--sp-8);
  position: relative;
  overflow: clip;
}
.hero .container { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--sp-8); align-items: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-4);
  border-radius: var(--radius-pill);
  background: var(--accent-gradient-soft);
  border: 1px solid var(--border-strong);
  color: var(--teal-400);
  font-size: var(--fs-100);
  font-weight: 700;
  margin-bottom: var(--sp-4);
}
.hero h1 span.grad {
  background: var(--text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lead { font-size: var(--fs-400); color: var(--text-muted); max-width: 58ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--sp-4); margin-block: var(--sp-6); }

.hero-art {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}
.hero-art::before {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, rgba(79, 209, 224, 0.25), rgba(59, 99, 246, 0.08) 55%, transparent 75%);
  filter: blur(2px);
}
.hero-art img {
  position: relative;
  z-index: 1;
  width: 65%;
  max-width: 300px;
  aspect-ratio: 1;
  filter: drop-shadow(0 30px 45px rgba(10, 20, 70, 0.55));
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-art img { animation: none; }
}
.hero-dot {
  position: absolute;
  border-radius: 50%;
  background: var(--accent-gradient);
}

/* ---------- Sections ---------- */
section { padding-block: var(--sp-9); }
.section-head { max-width: 62ch; margin-bottom: var(--sp-7); }
.section-head.center { margin-inline: auto; text-align: center; }

.divider {
  border: none;
  border-block-start: 1px solid var(--border);
  margin: 0;
}

/* ---------- Feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-5);
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-5);
  transition: transform 0.25s var(--ease-out), border-color 0.25s var(--ease-out), background 0.25s var(--ease-out);
}
.feature-card:hover { transform: translateY(-4px); border-color: var(--border-strong); background: var(--surface-2); }
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--accent-gradient);
  margin-bottom: var(--sp-4);
  color: #fff;
}
.feature-icon svg { width: 24px; height: 24px; }
.feature-card h3 { font-size: var(--fs-400); margin-bottom: var(--sp-2); }
.feature-card p { margin: 0; font-size: var(--fs-200); }

/* ---------- Steps (how it works) ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
  counter-reset: step;
}
.step { position: relative; padding-inline-start: var(--sp-8); }
html[dir="rtl"] .step { padding-inline-start: var(--sp-8); }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: var(--fs-400);
}
.step h3 { font-size: var(--fs-400); margin-bottom: var(--sp-2); }
.step p { font-size: var(--fs-200); margin: 0; }

/* ---------- CTA band ---------- */
.cta-band {
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(59, 99, 246, 0.18), rgba(79, 209, 224, 0.1));
  border: 1px solid var(--border-strong);
  padding: var(--sp-8);
  text-align: center;
}
.cta-band h2 { margin-bottom: var(--sp-3); }
.cta-band .lead { margin-inline: auto; }

/* ---------- Cards / info panels ---------- */
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
}

/* ---------- Forms ---------- */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-7);
  max-width: 680px;
  margin-inline: auto;
}
.field { margin-bottom: var(--sp-5); }
.field label {
  display: block;
  font-weight: 700;
  font-size: var(--fs-200);
  margin-bottom: var(--sp-2);
}
.field .hint {
  display: block;
  font-size: var(--fs-100);
  color: var(--text-faint);
  margin-top: var(--sp-1);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.85em 1em;
  color: var(--text);
  font: inherit;
  font-size: var(--fs-300);
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--teal-400);
  box-shadow: 0 0 0 3px rgba(79, 209, 224, 0.18);
  outline: none;
}
.field textarea { min-height: 140px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.required-mark { color: var(--teal-400); }

.form-status {
  border-radius: var(--radius-sm);
  padding: var(--sp-4);
  font-size: var(--fs-200);
  margin-bottom: var(--sp-5);
  display: none;
}
.form-status.is-visible { display: block; }
.form-status.is-success { background: rgba(53, 211, 153, 0.12); border: 1px solid rgba(53, 211, 153, 0.4); color: var(--success); }
.form-status.is-error { background: rgba(255, 107, 107, 0.12); border: 1px solid rgba(255, 107, 107, 0.4); color: var(--error); }

.field-error {
  display: none;
  color: var(--error);
  font-size: var(--fs-100);
  margin-top: var(--sp-1);
}
.field.has-error input,
.field.has-error textarea { border-color: var(--error); }
.field.has-error .field-error { display: block; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding-block: var(--sp-8) var(--sp-6); }
.page-hero .eyebrow { margin-bottom: var(--sp-3); }
.page-hero .lead { max-width: 65ch; }

/* ---------- Legal content (English pages) ---------- */
.legal {
  padding-block: var(--sp-8) var(--sp-10);
}
.legal .container { max-width: 820px; }
.legal h2 { font-size: var(--fs-600); margin-top: var(--sp-8); }
.legal h3 { font-size: var(--fs-400); margin-top: var(--sp-6); }
.legal p, .legal li { color: var(--text-muted); font-size: var(--fs-300); }
.legal ul { margin: 0 0 var(--sp-4); padding-inline-start: 1.4em; list-style: disc; }
.legal ol { margin: 0 0 var(--sp-4); padding-inline-start: 1.4em; }
.legal .updated { color: var(--text-faint); font-size: var(--fs-200); margin-bottom: var(--sp-6); }
.legal .placeholder { color: var(--teal-400); }

/* ---------- Footer ---------- */
.site-footer {
  border-block-start: 1px solid var(--border);
  padding-block: var(--sp-8) var(--sp-6);
  background: var(--bg-elevated);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--sp-7);
  margin-bottom: var(--sp-7);
}
.footer-brand .brand { margin-bottom: var(--sp-3); }
.footer-brand p { font-size: var(--fs-200); max-width: 34ch; }
.footer-col h4 { font-size: var(--fs-200); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--sp-3); }
.footer-col ul { display: flex; flex-direction: column; gap: var(--sp-2); }
.footer-col a { color: var(--text-muted); font-size: var(--fs-200); transition: color 0.2s var(--ease-out); }
.footer-col a:hover { color: var(--teal-400); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
  font-size: var(--fs-100);
  color: var(--text-faint);
}

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 320px; margin-inline: auto; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .main-nav ul, .main-nav .nav-actions-inline { display: none; }
  .nav-toggle { display: inline-flex; }
  .main-nav.is-open {
    position: fixed;
    inset: 64px var(--sp-4) auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: var(--sp-5);
    box-shadow: var(--shadow-soft);
    flex-direction: column;
    align-items: stretch;
  }
  .main-nav.is-open ul {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
  }
  .field-row { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .form-card { padding: var(--sp-5); }
}
