/* ============================================================
   وظيفة ومباريات المغرب — Wadifa et Concours Maroc
   Design system: RTL Arabic, Moroccan emerald + terracotta
   ============================================================ */

:root {
  --primary: #0e7a5f;
  --primary-dark: #0a5f49;
  --primary-deep: #064e3b;
  --primary-soft: #e6f4ef;
  --accent: #d97706;
  --accent-soft: #fdf1e0;
  --terracotta: #c2571b;
  --ink: #0f172a;
  --body: #475569;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --white: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(6, 78, 59, 0.18);
  --font: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--body);
  background: var(--bg);
  line-height: 1.8;
  font-size: 16px;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.container { width: min(1160px, 92%); margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  border: 2px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: var(--white); box-shadow: 0 8px 20px rgba(14, 122, 95, 0.35); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(14, 122, 95, 0.4); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary-soft); transform: translateY(-2px); }
.btn-accent { background: var(--accent); color: var(--white); box-shadow: 0 8px 20px rgba(217, 119, 6, 0.35); }
.btn-accent:hover { background: #b45309; transform: translateY(-2px); }
.btn-light { background: var(--white); color: var(--primary-deep); }
.btn-light:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-sm { padding: 8px 18px; font-size: 13.5px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.3s ease;
}
.site-header.scrolled { box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { height: 54px; width: auto; object-fit: contain; border-radius: 10px; padding: 3px 7px; background: #fff; box-shadow: var(--shadow-sm); border: 2px solid var(--primary-soft); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.brand:hover .logo { transform: scale(1.05); box-shadow: var(--shadow); }
.brand-text { font-size: 19px; font-weight: 800; color: var(--ink); line-height: 1.3; }
.brand-text b { color: var(--primary); }
.main-nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  color: var(--body);
  transition: background 0.2s ease, color 0.2s ease;
}
.nav-link:hover { color: var(--primary); background: var(--primary-soft); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }
.nav-cta { margin-inline-start: 8px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: var(--primary-soft);
  border: none;
  border-radius: 12px;
}
.nav-toggle span { display: block; height: 2.5px; width: 100%; background: var(--primary); border-radius: 2px; transition: transform 0.3s ease, opacity 0.3s ease; }
.site-header.open .nav-toggle span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.site-header.open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.open .nav-toggle span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 76px 0 84px;
  background:
    radial-gradient(1000px 420px at 85% -10%, rgba(14, 122, 95, 0.18), transparent 60%),
    radial-gradient(800px 380px at 8% 110%, rgba(217, 119, 6, 0.14), transparent 60%),
    linear-gradient(180deg, #f0faf6 0%, #f8fafc 100%);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(14, 122, 95, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 122, 95, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(700px 400px at 50% 30%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero-inner { position: relative; text-align: center; max-width: 780px; margin-inline: auto; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid rgba(14, 122, 95, 0.2);
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
  padding: 7px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}
.hero-badge .pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(14, 122, 95, 0.45); } 50% { box-shadow: 0 0 0 8px rgba(14, 122, 95, 0); } }
.hero-title {
  font-size: clamp(34px, 5.2vw, 54px);
  font-weight: 900;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 18px;
}
.hero-title .hl { color: var(--primary); position: relative; }
.hero-title .hl::after {
  content: "";
  position: absolute;
  right: 0; left: 0; bottom: 2px;
  height: 12px;
  background: rgba(217, 119, 6, 0.28);
  z-index: -1;
  border-radius: 4px;
}
.hero-sub { font-size: clamp(16px, 2vw, 19px); color: var(--body); max-width: 620px; margin: 0 auto 34px; }

.hero-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border-radius: 999px;
  padding: 8px 8px 8px 18px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(14, 122, 95, 0.15);
  max-width: 640px;
  margin-inline: auto;
}
.hero-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  padding: 10px 4px;
  min-width: 0;
}
.hero-search input::placeholder { color: var(--muted); }
.hero-search .btn { border-radius: 999px; }
.hero-meta { margin-top: 20px; font-size: 14px; color: var(--muted); }
.hero-meta a { color: var(--primary); font-weight: 700; }
.hero-meta a:hover { text-decoration: underline; }

/* ---------- Stats ---------- */
.stats { background: var(--primary-deep); position: relative; overflow: hidden; }
.stats::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 46px 0; position: relative; }
.stat { text-align: center; }
.stat-num { font-size: clamp(28px, 4vw, 42px); font-weight: 900; color: #fff; line-height: 1.2; }
.stat-num span { color: #fbbf24; }
.stat-label { color: rgba(255, 255, 255, 0.75); font-weight: 600; margin-top: 4px; }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section.alt { background: var(--white); border-block: 1px solid var(--line); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-eyebrow {
  display: inline-block;
  color: var(--primary);
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: 0.5px;
  background: var(--primary-soft);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.section-title { font-size: clamp(26px, 3.6vw, 36px); font-weight: 900; color: var(--ink); line-height: 1.4; }
.section-sub { margin-top: 10px; color: var(--body); font-size: 16.5px; }
.section-link-row { text-align: center; margin-top: 34px; }

/* ---------- Category cards ---------- */
.cats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.cat-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}
.cat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: rgba(14, 122, 95, 0.35); }
.cat-icon {
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: var(--primary-soft);
  transition: transform 0.3s ease;
}
.cat-card:hover .cat-icon { transform: scale(1.08) rotate(-4deg); }
.cat-name { font-weight: 800; color: var(--ink); font-size: 17px; line-height: 1.5; }
.cat-count { font-size: 13.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.cat-card.featured { background: linear-gradient(135deg, var(--primary-deep), var(--primary)); border: none; }
.cat-card.featured .cat-icon { background: rgba(255, 255, 255, 0.14); }
.cat-card.featured .cat-name { color: #fff; }
.cat-card.featured .cat-count { color: rgba(255, 255, 255, 0.8); }
.cat-arrow { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 20px; transition: left 0.25s ease, color 0.25s ease; }
.cat-card:hover .cat-arrow { left: 14px; color: var(--primary); }
.cat-card.featured .cat-arrow { color: rgba(255, 255, 255, 0.7); }

/* ---------- Jobs ---------- */
.jobs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.job-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.job-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.job-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.job-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}
.job-badge.private { background: var(--accent-soft); color: var(--accent); }
.job-badge.model { background: #eef2ff; color: #4338ca; }
.job-date { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.job-title { font-size: 17.5px; font-weight: 800; color: var(--ink); line-height: 1.6; }
.job-desc { font-size: 14.5px; color: var(--body); flex: 1; }
.job-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.job-place { font-size: 13px; color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.job-link { color: var(--primary); font-weight: 800; font-size: 14px; }
.job-link:hover { text-decoration: underline; }

/* ---------- Split (seekers / employers) ---------- */
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.split-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 30px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.split-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.split-card::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 5px; }
.split-card.seeker::before { background: linear-gradient(90deg, var(--primary), #34d399); }
.split-card.employer::before { background: linear-gradient(90deg, var(--accent), #f59e0b); }
.split-icon { font-size: 38px; margin-bottom: 14px; }
.split-title { font-size: 21px; font-weight: 900; color: var(--ink); margin-bottom: 6px; }
.split-sub { color: var(--muted); font-weight: 600; margin-bottom: 16px; }
.split-list { display: grid; gap: 11px; margin-bottom: 22px; }
.split-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.split-list .tick { color: var(--primary); font-weight: 900; }
.split-card.employer .split-list .tick { color: var(--accent); }

/* ---------- Steps ---------- */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
.step {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.step:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 18px;
  inset-inline-start: 18px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
  font-size: 15px;
}
.step-icon { font-size: 34px; margin-bottom: 12px; }
.step h3 { font-size: 18px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.step p { font-size: 14.5px; }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  background: linear-gradient(120deg, var(--primary-deep), var(--primary) 55%, #0d9488);
  border-radius: 24px;
  padding: 56px 40px;
  text-align: center;
  color: #fff;
  overflow: hidden;
}
.cta-band::after {
  content: "";
  position: absolute;
  width: 340px; height: 340px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  top: -140px; left: -100px;
}
.cta-band::before {
  content: "";
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.16);
  bottom: -120px; right: -80px;
}
.cta-title { font-size: clamp(24px, 3.4vw, 34px); font-weight: 900; margin-bottom: 10px; position: relative; z-index: 1; }
.cta-sub { color: rgba(255, 255, 255, 0.85); max-width: 560px; margin: 0 auto 26px; position: relative; z-index: 1; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; position: relative; z-index: 1; }

/* ---------- Footer ---------- */
.site-footer { background: #062e24; color: rgba(255, 255, 255, 0.72); margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 34px; padding: 56px 0 40px; }
.footer-brand .brand { gap: 12px; }
.footer-brand .brand .logo { height: 38px; width: auto; object-fit: contain; border-radius: 8px; padding: 2px 6px; background: #fff; border: 2px solid rgba(110, 231, 183, 0.35); }
.footer-brand .brand-text { color: #fff; }
.footer-brand .brand-text b { color: #6ee7b7; }
.footer-brand p { margin-top: 14px; font-size: 14.5px; line-height: 1.9; }
.socials { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.socials a {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: background 0.25s ease, transform 0.25s ease, color 0.25s ease;
}
.socials svg { width: 18px; height: 18px; }
.socials a:hover { background: var(--primary); color: #fff; transform: translateY(-3px); }
.footer-title { color: #fff; font-size: 16.5px; font-weight: 800; margin-bottom: 16px; }
.footer-col { display: grid; gap: 9px; align-content: start; }
.footer-link { font-size: 14.5px; transition: color 0.2s ease, transform 0.2s ease; display: inline-flex; gap: 8px; }
.footer-link::before { content: "←"; color: #6ee7b7; opacity: 0; transition: opacity 0.2s ease; }
.footer-link:hover { color: #6ee7b7; }
.footer-link:hover::before { opacity: 1; }
.footer-contact li { display: flex; gap: 10px; font-size: 14.5px; align-items: flex-start; }
.footer-contact .ic { color: #6ee7b7; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); padding: 18px 0; }
.footer-bottom p { font-size: 13.5px; text-align: center; }

/* ---------- Inner pages hero ---------- */
.page-hero {
  position: relative;
  padding: 58px 0 60px;
  background:
    radial-gradient(900px 380px at 90% -20%, rgba(14, 122, 95, 0.16), transparent 60%),
    radial-gradient(700px 340px at 0% 120%, rgba(217, 119, 6, 0.12), transparent 60%),
    linear-gradient(180deg, #f0faf6, #f8fafc);
  text-align: center;
}
.page-hero-title { font-size: clamp(28px, 4vw, 42px); font-weight: 900; color: var(--ink); line-height: 1.4; }
.page-hero-sub { max-width: 640px; margin: 12px auto 0; font-size: 16.5px; }
.crumbs { margin-top: 16px; font-size: 13.5px; color: var(--muted); font-weight: 700; }
.crumbs a { color: var(--primary); }
.crumbs a:hover { text-decoration: underline; }

/* ---------- Tools bar (search + chips) ---------- */
.tools-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 30px;
  position: sticky;
  top: 78px;
  z-index: 40;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  flex: 1;
  min-width: 240px;
  max-width: 420px;
}
.search-field input { border: none; outline: none; background: transparent; flex: 1; font-size: 15px; color: var(--ink); }
.search-field input::placeholder { color: var(--muted); }
.search-field .ic { color: var(--primary); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--white);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--body);
  transition: all 0.2s ease;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(14, 122, 95, 0.3); }
.results-count { font-size: 14px; color: var(--muted); font-weight: 700; }

/* ---------- Requests page ---------- */
.req-section { margin-bottom: 40px; }
.req-section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.req-section-num {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--primary-deep);
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 6px 16px rgba(6, 78, 59, 0.25);
}
.req-section-title { font-size: 21px; font-weight: 900; color: var(--ink); }
.req-section-count { font-size: 13px; color: var(--muted); font-weight: 700; }
.req-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.req-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: all 0.22s ease;
  cursor: pointer;
  text-align: right;
}
.req-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(14, 122, 95, 0.4); }
.req-num {
  flex-shrink: 0;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}
.req-title { font-size: 14.5px; font-weight: 700; color: var(--ink); line-height: 1.6; flex: 1; }
.req-open { color: var(--muted); font-size: 15px; transition: color 0.2s ease, transform 0.2s ease; }
.req-card:hover .req-open { color: var(--primary); transform: translateX(-3px); }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  display: none;
}
.empty-state.show { display: block; }
.empty-icon { font-size: 46px; margin-bottom: 12px; }
.empty-state h3 { color: var(--ink); font-weight: 800; margin-bottom: 6px; }
.empty-state p { color: var(--muted); font-size: 15px; }

/* ---------- Letter modal ---------- */
.letter-modal { position: fixed; inset: 0; z-index: 100; display: none; }
.letter-modal.open { display: block; }
.letter-modal-backdrop { position: absolute; inset: 0; background: rgba(6, 46, 36, 0.55); backdrop-filter: blur(3px); animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.letter-modal-panel {
  position: relative;
  max-width: 760px;
  max-height: 90vh;
  margin: 4vh auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popIn 0.3s cubic-bezier(0.22, 1.2, 0.36, 1);
}
@keyframes popIn { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: none; } }
.letter-modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.letter-modal-title { flex: 1; font-weight: 800; color: var(--ink); font-size: 15px; }
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--body);
  transition: all 0.2s ease;
}
.tool-btn:hover { border-color: var(--primary); color: var(--primary); }
.tool-btn.copy-btn { background: var(--primary); border-color: var(--primary); color: #fff; }
.tool-btn.copy-btn:hover { background: var(--primary-dark); }
.tool-btn.copied { background: #059669; border-color: #059669; }
.close-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: none;
  background: #eef2f1;
  color: var(--body);
  font-size: 18px;
  transition: all 0.2s ease;
}
.close-btn:hover { background: #fee2e2; color: #b91c1c; transform: rotate(90deg); }
.letter-sheet-wrap { overflow-y: auto; padding: 26px; background: #eef2f1; }
.letter-sheet {
  background: #fff;
  max-width: 660px;
  margin-inline: auto;
  padding: 42px 46px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #1e293b;
  font-size: 15.5px;
  line-height: 2.05;
}
.letter-sheet .ls-head { text-align: center; border-bottom: 2px solid var(--primary); padding-bottom: 14px; margin-bottom: 20px; }
.letter-sheet .ls-bismillah { font-size: 20px; font-weight: 800; color: var(--primary-deep); margin-bottom: 4px; }
.letter-sheet .ls-kingdom { font-weight: 800; color: var(--ink); font-size: 16px; }
.letter-sheet .ls-meta { font-size: 14px; color: var(--body); margin-bottom: 18px; }
.letter-sheet .ls-subject { font-weight: 800; color: var(--primary-deep); background: var(--primary-soft); padding: 6px 12px; border-radius: 8px; margin-bottom: 16px; }
.letter-sheet .ls-greeting { font-weight: 700; margin-bottom: 10px; }
.letter-sheet p { margin-bottom: 12px; }
.letter-sheet .ls-docs { background: #f8fafc; border: 1px dashed var(--line); border-radius: 10px; padding: 12px 16px; font-size: 14px; margin-bottom: 14px; }
.letter-sheet .ls-docs b { color: var(--primary); }
.letter-sheet .ls-closing { margin-top: 8px; }
.letter-sheet .ls-sign { margin-top: 26px; display: flex; justify-content: space-between; gap: 20px; font-size: 14.5px; flex-wrap: wrap; }
.letter-sheet .ls-sign .block b { color: var(--ink); }
.letter-sheet .ph { background: #fef3c7; border-radius: 5px; padding: 0 5px; color: #92400e; font-weight: 700; }

@media print {
  .site-header, .site-footer, .letter-modal-head, .to-top { display: none !important; }
  .letter-modal { position: static; display: block; background: none; }
  .letter-modal-backdrop { display: none !important; }
  .letter-modal-panel { max-width: 100%; margin: 0; box-shadow: none; border-radius: 0; max-height: none; }
  .letter-sheet-wrap { padding: 0; background: #fff; }
  .letter-sheet { box-shadow: none; padding: 0; max-width: 100%; }
}

/* ---------- Contact page ---------- */
.contact-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 26px; align-items: start; }
.contact-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }
.contact-card h2 { font-size: 21px; font-weight: 900; color: var(--ink); margin-bottom: 6px; }
.contact-card > p { color: var(--muted); margin-bottom: 20px; font-size: 14.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13.5px; font-weight: 800; color: var(--ink); }
.field label .req { color: #dc2626; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(14, 122, 95, 0.12);
}
.field textarea { resize: vertical; min-height: 130px; }
.form-note { font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.form-success {
  display: none;
  text-align: center;
  padding: 26px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  color: #065f46;
  font-weight: 700;
  margin-top: 18px;
}
.form-success.show { display: block; }
.info-list { display: grid; gap: 14px; margin-top: 22px; }
.info-item { display: flex; gap: 14px; align-items: flex-start; }
.info-ic {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--primary-soft);
  font-size: 20px;
}
.info-item b { display: block; color: var(--ink); font-size: 15px; }
.info-item span { font-size: 14px; }
.about-card { margin-top: 22px; background: linear-gradient(135deg, var(--primary-deep), var(--primary)); border: none; }
.about-card h2, .about-card p { color: #fff; }
.about-card h2 { margin-bottom: 10px; }
.about-card p { color: rgba(255, 255, 255, 0.85); font-size: 14.5px; }

/* ---------- To top ---------- */
.to-top {
  position: fixed;
  bottom: 26px;
  left: 26px;
  width: 48px; height: 48px;
  border-radius: 14px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  box-shadow: 0 10px 24px rgba(14, 122, 95, 0.4);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: all 0.3s ease;
  z-index: 70;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { background: var(--primary-dark); transform: translateY(-3px); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.65s ease, transform 0.65s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ============================================================
   Document cards — نماذج المباريات (emtehanat.html + index)
   ============================================================ */
.doc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.doc-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.doc-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: rgba(14, 122, 95, 0.35); }
.doc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.doc-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}
.doc-year {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.doc-title { font-size: 17.5px; font-weight: 800; color: var(--ink); line-height: 1.6; }
.doc-desc { font-size: 14.5px; color: var(--body); flex: 1; }
.doc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.doc-link-hint { color: var(--primary); font-weight: 800; font-size: 14px; transition: color 0.2s ease; }
.doc-card:hover .doc-link-hint { text-decoration: underline; }

/* ============================================================
   CV page — سيرة ذاتية (cv.html)
   ============================================================ */
.cv-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.cv-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cv-block:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cv-ic { font-size: 30px; display: block; margin-bottom: 12px; }
.cv-block h3 { font-size: 17.5px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.cv-block p { font-size: 14.5px; }
.cv-progress { color: var(--primary); font-weight: 900; background: var(--primary-soft); padding: 2px 10px; border-radius: 999px; }
.cv-check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; max-width: 860px; margin-inline: auto; }
.cv-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
}
.cv-check:hover { border-color: var(--primary); }
.cv-check input { margin-top: 6px; width: 17px; height: 17px; accent-color: var(--primary); flex-shrink: 0; }
.cv-check:has(input:checked) { background: var(--primary-soft); border-color: rgba(14, 122, 95, 0.4); }

/* ---------- CV template cards (نماذج سيرة ذاتية جاهزة) ---------- */
.cv-tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.cv-tpl {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.cv-tpl:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: rgba(14, 122, 95, 0.35); }
.cv-tpl-icon { font-size: 44px; }
.cv-tpl-lang {
  align-self: center;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.cv-tpl h3 { font-size: 18px; font-weight: 800; color: var(--ink); }
.cv-tpl p { font-size: 14px; color: var(--body); flex: 1; }
.cv-tpl-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cv-tpl-actions .btn { padding: 10px 18px; font-size: 13.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .jobs-grid, .req-grid, .doc-grid, .cv-cols, .cv-tpl-grid { grid-template-columns: repeat(2, 1fr); }
  .cats-grid, .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 100%;
    right: 0; left: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px 6%;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
  }
  .site-header.open .main-nav { display: flex; }
  .nav-link { text-align: center; padding: 12px; }
  .nav-cta { margin: 8px 0 4px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 30px 16px; }
  .hero { padding: 52px 0 60px; }
  .hero-search { flex-direction: column; border-radius: 20px; padding: 14px; align-items: stretch; }
  .split-grid, .contact-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .tools-bar { position: static; }
  .letter-sheet { padding: 26px 20px; }
  .cv-check-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .jobs-grid, .req-grid, .cats-grid, .steps-grid, .doc-grid, .cv-cols, .cv-tpl-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 40px 22px; }
  .section { padding: 54px 0; }
  .brand .logo { height: 42px; }
  .footer-brand .brand .logo { height: 32px; }
}

/* ============================================================
   معاينة مصغرة داخل بطاقات نماذج السيرة الذاتية (cv.html)
   ============================================================ */
.cv-mini {
  display: block;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 13px 15px;
  margin-bottom: 16px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.cv-tpl:hover .cv-mini { border-color: rgba(14, 122, 95, 0.45); box-shadow: 0 8px 18px rgba(14, 122, 95, 0.1); }
.cm-head { display: flex; gap: 10px; align-items: center; margin-bottom: 11px; }
.cm-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0e7a5f, #34d399);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 17px;
  flex-shrink: 0;
}
.pv-mini-fr .cm-avatar { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.pv-mini-en .cm-avatar { background: linear-gradient(135deg, #4f46e5, #818cf8); }
.cm-bars { flex: 1; display: grid; gap: 6px; }
.cm-ph {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: #e2e8f0;
  margin-bottom: 9px;
  position: relative;
  overflow: hidden;
}
.cm-ph::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  animation: cm-shimmer 1.7s infinite;
}
@keyframes cm-shimmer {
  100% { transform: translateX(120%); }
}
.cm-bar {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 7px;
}
.cm-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0e7a5f, #34d399);
}
.pv-mini-fr .cm-bar i { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.pv-mini-en .cm-bar i { background: linear-gradient(90deg, #4f46e5, #818cf8); }
@media (prefers-reduced-motion: reduce) {
  .cm-ph::after, .pv-ph::after { animation: none; }
}

/* ============================================================
   معاينة مصغرة احترافية — مطابقة لمعاينة صفحة النموذج (article.html)
   ============================================================ */
.cv-mini { --acc: #0e7a5f; --acc-deep: #0a5f49; --acc-tint: #e0f2ec; }
.cv-mini { display: block; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 0; margin-bottom: 16px; overflow: hidden; transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease; }
.cv-tpl:hover .cv-mini { border-color: var(--acc); box-shadow: 0 10px 22px rgba(15, 23, 42, .12); transform: translateY(-2px); }
.cv-mini .cm-head { display: flex; align-items: center; gap: 11px; padding: 12px 14px; background: linear-gradient(135deg, var(--acc-deep), var(--acc)); color: #fff; margin: 0; }
.cv-mini .cm-avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .16); border: 2px solid rgba(255, 255, 255, .65); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 16px; flex-shrink: 0; }
.cv-mini .cm-id { display: grid; gap: 2px; min-width: 0; }
.cv-mini .cm-id b { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-mini .cm-id i { font-style: normal; font-size: 10.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-mini .cm-body { padding: 12px 14px 13px; }
.cv-mini .cm-line { display: block; height: 8px; border-radius: 999px; background: #e2e8f0; margin-bottom: 8px; }
.cv-mini .cm-sec { display: grid; gap: 7px; margin-top: 11px; }
.cv-mini .cm-bar { display: block; height: 6px; border-radius: 999px; background: #edf0f4; position: relative; overflow: hidden; }
.cv-mini .cm-bar b { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, var(--acc), var(--acc-tint)); }
.cv-mini.cm-v2 .cm-head { padding: 14px; text-align: center; justify-content: center; flex-direction: column; gap: 7px; }
.cv-mini.cm-v2 .cm-id { text-align: center; }
.cv-mini.cm-v3 .cm-head { background: var(--acc-deep); }

/* ============================================================
   شبكة المواضيع (المقالات) — post grids في كل قسم
   البطاقة: صورة (أو أيقونة بديلة تلقائيًا) + شارة + عنوان + وصف + رابط
   ============================================================ */
.post-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.post-grid-sm { grid-template-columns: repeat(3, 1fr); }
.post-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: rgba(14, 122, 95, 0.35); }
.post-link { display: flex; flex-direction: column; height: 100%; }
.post-thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--primary-deep), var(--primary));
  color: #fff;
  overflow: hidden;
}
.post-thumb::before { content: attr(data-icon); font-size: 34px; line-height: 1; opacity: 0.92; }
.post-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.post-cat {
  align-self: flex-start;
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}
.post-title { font-size: 15px; font-weight: 800; color: var(--ink); line-height: 1.65; }
.post-excerpt { font-size: 13px; color: var(--body); flex: 1; }
.post-more { padding-top: 10px; border-top: 1px dashed var(--line); color: var(--primary); font-weight: 800; font-size: 13px; }
.post-card:hover .post-more { text-decoration: underline; }

/* صفحة الموضوع — /posts/<slug>.html */
.post-page-thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 21 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-deep), var(--primary));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.post-page-thumb::before { content: attr(data-icon); font-size: 56px; line-height: 1; opacity: 0.92; }
.post-page-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post-page-lead { margin-top: 22px; font-size: 17.5px; font-weight: 600; color: var(--ink); }
.post-page-note {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px dashed var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: #92400e;
  font-size: 14.5px;
}
.post-related { margin-top: 36px; }
.post-related-title { font-size: 20px; font-weight: 800; color: var(--ink); margin-bottom: 16px; }
.post-back { margin-top: 26px; }
@media (max-width: 1024px) {
  .post-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .post-grid, .post-grid-sm { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 460px) {
  .post-grid, .post-grid-sm { grid-template-columns: 1fr; }
}

/* ============================================================
   شريط موافقة الكوكيز — cookie-band (كافة الصفحات)
   ============================================================ */
.cookie-band {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 9999;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: rgba(6, 78, 59, 0.06);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transform: translateY(120%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.cookie-band.show { transform: translateY(0); pointer-events: auto; }

.cookie-inner {
  width: min(980px, 100%);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 16px 20px;
}
.cookie-ic {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: var(--accent-soft);
  border-radius: 50%;
}
.cookie-txt { flex: 1; min-width: 0; }
.cookie-title { display: block; color: var(--ink); font-weight: 800; font-size: 15.5px; margin-bottom: 2px; }
.cookie-p { color: var(--body); font-size: 13.5px; line-height: 1.75; margin: 0; }
.cookie-p a { color: var(--primary); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.cookie-p a:hover { color: var(--primary-dark); }

.cookie-actions { flex-shrink: 0; display: flex; gap: 10px; }
.ck-btn {
  font-family: var(--font);
  font-weight: 800;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.ck-btn:active { transform: scale(0.97); }
.ck-accept { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(14, 122, 95, 0.35); }
.ck-accept:hover { background: var(--primary-dark); transform: translateY(-2px); }
.ck-reject { background: transparent; color: var(--body); border-color: var(--line); }
.ck-reject:hover { border-color: var(--muted); color: var(--ink); background: var(--bg); }

/* زر إدارة الكوكيز (يظهر بعد اتخاذ القرار) — الجهة المقابلة لزر العودة للأعلى */
.ck-settings {
  position: fixed;
  bottom: 16px;
  inset-inline-end: 16px;
  z-index: 9998;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 20px;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ck-settings:hover { transform: translateY(-3px) rotate(12deg); box-shadow: var(--shadow-lg); }

@media (max-width: 720px) {
  .cookie-inner { flex-direction: column; align-items: stretch; text-align: center; gap: 12px; padding: 16px; }
  .cookie-ic { margin-inline: auto; }
  .cookie-actions { justify-content: center; }
  .ck-btn { flex: 1; min-width: 120px; }
  .ck-settings { bottom: 14px; inset-inline-end: 14px; }
}
