/* =========================================================
   Circo — Design System v2
   Warm-minimal · near-white base · near-black ink
   One green accent · Geist type · soft depth
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Brand — one green, used sparingly */
  --green:        #16A34A;
  --green-dark:   #15803D;
  --green-darker: #166534;
  --green-soft:   #DCFCE7;
  --green-tint:   #F0FDF4;
  --green-ring:   rgba(22,163,74,.16);

  /* Dark accent = near-black (remapped from old "navy" so every
     existing component keeps working). Used for dark buttons + accents. */
  --navy:         #0A0A0A;
  --navy-2:       #262626;
  --navy-soft:    #F4F4F5;

  /* Ink + warm neutrals */
  --white:        #FFFFFF;
  --bg:           #FBFAF6;
  --surface:      #FFFFFF;
  --ink:          #111110;
  --ink-2:        #2B2A27;
  --muted:        #6C6A63;
  --faint:        #9C998F;
  --border:       #E8E4DA;
  --border-2:     #DAD5C8;

  /* Status */
  --amber:        #B45309;
  --amber-soft:   #FEF3C7;
  --danger:       #DC2626;
  --danger-soft:  #FEE2E2;

  /* Type */
  --font: "Satoshi", "IBM Plex Sans Arabic", -apple-system, BlinkMacSystemFont, "SF Arabic", "Geeza Pro", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Fraunces", "IBM Plex Sans Arabic", Georgia, "Times New Roman", serif;

  /* Warm editorial surfaces */
  --cream:        #F4F1EA;
  --cream-2:      #ECE7DB;

  /* Radius (warm / rounded) */
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* Shadow (soft, layered) */
  --shadow-xs: 0 1px 2px rgba(10,10,10,.04);
  --shadow-sm: 0 1px 2px rgba(10,10,10,.04), 0 1px 3px rgba(10,10,10,.04);
  --shadow:    0 2px 4px rgba(10,10,10,.03), 0 10px 26px rgba(10,10,10,.06);
  --shadow-lg: 0 10px 20px rgba(10,10,10,.05), 0 24px 56px rgba(10,10,10,.10);

  /* Layout */
  --maxw: 1180px;
  --nav-h: 68px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip; /* belt-and-suspenders: never allow horizontal scroll (sticky-safe) */
}
[dir="rtl"] body, [lang="ar"] { letter-spacing: 0; }
.brand-name { white-space: nowrap; font-family: var(--font-display); font-weight: 600; letter-spacing: -.005em; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
ul { list-style: none; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.07; color: var(--ink); font-weight: 500; letter-spacing: -.015em; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4 { font-weight: 600; letter-spacing: 0; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
.section { padding: 76px 0; }
.section-sm { padding: 48px 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 22px; }
.hidden { display: none !important; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}
.section-head { max-width: 740px; margin: 0 auto 56px; text-align: center; }
.section-head .eyebrow { margin-bottom: 16px; }
.section-head h2 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 600; letter-spacing: -.015em; }
.section-head p { color: var(--muted); margin-top: 16px; font-size: 1.08rem; line-height: 1.6; }

/* ============ MacroBudget-style editorial (monochrome) ============ */

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; transition: none !important; } }

/* Hero — serif editorial, centered */
.hero-inner { position: relative; max-width: 1040px; margin-inline: auto; text-align: center; padding: 104px 0 88px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--border);
  font-family: var(--font); font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  padding: 7px 15px; border-radius: var(--r-pill); margin-bottom: 32px; box-shadow: var(--shadow-xs);
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.hero-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.7rem, 6.6vw, 5.3rem); line-height: 1.02; letter-spacing: -.02em;
  color: var(--ink); margin: 0 auto; max-width: 17ch;
}
.hero-title .hl { font-style: italic; font-weight: 400; }
.hero-lead { font-size: 1.2rem; color: var(--muted); margin: 26px auto 0; max-width: 46ch; line-height: 1.55; }
.hero-actions { display: flex; gap: 12px; margin-top: 38px; justify-content: center; flex-wrap: wrap; }

/* Stat band */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); max-width: 940px; margin-inline: auto; }
.stat-cell { padding: 6px 28px; text-align: center; border-inline-start: 1px solid var(--border); }
.stat-cell:first-child { border-inline-start: 0; }
.stat-cell .n { font-family: var(--font-display); font-weight: 500; font-size: clamp(2.6rem, 5.5vw, 3.7rem); letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.stat-cell .l { font-family: var(--font); font-size: .82rem; color: var(--muted); margin-top: 14px; text-transform: uppercase; letter-spacing: .1em; }

/* Two-column "how it works" (Aetherfield) */
.split { display: grid; grid-template-columns: .82fr 1.18fr; gap: 64px; align-items: start; }
.split-intro { position: sticky; top: calc(var(--nav-h) + 44px); }
.split-intro h2 { font-size: clamp(2rem, 4vw, 3rem); }
.split-intro p { color: var(--muted); margin-top: 18px; font-size: 1.05rem; line-height: 1.6; max-width: 34ch; }
.split-intro .btn { margin-top: 28px; }
.num-list { display: grid; }
.num-row { display: grid; grid-template-columns: 1fr auto; gap: 24px; padding: 32px 0; border-top: 1px solid var(--border); }
.num-row:last-child { border-bottom: 1px solid var(--border); }
.num-row h3 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); }
.num-row p { color: var(--muted); margin-top: 10px; font-size: 1rem; line-height: 1.6; max-width: 48ch; }
.num-row .num { font-family: var(--font); font-size: .8rem; font-weight: 600; color: var(--faint); letter-spacing: .12em; padding-top: 8px; }

/* Value cards */
.value-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.value-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 32px; box-shadow: var(--shadow-sm); transition: box-shadow .2s ease, transform .14s ease; }
.value-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.value-card .vic { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; background: var(--cream); color: var(--ink); margin-bottom: 22px; }
.value-card .vic svg { width: 22px; height: 22px; }
.value-card h3 { font-size: 1.32rem; }
.value-card p { color: var(--muted); margin-top: 11px; font-size: .98rem; line-height: 1.6; }

/* Cream section + alternating */
.section-cream { background: var(--cream); border-block: 1px solid var(--border); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 600;
  font-size: .95rem;
  line-height: 1;
  letter-spacing: -0.01em;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .22s ease, background .2s ease, border-color .2s ease, color .2s ease, opacity .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; }

.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 1px 2px rgba(10,10,10,.28), 0 4px 14px rgba(10,10,10,.14); }
.btn-primary:hover { background: #1c1c1c; box-shadow: 0 2px 6px rgba(10,10,10,.24), 0 8px 20px rgba(10,10,10,.16); }

.btn-navy { background: var(--ink); color: #fff; box-shadow: 0 1px 2px rgba(10,10,10,.28), 0 4px 14px rgba(10,10,10,.14); }
.btn-navy:hover { background: #1c1c1c; }

.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--border-2); }
.btn-outline:hover { border-color: var(--ink); background: var(--surface); }

.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--navy-soft); color: var(--ink); }

/* Continue with Google */
.btn-google { background: var(--surface); color: var(--ink); border-color: var(--border-2); gap: 10px; }
.btn-google:hover { border-color: var(--ink); background: var(--surface); }
.btn-google .g-icon { flex: none; }

/* "or" divider between social + email auth */
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 18px 0; color: var(--faint); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }

.btn-lg { padding: 15px 28px; font-size: 1rem; border-radius: var(--r-pill); }
.btn-sm { padding: 8px 15px; font-size: .87rem; border-radius: var(--r-pill); }
.btn-block { width: 100%; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250,250,249,.82);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav-menu { display: flex; align-items: center; flex: 1; gap: 18px; min-width: 0; }
.nav-bar { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.nav-logout span { display: none; } /* desktop: icon-only logout */
.brand { display: inline-flex; align-items: center; }
.brand-img { height: 30px; width: auto; display: block; }
.site-footer .brand-img { height: 32px; }

.nav-links { display: flex; align-items: center; gap: 2px; margin-inline: auto; }
.nav-links a {
  padding: 8px 13px;
  border-radius: var(--r-sm);
  font-weight: 500;
  font-size: .93rem;
  color: var(--muted);
  transition: background .18s, color .18s;
}
.nav-links a:hover { background: var(--navy-soft); color: var(--ink); }
.nav-links a.active { color: var(--ink); background: var(--navy-soft); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-user .who { font-size: .9rem; font-weight: 600; color: var(--navy); }
.nav-user .who small { display: block; font-weight: 500; color: var(--faint); font-size: .76rem; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green-soft); color: var(--green-darker);
  font-weight: 800; font-size: .9rem;
}

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; border-radius: var(--r-sm); }
.nav-toggle svg { width: 26px; height: 26px; color: var(--navy); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--cream), var(--bg) 66%); border-bottom: 1px solid var(--border); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(17,17,16,.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(17,17,16,.028) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(115% 85% at 50% -5%, #000 30%, transparent 74%);
          mask-image: radial-gradient(115% 85% at 50% -5%, #000 30%, transparent 74%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(50% 40% at 50% 108%, var(--green-ring), transparent 60%);
}
/* (old two-column hero rules removed — the new hero uses .hero-inner / .hero-title) */

/* Hero visual — a clean "match" between two listings */
.hero-visual { position: relative; }
.hero-match { position: relative; }
.hero-match .node {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--green); color: #fff; display: grid; place-items: center;
  border: 4px solid var(--surface); box-shadow: var(--shadow);
}
.hero-match .node svg { width: 20px; height: 20px; }
.float-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 18px 18px 15px;
}
.float-card + .float-card { margin-top: 16px; }
.float-card.tilt-1, .float-card.tilt-2 { transform: none; }
.fc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.fc-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--green-tint); color: var(--green-darker); flex: none; }
.fc-icon svg { width: 20px; height: 20px; }
.fc-icon.navy { background: var(--navy-soft); color: var(--ink); }
.fc-title { font-weight: 600; font-size: .98rem; letter-spacing: -.01em; }
.fc-sub { font-size: .82rem; color: var(--muted); margin-top: 1px; }
.fc-row { display: flex; justify-content: space-between; font-size: .88rem; color: var(--muted); padding: 8px 0; border-top: 1px solid var(--border); }
.fc-row span:last-child { font-weight: 600; color: var(--ink); }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .74rem; font-weight: 600; letter-spacing: -.005em;
  padding: 5px 10px; border-radius: var(--r-pill);
}
.badge-wanted { background: var(--navy-soft); color: var(--ink-2); }
.badge-offer  { background: var(--navy-soft); color: var(--ink-2); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.badge-offer .badge-dot { background: var(--green); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .82rem; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 6px 11px; box-shadow: var(--shadow-xs);
}
.chip svg { width: 14px; height: 14px; color: var(--faint); }

/* ---------- "How it works" steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 30px; position: relative; box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .14s ease;
}
.step:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.step .num {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 600; font-size: 1.05rem;
  background: var(--ink); color: #fff; margin-bottom: 20px;
}
.step h3 { font-size: 1.14rem; letter-spacing: -.015em; }
.step p { color: var(--muted); margin-top: 9px; font-size: .96rem; line-height: 1.6; }

/* ---------- Two-audience split ---------- */
.audience { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.aud-card {
  border-radius: var(--r-lg); padding: 38px; position: relative; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm);
}
.aud-card > * { position: relative; z-index: 1; }
.aud-card.factory::before, .aud-card.org::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
}
.aud-card.org::before { background: radial-gradient(80% 65% at 100% 0%, var(--navy-soft), transparent 58%); }
.aud-card.factory::before { background: radial-gradient(80% 65% at 100% 0%, var(--navy-soft), transparent 58%); }
.aud-card h3 { font-size: 1.7rem; color: var(--ink); margin-top: 8px; letter-spacing: -.02em; }
.aud-card .kicker { font-family: var(--font); font-size: .76rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.aud-card p { margin: 14px 0 26px; font-size: 1rem; color: var(--muted); line-height: 1.6; }
.aud-list { display: grid; gap: 13px; margin-bottom: 30px; }
.aud-list li { display: flex; gap: 11px; align-items: flex-start; font-size: .97rem; color: var(--ink-2); }
.aud-list svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--ink); }

/* ---------- Listing cards ---------- */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.listing-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 22px; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .14s, border-color .2s;
}
.listing-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--border-2); }
.lc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.lc-date { font-size: .8rem; color: var(--faint); }
.lc-title { font-size: 1.12rem; font-weight: 600; letter-spacing: -.017em; }
.lc-material { color: var(--muted); font-weight: 500; font-size: .78rem; margin-top: 5px; text-transform: uppercase; letter-spacing: .05em; }
.lc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.lc-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lc-party { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lc-party .avatar { width: 32px; height: 32px; font-size: .78rem; }
.lc-party .nm { font-size: .88rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-party .loc { font-size: .78rem; color: var(--muted); }

/* ---------- Filter bar ---------- */
.toolbar { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-xs); }
.toolbar-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.search-box { position: relative; flex: 1 1 260px; }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); }
.search-box input[type=text] { width: 100%; padding-left: 44px; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 4px; }
.seg button { border: none; background: none; padding: 8px 16px; border-radius: var(--r-pill); font-weight: 600; font-size: .88rem; color: var(--muted); cursor: pointer; transition: .15s; }
.seg button.active { background: #fff; color: var(--navy); box-shadow: var(--shadow-xs); }
.seg button.active[data-type="wanted"] { color: var(--navy); }
.seg button.active[data-type="offer"] { color: var(--green-dark); }
.result-count { font-size: .9rem; color: var(--muted); }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 18px; }
.field > label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 7px; color: var(--ink); }
.field .hint { font-weight: 500; color: var(--faint); font-size: .82rem; }
.input, input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], select, textarea {
  width: 100%;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  font-size: .98rem;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 110px; }
.input:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-ring);
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Role / type selector cards */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.choice {
  position: relative; cursor: pointer;
  border: 1.5px solid var(--border-2); border-radius: var(--r-lg);
  padding: 20px; transition: border-color .15s, background .15s, box-shadow .15s;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--navy-soft); color: var(--navy); margin-bottom: 12px; }
.choice h4 { font-size: 1.05rem; }
.choice p { font-size: .86rem; color: var(--muted); margin-top: 4px; }
.choice .tick { position: absolute; top: 16px; right: 16px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-2); display: grid; place-items: center; color: #fff; transition: .15s; }
.choice:hover { border-color: var(--green); }
.choice input:checked ~ .tick { background: var(--green); border-color: var(--green); }
.choice:has(input:checked) { border-color: var(--green); background: var(--green-tint); box-shadow: 0 0 0 3px rgba(31,164,99,.12); }
.choice:has(input:checked) .ic { background: var(--green-soft); color: var(--green-darker); }

/* Checkbox row (ذمة agreement) */
.check {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px; border: 1px solid var(--border-2); border-radius: var(--r);
  background: var(--green-tint);
}
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--green); }
.check label { font-size: .9rem; color: var(--ink-2); }
.check a { color: var(--green-dark); font-weight: 600; text-decoration: underline; }

/* ---------- Pledge / ذمة box ---------- */
.pledge {
  border: 1px solid var(--green); border-radius: var(--r-lg);
  background: linear-gradient(170deg, var(--green-tint), #fff);
  padding: 22px; position: relative;
}
.pledge-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pledge-head .ic { width: 40px; height: 40px; border-radius: 11px; background: var(--green); color: #fff; display: grid; place-items: center; flex: none; }
.pledge-head h4 { font-size: 1.06rem; }
.pledge-head .ar { font-size: 1.25rem; font-weight: 700; color: var(--green-dark); margin-left: auto; }
.pledge p { font-size: .92rem; color: var(--ink-2); }
.pledge .rate { font-weight: 800; color: var(--green-dark); }

/* ---------- Auth layout ---------- */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - var(--nav-h)); }
.auth-aside {
  background: linear-gradient(165deg, var(--navy), var(--navy-2));
  color: #fff; padding: 56px 48px; display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.auth-aside::after { content:""; position:absolute; inset:0; background: radial-gradient(50% 40% at 90% 10%, rgba(31,164,99,.25), transparent 60%); }
.auth-aside .inner { position: relative; max-width: 420px; }
.auth-aside h2 { color: #fff; font-size: 2rem; }
.auth-aside p { color: rgba(255,255,255,.78); margin-top: 14px; font-size: 1.05rem; }
.auth-aside .pts { margin-top: 30px; display: grid; gap: 16px; }
.auth-aside .pts li { display: flex; gap: 12px; align-items: flex-start; }
.auth-aside .pts svg { width: 22px; height: 22px; color: var(--green); flex: none; margin-top: 1px; }
.auth-aside .pts b { display: block; }
.auth-aside .pts span { color: rgba(255,255,255,.72); font-size: .9rem; }
.auth-main { display: grid; place-items: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 460px; }
.auth-card h1 { font-size: 1.7rem; }
.auth-card .sub { color: var(--muted); margin: 8px 0 28px; }
.form-divider { display: flex; align-items: center; gap: 14px; color: var(--faint); font-size: .85rem; margin: 22px 0; }
.form-divider::before, .form-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.form-foot { text-align: center; margin-top: 22px; font-size: .92rem; color: var(--muted); }
.form-foot a { color: var(--green-dark); font-weight: 600; }

/* ---------- Page header (inner pages) ---------- */
.page-head { background: var(--surface); border-bottom: 1px solid var(--border); padding: 48px 0 40px; position: relative; overflow: hidden; }
.page-head::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(10,10,10,.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(10,10,10,.025) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(120% 110% at 50% -30%, #000 28%, transparent 74%);
          mask-image: radial-gradient(120% 110% at 50% -30%, #000 28%, transparent 74%);
}
.page-head .container { position: relative; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); letter-spacing: -.03em; }
.page-head p { color: var(--muted); margin-top: 10px; }
.page-head p svg { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; margin-inline-end: 2px; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a:hover { color: var(--green-dark); }

/* ---------- Detail page ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 26px; }
.panel + .panel { margin-top: 20px; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 4px; }
.spec { padding: 14px 16px; background: var(--bg); border-radius: var(--r); }
.spec .k { font-size: .8rem; color: var(--muted); }
.spec .v { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin-top: 3px; }
.side-card { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; position: sticky; top: calc(var(--nav-h) + 20px); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .ic { width: 64px; height: 64px; border-radius: 18px; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; margin: 0 auto 18px; }

/* ---------- Alerts ---------- */
.alert { padding: 13px 16px; border-radius: var(--r); font-size: .9rem; display: flex; gap: 10px; align-items: flex-start; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert-error { background: var(--danger-soft); color: #9c2a2a; }
.alert-ok { background: var(--green-soft); color: var(--green-darker); }

/* ---------- CTA band ---------- */
.cta-band { background: var(--cream); border: 1px solid var(--border-2); border-radius: 28px; padding: 84px 56px; text-align: center; color: var(--ink); position: relative; overflow: hidden; }
.cta-band::before {
  content:""; position:absolute; inset:0; pointer-events:none;
  background:
    radial-gradient(50% 70% at 50% 118%, var(--green-ring), transparent 60%),
    linear-gradient(to right, rgba(17,17,16,.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(17,17,16,.02) 1px, transparent 1px);
  background-size: auto, 54px 54px, 54px 54px;
  -webkit-mask-image: radial-gradient(100% 120% at 50% 0%, #000 34%, transparent 78%);
          mask-image: radial-gradient(100% 120% at 50% 0%, #000 34%, transparent 78%);
}
.cta-band > * { position: relative; }
.cta-band h2 { color: var(--ink); font-size: clamp(2.2rem, 5vw, 3.5rem); letter-spacing: -.02em; }
.cta-band p { color: var(--muted); margin: 18px auto 30px; max-width: 46ch; font-size: 1.08rem; line-height: 1.55; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); color: var(--muted); border-top: 1px solid var(--border); margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; padding: 60px 0 40px; }
.site-footer .brand { color: var(--ink); }
.site-footer .brand b { color: var(--green-dark); }
.footer-about { color: var(--muted); font-size: .92rem; margin-top: 16px; max-width: 34ch; line-height: 1.6; }
.footer-col h5 { color: var(--ink); font-size: .78rem; font-weight: 600; margin-bottom: 14px; letter-spacing: .05em; text-transform: uppercase; }
.footer-col a { display: block; padding: 5px 0; font-size: .92rem; color: var(--muted); transition: color .15s; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom { border-top: 1px solid var(--border); padding: 22px 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .85rem; color: var(--faint); }

/* ---------- Oath / قَسَم page ---------- */
.oath-page { padding: 56px 0 72px; }
.oath-card {
  max-width: 820px; margin: 0 auto;
  background: #fff; border: 1px solid var(--border); border-radius: 22px;
  box-shadow: var(--shadow); padding: 38px 44px;
  direction: rtl;
  font-family: "SF Arabic", "Geeza Pro", "Noto Naskh Arabic", "Segoe UI", var(--font);
}
.oath-top { display: flex; justify-content: flex-start; margin-bottom: 6px; }
.oath-top a { color: var(--faint); display: inline-flex; }
.oath-top svg { width: 26px; height: 26px; }
.oath-title { font-size: 1.8rem; font-weight: 800; color: var(--navy); margin-bottom: 22px; }
.oath-bism { color: var(--muted); font-size: 1.05rem; margin-bottom: 6px; }
.oath-verse {
  color: var(--ink-2); font-size: 1.12rem; line-height: 2.2;
  border-bottom: 1px solid var(--border); padding-bottom: 22px; margin-bottom: 24px;
}
.oath-verse .src { color: var(--faint); font-size: .92rem; }
.oath-points { display: grid; gap: 16px; margin-bottom: 24px; }
.oath-point { display: flex; gap: 10px; font-size: 1.08rem; color: var(--ink); line-height: 1.95; }
.oath-point .star { color: var(--green); font-weight: 800; flex: none; }
.oath-rate { color: var(--green-dark); font-weight: 800; }
.oath-note { background: var(--green-soft); border-radius: var(--r); padding: 16px 18px; margin-bottom: 24px; }
.oath-note h5 { color: var(--green-darker); font-size: 1.04rem; margin-bottom: 6px; }
.oath-note p { color: var(--green-darker); font-size: .98rem; }
.oath-agree {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px; border: 1.5px solid var(--border-2); border-radius: var(--r);
  margin-bottom: 22px; cursor: pointer; transition: border-color .15s, background .15s;
}
.oath-agree:has(input:checked) { border-color: var(--green); background: var(--green-tint); }
.oath-agree input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--green); }
.oath-agree label, .oath-agree span { font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.oath-actions { display: flex; gap: 12px; }

/* ---------- Dashboard ---------- */
.dash-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 26px; }
.dash-tabs button {
  border: none; background: none; padding: 12px 18px;
  font-weight: 600; font-size: .98rem; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.dash-tabs button:hover { color: var(--navy); }
.dash-tabs button.active { color: var(--green-dark); border-bottom-color: var(--green); }
.dash-tabs .count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--green); color: #fff; font-size: .72rem; margin-inline-start: 6px;
}

/* ---------- Messaging ---------- */
.chat {
  display: grid; grid-template-columns: 320px 1fr;
  border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
  min-height: 560px; background: #fff;
}
.thread-list { border-inline-end: 1px solid var(--border); overflow-y: auto; max-height: 620px; }
.thread-item {
  display: flex; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
}
.thread-item:hover { background: var(--bg); }
.thread-item.active { background: var(--green-tint); }
.thread-item .avatar { flex: none; width: 40px; height: 40px; }
.thread-item .ti-main { min-width: 0; flex: 1; }
.thread-item .ti-name { font-weight: 700; font-size: .92rem; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-item .ti-sub { font-size: .8rem; color: var(--green-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-item .ti-last { font-size: .82rem; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.thread-view { display: flex; flex-direction: column; min-width: 0; }
.tv-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.tv-head .avatar { width: 40px; height: 40px; flex: none; }
.tv-head .ti-name { font-weight: 700; color: var(--navy); }
.tv-head .badge { margin-inline-start: auto; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-body { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); max-height: 440px; }
.bubble { max-width: 74%; padding: 10px 14px; border-radius: 16px; font-size: .95rem; line-height: 1.5; }
.bubble.them { align-self: flex-start; background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 5px; color: var(--ink); }
.bubble.me { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 5px; }
.bubble .meta { display: block; font-size: .7rem; margin-top: 5px; opacity: .75; }
.tv-compose { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--border); }
.tv-compose input { flex: 1; }
.tv-compose .btn { padding: 12px 18px; }
.chat-empty { grid-column: 1 / -1; display: grid; place-items: center; text-align: center; padding: 40px; }
.chat-empty .empty { padding: 0; }

/* ---------- Avatar with logo ---------- */
.avatar-logo { padding: 0; overflow: hidden; background: #fff; border: 1px solid var(--border); }
.avatar-logo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Danger button + status badges ---------- */
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b83838; }
.badge-ok { background: var(--green-soft); color: var(--green-darker); }
.badge-closed { background: #eef1f4; color: var(--muted); }

/* ---------- Listing manage card ---------- */
.listing-card.is-closed { opacity: .72; }
.mng-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.mng-actions .btn { flex: 1; min-width: 90px; }
.mng-actions .mng-del { color: var(--danger); flex: 0 0 auto; }
.mng-actions .mng-del:hover { background: var(--danger-soft); }

/* ---------- Account: logo editor ---------- */
.logo-edit { display: flex; align-items: center; gap: 16px; }
.logo-preview {
  width: 72px; height: 72px; border-radius: 14px; flex: none; overflow: hidden;
  display: grid; place-items: center; background: var(--green-soft);
  color: var(--green-darker); font-weight: 800; font-size: 1.2rem; border: 1px solid var(--border);
}
.logo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Fee payment page ---------- */
.fee-card { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 8px 22px; box-shadow: var(--shadow-xs); }
.fee-head { display: flex; align-items: center; gap: 10px; padding: 16px 0 6px; }
.fee-head svg { width: 22px; height: 22px; color: var(--green-dark); flex: none; }
.fee-head h3 { font-size: 1.1rem; }
.fee-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 15px 0; border-top: 1px solid var(--border); }
.fee-row:first-of-type { border-top: 0; }
.fee-row .k { color: var(--muted); font-size: .92rem; }
.fee-row .v { font-weight: 700; color: var(--navy); }
.fee-iban .v { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; font-size: .95rem; }

/* ---------- Legal pages (Terms / Privacy / Listing) ---------- */
.legal-layout { display: grid; grid-template-columns: 272px 1fr; gap: 48px; align-items: start; padding: 40px 0 76px; }
.legal-sidebar { position: sticky; top: calc(var(--nav-h) + 20px); align-self: start; }
.legal-switch { display: grid; gap: 7px; margin-bottom: 24px; }
.legal-switch a {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-radius: var(--r); font-weight: 600; font-size: .92rem; color: var(--ink-2);
  border: 1px solid var(--border); background: #fff; transition: border-color .15s, color .15s, background .15s;
}
.legal-switch a:hover { border-color: var(--green); color: var(--green-dark); }
.legal-switch a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.legal-switch a.active svg { color: #fff; }
.legal-switch svg { width: 18px; height: 18px; color: var(--faint); flex: none; }
.legal-toc-label { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 0 0 10px 4px; }
.legal-toc { display: grid; gap: 1px; border-inline-start: 2px solid var(--border); max-height: calc(100vh - var(--nav-h) - 220px); overflow-y: auto; }
.legal-toc a {
  display: block; padding: 6px 14px; font-size: .85rem; color: var(--muted);
  border-inline-start: 2px solid transparent; margin-inline-start: -2px; line-height: 1.4; transition: color .15s, border-color .15s;
}
.legal-toc a:hover { color: var(--navy); }
.legal-toc a.active { color: var(--green-dark); font-weight: 600; border-inline-start-color: var(--green); }

.legal-article { max-width: 760px; }
.legal-doc[data-lang="ar"] { display: none; } /* shown by app.js when language = Arabic */
.legal-eyebrow { color: var(--green-dark); font-weight: 700; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
.legal-article h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 8px 0 16px; }
.legal-doc-meta { display: flex; gap: 20px; flex-wrap: wrap; font-size: .86rem; color: var(--muted); border-block: 1px solid var(--border); padding: 16px 0; margin-bottom: 26px; }
.legal-doc-meta b { color: var(--ink); font-weight: 600; }
.legal-prose h2 { font-size: 1.35rem; margin: 38px 0 12px; scroll-margin-top: calc(var(--nav-h) + 20px); }
.legal-prose h2 .num { color: var(--green); margin-inline-end: 8px; }
.legal-prose h3 { font-size: 1.04rem; margin: 22px 0 8px; color: var(--navy); }
.legal-prose p { color: var(--ink-2); margin: 0 0 14px; line-height: 1.72; }
.legal-prose ul { margin: 0 0 16px; padding-inline-start: 22px; display: grid; gap: 8px; list-style: disc; }
.legal-prose li { color: var(--ink-2); line-height: 1.6; }
.legal-prose li::marker { color: var(--green); }
.legal-prose strong { color: var(--ink); font-weight: 700; }
.legal-prose a { color: var(--green-dark); text-decoration: underline; }
.legal-prose hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }
.legal-contact { display: inline-flex; align-items: center; gap: 9px; background: var(--green-soft); color: var(--green-darker); font-weight: 600; padding: 10px 16px; border-radius: var(--r); text-decoration: none !important; }
.legal-contact svg { width: 18px; height: 18px; }

.legal-callout { border-radius: var(--r); padding: 16px 18px; margin: 0 0 22px; font-size: .9rem; line-height: 1.62; border: 1px solid; }
.legal-callout .ct { display: block; font-weight: 700; margin-bottom: 7px; font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; }
.legal-callout ul { margin: 8px 0 0; padding-inline-start: 20px; display: grid; gap: 5px; }
.legal-callout.warn { background: var(--amber-soft); border-color: #efd28a; color: #855e10; }
.legal-callout.warn .ct { color: #a9760c; }
.legal-callout.note { background: var(--navy-soft); border-color: #cdd9e6; color: var(--navy-2); }
.legal-callout.note .ct { color: var(--navy); }

@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr; gap: 8px; }
  .legal-sidebar { position: static; margin-bottom: 18px; }
  .legal-switch { grid-template-columns: 1fr 1fr 1fr; }
  .legal-switch a { flex-direction: column; text-align: center; gap: 6px; font-size: .82rem; padding: 12px 8px; }
  .legal-toc, .legal-toc-label { display: none; } /* hide the long TOC on mobile; doc-switcher stays */
}

/* ---------- Language button ---------- */
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--border-2); border-radius: var(--r-pill);
  padding: 7px 12px; font-weight: 600; font-size: .85rem; color: var(--ink-2); cursor: pointer;
  transition: border-color .15s, color .15s, background .15s; white-space: nowrap;
}
.lang-btn:hover { border-color: var(--green); color: var(--green-dark); background: var(--green-tint); }
.lang-btn svg { width: 17px; height: 17px; color: var(--ink-2); }

/* ---------- RTL (Arabic) fixes for physical-position styles ---------- */
[dir="rtl"] .search-box svg { left: auto; right: 14px; }
[dir="rtl"] .search-box input { padding-left: 14px; padding-right: 42px; }
[dir="rtl"] select {
  background-position: left 12px center;
  padding-right: 14px; padding-left: 40px;
}
[dir="rtl"] .choice .tick { right: auto; left: 16px; }
[dir="rtl"] .oath-actions .btn { } /* oath card is already rtl */

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-visual { order: 0; } /* headline first on smaller screens */
  .float-card.tilt-1, .float-card.tilt-2 { transform: none; } /* stop horizontal overflow */
  .steps { grid-template-columns: 1fr; }
  .audience { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; gap: 30px; }
  .split-intro { position: static; }
  .value-cards { grid-template-columns: 1fr; }
  .hero-inner { padding: 74px 0 60px; }
  .detail-grid { grid-template-columns: 1fr; }
  .side-card { position: static; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-menu {
    display: none; position: absolute; top: var(--nav-h); inset-inline: 0;
    flex-direction: column; align-items: stretch; gap: 6px;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 12px 22px 18px; box-shadow: var(--shadow);
  }
  .nav-menu.open { display: flex; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 2px; margin: 0; }
  .nav-actions { flex-direction: column; align-items: stretch; gap: 8px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
  .nav-actions .btn { width: 100%; }
  .nav-user { justify-content: flex-start; }
  .nav-logout span { display: inline; }
  .field-row, .field-row-3, .choice-grid, .spec-grid { grid-template-columns: 1fr; }
  .section { padding: 54px 0; }
  .cta-band { padding: 36px 22px; }
  .footer-grid { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 1fr; }
  .thread-list { max-height: 220px; }
  .oath-card { padding: 28px 22px; }
  .oath-title { font-size: 1.5rem; }
  .hero-visual { display: none; } /* drop decorative cards on phones for a clean hero */
  .stat-cell { padding: 6px 12px; }
  .container { padding-inline: 18px; }
}
@media (max-width: 460px) {
  .hero-trust { gap: 18px; }
  .hero-cta .btn { flex: 1; }
  .lang-btn span { display: none; }
  .lang-btn { padding: 8px; }
}
