/* =========================================================
   نظام الطيبات — Al-Tayebat Diet
   assets/css/style.css
   الهوية: طبيعي • فطري • راقٍ — أخضر غابات + ذهب دافئ على كريمي
   ========================================================= */

:root {
  /* ألوان أساسية */
  --green-900: #15301f;
  --green-800: #1b4332;
  --green-700: #245440;
  --green-600: #2d6a4f;
  --green-500: #40916c;
  --green-400: #74a892;
  --green-200: #c5dccf;
  --green-100: #e6f0ea;
  --green-050: #f1f7f3;

  --gold-600: #a87d2a;
  --gold-500: #c8a04a;
  --gold-400: #d9bd76;
  --gold-100: #f6edd6;

  --cream:     #faf7f0;
  --cream-2:   #f4efe4;
  --paper:     #ffffff;

  --ink:       #18241d;
  --ink-soft:  #3a4a40;
  --muted:     #6a7a6f;
  --line:      #e4ded0;

  /* مناطق لونية */
  --z-green:  #2e9e5b;
  --z-yellow: #e0a912;
  --z-orange: #e07a2e;
  --z-purple: #8a5cc4;
  --z-red:    #cf3b3b;

  /* خطوط */
  --f-body: "Readex Pro", "Tajawal", system-ui, sans-serif;
  --f-head-ar: "El Messiri", "Readex Pro", serif;
  --f-head-en: "Fraunces", Georgia, serif;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 2px 10px rgba(24,36,29,.06);
  --shadow: 0 14px 40px -18px rgba(24,36,29,.28);
  --shadow-lg: 0 30px 70px -30px rgba(21,48,31,.45);
  --container: 1180px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

html[lang="en"] { --f-head: var(--f-head-en); }
html[lang="ar"] { --f-head: var(--f-head-ar); }

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--f-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.75;
  font-size: 17px;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 12% -5%, rgba(64,145,108,.07), transparent 35%),
    radial-gradient(circle at 95% 8%, rgba(200,160,74,.08), transparent 30%);
}

[dir="rtl"] body { letter-spacing: 0; }

h1,h2,h3,h4 { font-family: var(--f-head); line-height: 1.25; font-weight: 700; color: var(--green-900); }

a { color: var(--green-600); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-600); }

img { max-width: 100%; display: block; }

.container { max-width: var(--container); margin: 0 auto; padding-inline: 22px; }

section { position: relative; }

/* ===== أزرار ===== */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--f-body); font-weight: 600; font-size: 1rem;
  padding: .85rem 1.6rem; border-radius: 999px;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s, background .25s, color .2s;
  line-height: 1; text-align: center;
}
.btn svg { width: 1.15em; height: 1.15em; }
.btn-primary { background: var(--green-700); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--green-800); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-gold { background: var(--gold-500); color: var(--green-900); }
.btn-gold:hover { background: var(--gold-400); color: var(--green-900); transform: translateY(-2px); }
.btn-ghost { background: transparent; border-color: var(--green-200); color: var(--green-800); }
.btn-ghost:hover { background: var(--green-100); color: var(--green-900); border-color: var(--green-400); }
.btn-block { width: 100%; justify-content: center; }

/* ===== الهيدر ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,247,240,.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; }
.brand .logo {
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--green-600), var(--green-800));
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.15), var(--shadow-sm);
}
.brand .logo svg { width: 26px; height: 26px; color: var(--gold-400); }
.brand .name { font-family: var(--f-head); font-size: 1.4rem; color: var(--green-900); font-weight: 700; line-height: 1.1; }
.brand .name small { display: block; font-family: var(--f-body); font-size: .68rem; color: var(--muted); font-weight: 500; letter-spacing: .02em; }

.nav-links { display: flex; align-items: center; gap: .35rem; list-style: none; }
.nav-links a {
  display: inline-block; padding: .5rem .85rem; border-radius: 10px;
  color: var(--ink-soft); font-weight: 500; font-size: .98rem; position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--green-800); background: var(--green-100); }
.nav-actions { display: flex; align-items: center; gap: .6rem; }

.lang-switch {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .45rem .8rem; border-radius: 999px;
  border: 1.5px solid var(--line); color: var(--green-800);
  font-weight: 600; font-size: .9rem; background: var(--paper);
}
.lang-switch:hover { border-color: var(--green-400); color: var(--green-900); }
.lang-switch svg { width: 16px; height: 16px; }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; color: var(--green-800); }
.nav-toggle svg { width: 28px; height: 28px; }

/* ===== Hero ===== */
.hero {
  position: relative; padding: clamp(3.5rem, 8vw, 7rem) 0 clamp(3rem, 6vw, 5.5rem);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 60% 50% at 80% 0%, rgba(64,145,108,.14), transparent 60%),
    radial-gradient(ellipse 50% 40% at 10% 100%, rgba(200,160,74,.12), transparent 60%);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem,4vw,4rem); align-items: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--green-100); color: var(--green-700);
  padding: .4rem .9rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
  margin-bottom: 1.4rem;
}
.hero-eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: var(--green-500); }
.hero h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); letter-spacing: -.01em; margin-bottom: 1.2rem; }
.hero h1 em { font-style: normal; color: var(--green-500); position: relative; }
.hero p.lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-soft); max-width: 34rem; margin-bottom: 1.5rem; }
.hero-quote {
  font-family: var(--f-head); font-size: 1.15rem; color: var(--gold-600);
  border-inline-start: 3px solid var(--gold-400); padding-inline-start: 1rem;
  margin-bottom: 2rem; font-weight: 600;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; }

.hero-visual { position: relative; }
.hero-card {
  background: var(--paper); border-radius: 26px; padding: 1.6rem; box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); position: relative; overflow: hidden;
}
.hero-card::after {
  content: ""; position: absolute; top: -40%; inset-inline-end: -30%;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,160,74,.18), transparent 70%);
}
.hero-card .hc-title { display: flex; align-items: center; gap: .6rem; font-family: var(--f-head); font-weight: 700; color: var(--green-900); margin-bottom: 1rem; font-size: 1.15rem; }
.hero-card .hc-title svg { width: 22px; height: 22px; color: var(--green-500); }
.basics-mini { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.basic-chip {
  display: flex; align-items: center; gap: .65rem;
  background: var(--green-050); border: 1px solid var(--green-100);
  border-radius: 14px; padding: .7rem .8rem; font-weight: 600; color: var(--green-800); font-size: .95rem;
}
.basic-chip .ico { font-size: 1.4rem; line-height: 1; }

/* ===== أقسام عامة ===== */
.section-pad { padding: clamp(3.2rem, 7vw, 6rem) 0; }
.section-head { text-align: center; max-width: 44rem; margin: 0 auto clamp(2rem,4vw,3.2rem); }
.section-head .kicker {
  display: inline-block; color: var(--gold-600); font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; margin-bottom: .7rem;
}
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); margin-bottom: .8rem; }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.bg-soft { background: linear-gradient(180deg, var(--cream), var(--cream-2)); }
.bg-green { background: var(--green-900); color: var(--green-100); }
.bg-green h2, .bg-green h3 { color: #fff; }

/* ===== الأساسيات الخمسة ===== */
.basics-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.basic-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem 1rem; text-align: center; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.basic-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--green-200); }
.basic-card .emoji { font-size: 2.6rem; margin-bottom: .6rem; }
.basic-card h3 { font-size: 1.2rem; margin-bottom: .25rem; }
.basic-card p { color: var(--muted); font-size: .9rem; }

/* ===== ركائز ===== */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.pillar {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius); padding: 1.8rem 1.4rem; transition: background .3s, transform .3s;
}
.pillar:hover { background: rgba(255,255,255,.08); transform: translateY(-4px); }
.pillar .num { font-family: var(--f-head); font-size: 2.4rem; color: var(--gold-400); opacity: .9; line-height: 1; margin-bottom: .8rem; }
.pillar h3 { font-size: 1.25rem; margin-bottom: .5rem; color: #fff; }
.pillar p { color: var(--green-200); font-size: .96rem; }

/* ===== بطاقات الدراسات ===== */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.study-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.study-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--green-200); }
.study-card .thumb { aspect-ratio: 16/10; overflow: hidden; background: var(--green-100); position: relative; }
.study-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.study-card:hover .thumb img { transform: scale(1.06); }
.study-card .thumb .ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--green-600), var(--green-800)); color: var(--gold-400);
}
.study-card .thumb .ph svg { width: 54px; height: 54px; opacity: .8; }
.study-card .body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.study-card .cat { color: var(--gold-600); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .5rem; }
.study-card h3 { font-size: 1.28rem; margin-bottom: .55rem; }
.study-card p { color: var(--muted); font-size: .96rem; margin-bottom: 1rem; flex: 1; }
.study-card .more { font-weight: 600; color: var(--green-700); display: inline-flex; align-items: center; gap: .4rem; }
.study-card .more svg { width: 1em; height: 1em; transition: transform .25s; }
[dir="rtl"] .study-card .more svg { transform: scaleX(-1); }
.study-card:hover .more svg { transform: translateX(4px); }
[dir="rtl"] .study-card:hover .more svg { transform: scaleX(-1) translateX(4px); }

/* ===== CTA الفاحص (banner) ===== */
.checker-cta {
  background: linear-gradient(135deg, var(--green-800), var(--green-600));
  border-radius: 28px; padding: clamp(2.2rem,5vw,3.5rem); color: #fff;
  display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center;
  position: relative; overflow: hidden; box-shadow: var(--shadow-lg);
}
.checker-cta::before {
  content: ""; position: absolute; inset-inline-start: -10%; bottom: -60%;
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,160,74,.25), transparent 70%);
}
.checker-cta h2 { color: #fff; font-size: clamp(1.6rem,3vw,2.3rem); margin-bottom: .6rem; }
.checker-cta p { color: var(--green-100); max-width: 36rem; }

/* ===== الفاحص — صفحة ===== */
.checker-wrap { max-width: 760px; margin: 0 auto; }
.checker-box {
  background: var(--paper); border: 1px solid var(--line); border-radius: 24px;
  padding: clamp(1.4rem,3vw,2.2rem); box-shadow: var(--shadow); margin-bottom: 1.4rem;
}
.checker-input-row { display: flex; gap: .7rem; }
.checker-input-row input {
  flex: 1; font-family: var(--f-body); font-size: 1.05rem; padding: 1rem 1.2rem;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--cream); color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.checker-input-row input:focus { outline: none; border-color: var(--green-400); box-shadow: 0 0 0 4px rgba(64,145,108,.12); background: #fff; }
.examples { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.examples .lbl { color: var(--muted); font-size: .9rem; margin-inline-end: .25rem; }
.chip {
  background: var(--green-050); border: 1px solid var(--green-100); color: var(--green-700);
  padding: .35rem .85rem; border-radius: 999px; font-size: .88rem; cursor: pointer; transition: all .2s;
}
.chip:hover { background: var(--green-100); border-color: var(--green-400); }

.result-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 22px;
  overflow: hidden; box-shadow: var(--shadow); animation: rise .5s var(--ease);
}
.result-head { padding: 1.4rem 1.6rem; display: flex; align-items: center; gap: 1rem; color: #fff; }
.result-head .verdict-ico { width: 46px; height: 46px; flex: none; display: grid; place-items: center; background: rgba(255,255,255,.18); border-radius: 14px; }
.result-head .verdict-ico svg { width: 26px; height: 26px; }
.result-head h3 { color: #fff; font-size: 1.5rem; margin: 0; }
.result-head .food-name { opacity: .92; font-size: .95rem; }
.result-body { padding: 1.5rem 1.6rem; }
.result-body .field { margin-bottom: 1.2rem; }
.result-body .field:last-child { margin-bottom: 0; }
.result-body .field .lbl { font-weight: 700; color: var(--green-800); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .35rem; display: flex; align-items: center; gap: .4rem; }
.result-body .field p { color: var(--ink-soft); }
.zone-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .85rem; border-radius: 999px; font-weight: 700; font-size: .9rem; }
.zone-pill .dot { width: 10px; height: 10px; border-radius: 50%; }

.thinking { display: flex; align-items: center; gap: .7rem; color: var(--green-700); font-weight: 600; padding: 1.5rem; justify-content: center; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--green-100); border-top-color: var(--green-500); border-radius: 50%; animation: spin .8s linear infinite; }

/* ===== الأطعمة — صفحة ===== */
.zones-legend { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; margin-bottom: 2.4rem; }
.zone-tag { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem 1rem; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-weight: 600; font-size: .92rem; }
.zone-tag .dot { width: 12px; height: 12px; border-radius: 50%; }

.food-toolbar { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1.8rem; align-items: center; }
.food-search { flex: 1; min-width: 240px; position: relative; }
.food-search input { width: 100%; font-family: var(--f-body); font-size: 1rem; padding: .85rem 1.1rem; padding-inline-start: 2.8rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); }
.food-search input:focus { outline: none; border-color: var(--green-400); box-shadow: 0 0 0 4px rgba(64,145,108,.1); }
.food-search svg { position: absolute; inset-inline-start: 1rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.filter-tabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.filter-tabs button { font-family: var(--f-body); font-weight: 600; font-size: .92rem; padding: .6rem 1.1rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink-soft); cursor: pointer; transition: all .2s; }
.filter-tabs button:hover { border-color: var(--green-400); }
.filter-tabs button.active { background: var(--green-700); color: #fff; border-color: var(--green-700); }

.food-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 1rem; }
.food-item {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 1.1rem 1.2rem; border-inline-start: 5px solid var(--line);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.food-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.food-item .top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .35rem; }
.food-item h4 { font-family: var(--f-head); font-size: 1.18rem; color: var(--green-900); }
.food-item .cat { color: var(--muted); font-size: .82rem; margin-bottom: .5rem; }
.food-item .note { color: var(--ink-soft); font-size: .88rem; background: var(--cream); border-radius: 8px; padding: .4rem .6rem; }
.food-item .freq { font-size: .78rem; color: var(--gold-600); font-weight: 700; }
.badge-status { font-size: .78rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; }
.badge-allowed { background: #e6f6ec; color: #1c7a40; }
.badge-forbidden { background: #fbe9e9; color: #b32b2b; }

/* ===== الفيديوهات ===== */
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.video-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s; }
.video-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.video-embed { position: relative; aspect-ratio: 16/9; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-card .vbody { padding: 1.1rem 1.3rem 1.4rem; }
.video-card h3 { font-size: 1.15rem; margin-bottom: .3rem; }
.video-card p { color: var(--muted); font-size: .9rem; }

/* ===== مقال مفرد ===== */
.article { max-width: 760px; margin: 0 auto; }
.article .hero-img { width: 100%; aspect-ratio: 16/8; object-fit: cover; border-radius: var(--radius); margin-bottom: 2rem; box-shadow: var(--shadow); }
.article-meta { color: var(--gold-600); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .8rem; }
.article h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 1rem; }
.article .date { color: var(--muted); font-size: .95rem; margin-bottom: 2rem; }
.article-content { font-size: 1.12rem; color: var(--ink-soft); }
.article-content h2 { font-size: 1.6rem; margin: 2.2rem 0 .9rem; color: var(--green-800); }
.article-content h3 { font-size: 1.3rem; margin: 1.8rem 0 .7rem; }
.article-content p { margin-bottom: 1.3rem; }
.article-content ul, .article-content ol { margin: 0 0 1.3rem; padding-inline-start: 1.6rem; }
.article-content li { margin-bottom: .5rem; }
.article-content blockquote { border-inline-start: 4px solid var(--gold-400); background: var(--green-050); padding: 1rem 1.3rem; border-radius: 0 12px 12px 0; margin: 1.5rem 0; font-family: var(--f-head); color: var(--green-800); }
[dir="rtl"] .article-content blockquote { border-radius: 12px 0 0 12px; }
.article-content img { border-radius: var(--radius); margin: 1.5rem 0; box-shadow: var(--shadow-sm); }

/* ===== إخلاء مسؤولية ===== */
.disclaimer {
  background: var(--gold-100); border: 1px solid var(--gold-400); border-radius: var(--radius-sm);
  padding: 1rem 1.3rem; display: flex; gap: .9rem; align-items: flex-start; margin: 1.5rem 0;
}
.disclaimer svg { width: 24px; height: 24px; color: var(--gold-600); flex: none; margin-top: .15rem; }
.disclaimer .txt { font-size: .92rem; color: #6b5418; }
.disclaimer .txt strong { color: #4f3e0f; }

/* ===== نموذج تواصل ===== */
.form-card { max-width: 600px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: clamp(1.5rem,3vw,2.4rem); box-shadow: var(--shadow); }
.field-group { margin-bottom: 1.2rem; }
.field-group label { display: block; font-weight: 600; color: var(--green-800); margin-bottom: .4rem; font-size: .95rem; }
.field-group input, .field-group textarea { width: 100%; font-family: var(--f-body); font-size: 1rem; padding: .85rem 1rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--cream); color: var(--ink); }
.field-group input:focus, .field-group textarea:focus { outline: none; border-color: var(--green-400); box-shadow: 0 0 0 4px rgba(64,145,108,.1); background: #fff; }
.field-group textarea { min-height: 140px; resize: vertical; }
.alert-ok { background: #e6f6ec; color: #1c7a40; border: 1px solid #a9dcba; border-radius: 12px; padding: .9rem 1.1rem; margin-bottom: 1.2rem; font-weight: 600; }

/* ===== التذييل ===== */
.site-footer { background: var(--green-900); color: var(--green-200); padding: clamp(2.6rem,5vw,3.6rem) 0 1.6rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr; gap: 2.4rem; margin-bottom: 2.2rem; }
.footer-brand .name { font-family: var(--f-head); font-size: 1.5rem; color: #fff; margin-bottom: .8rem; }
.footer-brand p { font-size: .94rem; color: var(--green-200); max-width: 28rem; }
.footer-col h4 { color: #fff; font-size: 1.05rem; margin-bottom: 1rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .55rem; }
.footer-col a { color: var(--green-200); font-size: .95rem; }
.footer-col a:hover { color: var(--gold-400); }
.footer-note { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 1rem 1.2rem; display: flex; gap: .7rem; align-items: flex-start; font-size: .85rem; color: var(--green-200); }
.footer-note svg { width: 20px; height: 20px; color: var(--gold-400); flex: none; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.4rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .8rem; font-size: .88rem; color: var(--green-200); }
.footer-bottom a { color: var(--gold-400); }

/* ===== صفحة عامة (header banner) ===== */
.page-hero { background: linear-gradient(160deg, var(--green-800), var(--green-600)); color: #fff; padding: clamp(3rem,6vw,4.5rem) 0; text-align: center; position: relative; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; inset-inline-end: -8%; top: -50%; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(200,160,74,.22), transparent 70%); }
.page-hero h1 { color: #fff; font-size: clamp(2rem,4.5vw,3.2rem); margin-bottom: .8rem; }
.page-hero p { color: var(--green-100); max-width: 40rem; margin: 0 auto; font-size: 1.1rem; }
.breadcrumb { display: flex; gap: .5rem; align-items: center; justify-content: center; margin-top: 1.2rem; font-size: .9rem; color: var(--green-200); }
.breadcrumb a { color: var(--gold-400); }

/* ===== لوحة التحكم ===== */
.admin-body { background: #eef1ec; min-height: 100vh; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card { background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 2.4rem; width: 100%; max-width: 400px; }
.login-card .logo-c { text-align: center; margin-bottom: 1.6rem; }
.login-card .logo-c .name { font-family: var(--f-head); font-size: 1.5rem; color: var(--green-900); }
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.admin-side { background: var(--green-900); color: var(--green-100); padding: 1.6rem 1.2rem; }
.admin-side .brand-a { font-family: var(--f-head); color: #fff; font-size: 1.3rem; margin-bottom: 1.8rem; display: block; }
.admin-side nav a { display: flex; align-items: center; gap: .7rem; padding: .75rem 1rem; border-radius: 12px; color: var(--green-200); font-weight: 500; margin-bottom: .3rem; }
.admin-side nav a:hover, .admin-side nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.admin-side nav a svg { width: 18px; height: 18px; }
.admin-main { padding: 2rem; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.8rem; }
.admin-topbar h1 { font-size: 1.7rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 1.2rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border-radius: 16px; padding: 1.4rem 1.5rem; box-shadow: var(--shadow-sm); }
.stat-card .num { font-family: var(--f-head); font-size: 2.2rem; color: var(--green-700); }
.stat-card .lbl { color: var(--muted); font-size: .92rem; }
.admin-card { background: #fff; border-radius: 16px; padding: 1.6rem; box-shadow: var(--shadow-sm); margin-bottom: 1.5rem; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: start; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.admin-table th { color: var(--muted); font-weight: 600; font-size: .88rem; }
.admin-table .act a { font-size: .85rem; margin-inline-end: .8rem; }
.admin-table .act a.del { color: var(--z-red); }
.input-sm { font-family: var(--f-body); width: 100%; padding: .7rem .9rem; border: 1.5px solid var(--line); border-radius: 10px; font-size: .95rem; }
.input-sm:focus { outline: none; border-color: var(--green-400); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ===== Animations ===== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 460px; }
  .basics-grid { grid-template-columns: repeat(3, 1fr); }
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .cards-grid, .video-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .checker-cta { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { display: none; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .nav-links, .nav-actions .lang-switch span { display: none; }
  .nav-links.open { display: flex; position: absolute; top: 76px; inset-inline: 0; flex-direction: column; background: var(--cream); padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); gap: .2rem; }
  .nav-links.open a { padding: .8rem 1rem; }
  .nav-toggle { display: block; }
  .basics-grid, .cards-grid, .video-grid, .pillars { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .checker-input-row { flex-direction: column; }
  .hero-cta .btn { flex: 1; }
}


/* =========================================================
   فاحص الأطعمة — مبدّل الوضع + واجهة الكاميرا (محسّنة للجوال)
   ========================================================= */
.checker-modes {
  display: flex;
  gap: .3rem;
  background: var(--green-050, #eef5f0);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem;
  margin-bottom: 1.3rem;
}
.cmode {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: none;
  background: transparent;
  color: var(--green-800, #1b4332);
  font-family: var(--f-body, inherit);
  font-weight: 600;
  font-size: .98rem;
  min-height: 46px;
  padding: .55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .22s, color .22s, box-shadow .22s;
}
.cmode svg { width: 18px; height: 18px; }
.cmode.active {
  background: #fff;
  color: var(--green-900, #15301f);
  box-shadow: 0 2px 10px rgba(21,48,31,.12);
}
.checker-panel { animation: fadeUp .3s var(--ease, ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- منصّة الكاميرا ---- */
.cam-stage {
  border: 2px dashed var(--green-200, #b7d3c4);
  border-radius: 22px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(64,145,108,.06), transparent 60%),
    var(--green-050, #f3f8f5);
  padding: clamp(1.4rem, 4vw, 2.2rem) clamp(1rem, 3vw, 1.6rem);
  text-align: center;
}
.cam-start { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.cam-bigico {
  width: 80px; height: 80px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--green-100, #d5e8dd);
  color: var(--green-700, #2d6a4f);
}
.cam-bigico svg { width: 38px; height: 38px; }
.cam-hint { color: var(--ink-soft); max-width: 440px; margin: 0 auto; font-size: .98rem; line-height: 1.7; }

.cam-actions { display: flex; gap: .7rem; flex-wrap: wrap; justify-content: center; width: 100%; }
.cam-actions .btn {
  -webkit-tap-highlight-color: transparent;
  min-height: 48px;
}
.cam-actions .btn svg { width: 19px; height: 19px; }

/* ---- البثّ الحيّ (viewfinder) ---- */
.cam-live { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }
.cam-frame, .cam-live video, .cam-preview-wrap img {
  width: 100%;
  max-width: 440px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 22px;
  background: #0c130f;
  display: block;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(12,19,15,.28);
}

/* شريط التحكّم: إلغاء — غالق — فراغ متوازن */
.cam-controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  max-width: 440px;
}
.cam-shutter {
  justify-self: center;
  width: 74px; height: 74px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: grid; place-items: center;
  padding: 0;
}
.cam-shutter::before {        /* الحلقة الخارجية */
  content: "";
  position: absolute;
  width: 74px; height: 74px;
  border-radius: 50%;
  border: 4px solid var(--green-700, #2d6a4f);
}
.cam-shutter::after {         /* القرص الداخلي */
  content: "";
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--green-700, #2d6a4f);
  transition: transform .12s ease, background .2s ease;
}
.cam-shutter:active::after { transform: scale(.86); background: var(--green-800, #1b4332); }
.cam-shutter { position: relative; }

.cam-textbtn {
  justify-self: start;
  background: none; border: none;
  color: var(--green-700, #2d6a4f);
  font-family: var(--f-body, inherit); font-weight: 600; font-size: .98rem;
  padding: .6rem .2rem; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cam-controls .cam-textbtn:last-child { justify-self: end; }

/* ---- المعاينة ---- */
.cam-preview-wrap { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }
.cam-preview-wrap img { background: #f0efe9; }

/* ---- عدّاد الأصناف + تباعد البطاقات ---- */
.items-count {
  font-family: var(--f-body, inherit); font-weight: 700; font-size: .95rem;
  color: var(--green-800, #1b4332);
  background: var(--green-050, #eef5f0);
  border: 1px solid var(--green-100, #d5e8dd);
  border-radius: 999px;
  padding: .55rem 1rem;
  margin-bottom: .9rem;
  text-align: center;
}
.result-card + .result-card { margin-top: 1rem; }

/* =========================================================
   تحسينات الجوال
   ========================================================= */
@media (max-width: 600px) {
  /* المبدّل */
  .cmode { font-size: .92rem; padding: .5rem .4rem; gap: .35rem; }
  .cmode svg { width: 16px; height: 16px; }

  /* أزرار البداية والمعاينة تصبح بعرض كامل لسهولة اللمس */
  .cam-start .cam-actions,
  .cam-preview-wrap .cam-actions { flex-direction: column; }
  .cam-start .cam-actions .btn,
  .cam-preview-wrap .cam-actions .btn { width: 100%; }

  /* نسبة العرض أنسب للجوال */
  .cam-frame, .cam-live video, .cam-preview-wrap img { aspect-ratio: 3 / 4; max-width: 100%; }
  .cam-controls { max-width: 100%; }

  /* بطاقة النتيجة أكثر إحكاماً */
  .result-head { padding: 1.1rem 1.15rem; gap: .8rem; }
  .result-head h3 { font-size: 1.25rem; }
  .result-head .verdict-ico { width: 40px; height: 40px; }
  .result-head .verdict-ico svg { width: 22px; height: 22px; }
  .result-body { padding: 1.2rem 1.15rem; }
  .result-body .field { margin-bottom: 1rem; }
  .zone-pill { font-size: .86rem; }
}

/* =========================================================
   إضافات بطاقة النتيجة: تفاصيل، بدائل، شارة المصدر
   ========================================================= */
.result-head-txt { min-width: 0; }
.result-head-txt h3 { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.src-badge {
  font-family: var(--f-body);
  font-size: .66rem; font-weight: 700; letter-spacing: .02em;
  background: rgba(255,255,255,.22); color: #fff;
  padding: .18rem .55rem; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.4);
  white-space: nowrap;
}
.result-points { margin: .2rem 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .55rem; }
.result-points li { position: relative; padding-inline-start: 1.35rem; color: var(--ink-soft); line-height: 1.75; }
.result-points li::before {
  content: ""; position: absolute; inset-inline-start: .2rem; top: .65em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--green-400);
}
.alt-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.alt-chip {
  background: var(--green-50); color: var(--green-800);
  border: 1px solid var(--green-200);
  padding: .42rem .9rem; border-radius: 999px; font-size: .92rem; font-weight: 600;
}

/* =========================================================
   صفحة التحليلات
   ========================================================= */
.an-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.an-kpi { background: #fff; border-radius: 16px; padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: .9rem; }
.an-kpi .k-ico { width: 46px; height: 46px; flex: none; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; }
.an-kpi .k-num { font-family: var(--f-head); font-size: 1.5rem; color: var(--green-800); line-height: 1.1; }
.an-kpi .k-lbl { color: var(--muted); font-size: .82rem; margin-top: .15rem; }

.an-charts { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.4rem; margin-bottom: 1.4rem; }
.an-charts .admin-card { margin-bottom: 0; }
.an-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px,1fr)); gap: 1.4rem; margin-bottom: 1.4rem; }
.an-tables .admin-card { margin-bottom: 0; }
.an-h { font-family: var(--f-head); color: var(--green-800); font-size: 1.05rem; margin: 0 0 1rem; }
.an-empty { color: var(--muted); font-size: .9rem; text-align: center; padding: 1.2rem 0; }

.an-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.an-table th { text-align: start; font-weight: 700; color: var(--green-800); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; padding: .55rem .5rem; border-bottom: 2px solid var(--line); }
.an-table td { padding: .62rem .5rem; border-bottom: 1px solid var(--line); color: var(--ink); }
.an-table tbody tr:last-child td { border-bottom: none; }
.an-table tbody tr:hover { background: var(--green-50); }

.z-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: .4rem; vertical-align: middle; }
.src-tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: .2rem .62rem; border-radius: 999px; white-space: nowrap; }
.src-ai    { background: #fff1e3; color: #b8631f; }
.src-cache { background: #e6f6ec; color: #1f7a44; }
.src-local { background: #eef1f3; color: #5b6b72; }

/* =========================================================
   تحسينات جوال إضافية (النظام الذكي + التحليلات)
   ========================================================= */
@media (max-width: 860px) {
  .an-charts { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  /* زر الفحص النصّي بعرض كامل عند تكدّس الصف */
  .checker-input-row .btn, .checker-input-row button { width: 100%; }
}
@media (max-width: 600px) {
  .an-kpis { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .an-kpi { padding: .85rem .9rem; gap: .6rem; }
  .an-kpi .k-ico { width: 40px; height: 40px; font-size: 1.15rem; }
  .an-kpi .k-num { font-size: 1.25rem; }
  .an-kpi .k-lbl { font-size: .76rem; }
  .an-table { font-size: .84rem; }
  .an-table th, .an-table td { padding: .5rem .38rem; }
  .src-badge { font-size: .6rem; padding: .14rem .45rem; }
  .alt-chip { font-size: .86rem; padding: .36rem .75rem; }
  .result-points li { line-height: 1.7; }
}
@media (max-width: 380px) {
  .an-kpis { grid-template-columns: 1fr; }
}
