/* AlHasiba — Design System v2 (SEO + Performance + Social) */
:root {
  --primary: #0f172a;
  --primary-soft: #1e293b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #dbeafe;
  --success: #059669;
  --success-soft: #ecfdf5;
  --success-dark: #064e3b;
  --pink: #db2777;
  --pink-soft: #fdf2f8;
  --warning: #d97706;
  --danger: #b91c1c;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --text: #334155;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 10px 40px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 50px rgba(37, 99, 235, 0.12);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --font: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif;
  --max: 1120px;
  --header-h: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.85;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: 16px; }
:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.45); outline-offset: 2px; }

.skip-link {
  position: absolute; top: -100px; right: 16px; z-index: 9999;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

/* Top nav */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 16px;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-weight: 900; font-size: 1.2rem; text-decoration: none; min-width: 0;
}
.brand:hover { text-decoration: none; color: #fff; }
.brand-badge {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: grid; place-items: center; overflow: hidden;
}
.brand-badge img { width: 100%; height: 100%; object-fit: cover; }
.nav-links { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  color: #cbd5e1; padding: 8px 11px; border-radius: 10px;
  font-size: 0.9rem; font-weight: 700; text-decoration: none; transition: .2s;
}
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.nav-toggle {
  display: none; background: transparent; border: 1px solid rgba(255,255,255,.2);
  color: #fff; border-radius: 10px; padding: 8px 12px; cursor: pointer; font-weight: 700;
}

/* Hero */
.hero {
  background: linear-gradient(160deg, #0f172a 0%, #1e3a8a 55%, #0f172a 100%);
  color: #fff; text-align: center;
  padding: 64px 16px 92px;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 48px;
  background: linear-gradient(to top right, var(--bg) 49%, transparent 50%),
              linear-gradient(to top left, var(--bg) 49%, transparent 50%);
  background-size: 50% 100%; background-repeat: no-repeat; background-position: left, right;
}
.hero h1 { margin: 0 0 12px; font-size: clamp(1.7rem, 5.5vw, 3rem); font-weight: 900; letter-spacing: -0.02em; line-height: 1.25; }
.hero p { margin: 0 auto; max-width: 680px; color: #cbd5e1; font-size: clamp(0.98rem, 2.5vw, 1.08rem); }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; }
.hero-badges span {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.12);
  padding: 6px 12px; border-radius: 999px; font-size: 0.82rem; color: #e2e8f0;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }

/* Layout */
.container { width: min(100% - 32px, var(--max)); margin: 0 auto; }
main { flex: 1; }
.section { padding: 40px 0; }
.section-title { margin: 0 0 8px; color: var(--text-dark); font-size: clamp(1.3rem, 3vw, 1.6rem); }
.section-sub { margin: 0 0 24px; color: var(--text-muted); }

/* Cards grid */
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 18px;
  margin-top: -52px; position: relative; z-index: 2;
}
.tool-card {
  background: var(--surface); border-radius: var(--radius-lg); padding: 28px 22px;
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 10px;
  border: 1px solid transparent; transition: transform .25s, box-shadow .25s, border-color .25s;
  min-height: 100%;
}
.tool-card:hover {
  transform: translateY(-6px); box-shadow: var(--shadow-lg);
  border-color: var(--accent-soft); text-decoration: none; color: inherit;
}
.tool-card .icon {
  width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center;
  font-size: 1.7rem; margin-bottom: 4px;
}
.tool-card.inh .icon { background: var(--success-soft); }
.tool-card.age .icon { background: var(--accent-soft); }
.tool-card.preg .icon { background: var(--pink-soft); }
.tool-card h2 { margin: 0; font-size: 1.28rem; color: var(--text-dark); }
.tool-card p { margin: 0; color: var(--text-muted); flex: 1; font-size: 0.95rem; }
.tool-card .cta {
  margin-top: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-weight: 800; border-radius: var(--radius-sm);
  padding: 12px 16px; transition: background .2s;
}
.tool-card.inh .cta { background: var(--success); }
.tool-card.preg .cta { background: var(--pink); }
.tool-card:hover .cta { filter: brightness(1.05); }

/* Surfaces */
.panel {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: clamp(18px, 3vw, 28px); border: 1px solid var(--border);
}
.panel + .panel { margin-top: 18px; }
.page-head { margin: 24px 0 18px; }
.page-head h1 { margin: 0 0 8px; color: var(--text-dark); font-size: clamp(1.45rem, 4vw, 2.1rem); line-height: 1.3; }
.page-head p { margin: 0; color: var(--text-muted); max-width: 760px; }
.breadcrumb { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 8px; }
.breadcrumb a { font-weight: 700; }

/* Forms */
.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; color: var(--text-dark); font-size: 0.9rem; }
.field .hint { font-size: 0.78rem; color: var(--text-muted); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 2px solid var(--border);
  border-radius: var(--radius-sm); font-size: 16px; background: #fff; color: var(--text-dark);
  transition: border-color .2s, box-shadow .2s; min-height: 48px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px rgba(37,99,235,.12); outline: none;
}
.field-span-2 { grid-column: 1 / -1; }
@media (min-width: 700px) {
  .field-span-2 { grid-column: span 2; }
}

.btn {
  appearance: none; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 18px; border-radius: var(--radius-sm); font-weight: 800; font-size: 1rem;
  transition: transform .15s, background .2s, box-shadow .2s; text-decoration: none;
  min-height: 48px; touch-action: manipulation;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; color: #fff; }
.btn-pink { background: var(--pink); color: #fff; }
.btn-block { width: 100%; }
.btn-ghost { background: #f8fafc; color: var(--text-dark); border: 1px solid var(--border); }
.btn-sm { padding: 10px 12px; font-size: 0.88rem; min-height: 42px; }
.btn-copy { background: #64748b; color: #fff; }
.btn-dl { background: #334155; color: #fff; }
.btn-wa { background: #25d366; color: #fff; }
.btn-x { background: #0f172a; color: #fff; }
.btn-tg { background: #229ED9; color: #fff; }
.btn-fb { background: #1877f2; color: #fff; }
.btn-native { background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; }

.actions-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 12px;
}

/* Share platform bar */
.share-platform {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px;
  margin: 18px 0;
}
.share-platform .btn { font-size: 0.88rem; }

/* Results */
.results-wrap { display: none; margin-top: 20px; }
.results-wrap.show { display: block; animation: fadeUp .35s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.results-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
@media (max-width: 860px) { .results-grid { grid-template-columns: 1fr; } }
.results-box {
  background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; border-inline-start: 6px solid var(--accent);
}
.results-box.success { border-inline-start-color: var(--success); }
.results-box.pink { border-inline-start-color: var(--pink); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat {
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 12px; text-align: center;
}
.stat .label { display: block; color: var(--text-muted); font-size: 0.82rem; margin-bottom: 4px; }
.stat .value { display: block; color: var(--text-dark); font-weight: 900; font-size: clamp(1rem, 3vw, 1.2rem); word-break: break-word; }

table.data {
  width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden;
}
table.data th, table.data td {
  padding: 11px 12px; text-align: right; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}
table.data th { background: #f8fafc; color: var(--success-dark); font-weight: 800; }
table.data tr:last-child td { border-bottom: none; }
table.data .money { font-weight: 800; color: var(--text-dark); direction: ltr; unicode-bidi: plaintext; }
.note {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  padding: 12px 14px; border-radius: 12px; font-size: 0.9rem; margin-top: 12px;
}
.note.danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.note.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip {
  background: var(--accent-soft); color: #1e40af; padding: 4px 10px;
  border-radius: 999px; font-size: 0.8rem; font-weight: 700;
}
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.examples button {
  background: #f8fafc; border: 1px dashed var(--border); color: var(--text); cursor: pointer;
  border-radius: 999px; padding: 8px 12px; font-size: 0.84rem; font-weight: 700; min-height: 40px;
}
.examples button:hover { border-color: var(--accent); color: var(--accent); }

.side-tools { display: grid; gap: 10px; }
.side-tool {
  display: block; padding: 16px; border-radius: 16px; color: #fff; font-weight: 800;
  text-align: center; text-decoration: none; transition: transform .2s;
}
.side-tool:hover { transform: translateY(-3px); text-decoration: none; color: #fff; }
.side-tool.age { background: linear-gradient(135deg, #2563eb, #1e3a8a); }
.side-tool.preg { background: linear-gradient(135deg, #db2777, #9d174d); }
.side-tool.inh { background: linear-gradient(135deg, #059669, #064e3b); }

/* Content / SEO */
.article {
  background: var(--surface); border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--shadow); border: 1px solid var(--border); margin-top: 24px;
}
.article h2 { margin-top: 0; color: var(--text-dark); font-size: clamp(1.2rem, 3vw, 1.5rem); }
.article h3 { color: var(--primary-soft); }
.article p, .article li { font-size: 0.98rem; }
.faq { margin-top: 16px; }
.faq details {
  background: #f8fafc; border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 800; color: var(--text-dark); }
.faq details[open] summary { margin-bottom: 8px; }
.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px; margin: 24px 0;
}
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px;
}
.feature strong { display: block; color: var(--text-dark); margin-bottom: 6px; }

.blog-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px;
}
.blog-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px;
  text-decoration: none; color: inherit; transition: .2s; display: block;
}
.blog-card:hover { border-color: var(--accent); box-shadow: var(--shadow); text-decoration: none; color: inherit; transform: translateY(-3px); }
.blog-card h3 { margin: 0 0 8px; color: var(--text-dark); font-size: 1.05rem; }
.blog-card p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

/* Legal */
.legal { max-width: 820px; margin: 28px auto; }
.legal h1 { color: var(--text-dark); border-bottom: 2px solid var(--border); padding-bottom: 10px; }
.legal h2 { color: var(--accent); margin-top: 26px; }

/* Footer */
.site-footer {
  margin-top: 40px; background: #fff; border-top: 1px solid var(--border);
  padding: 36px 16px calc(28px + var(--safe-bottom)); text-align: center;
}
.footer-brand { font-weight: 900; color: var(--text-dark); font-size: 1.1rem; margin-bottom: 8px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; margin: 12px 0; }
.footer-links a { color: var(--accent); font-weight: 700; font-size: 0.9rem; }
.footer-copy { color: var(--text-muted); font-size: 0.88rem; margin: 0; }
.footer-share { max-width: 640px; margin: 16px auto 0; }

/* Cookie */
#cookie-banner {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 1000;
  background: #1e293b; color: #fff; padding: 12px 14px calc(12px + var(--safe-bottom));
  display: none; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  box-shadow: 0 -8px 30px rgba(0,0,0,.15); font-size: 0.92rem;
}
#cookie-banner.show { display: flex; }
#cookie-banner button {
  background: var(--accent); color: #fff; border: none; padding: 10px 16px;
  border-radius: 8px; cursor: pointer; font-weight: 800; min-height: 42px;
}

/* Timeline */
.timeline { display: grid; gap: 10px; margin-top: 12px; }
.timeline-item {
  display: grid; grid-template-columns: 72px 1fr; gap: 10px; align-items: start;
  background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px;
}
.timeline-item .wk { font-weight: 900; color: var(--pink); }
.timeline-item.active { border-color: var(--pink); background: var(--pink-soft); }

/* Floating share (mobile) */
.fab-share {
  position: fixed; bottom: calc(18px + var(--safe-bottom)); left: 16px; z-index: 90;
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; font-size: 1.3rem;
  box-shadow: 0 10px 25px rgba(37,99,235,.35); display: grid; place-items: center;
}
.fab-share:hover { transform: scale(1.05); }

/* Trust strip */
.trust-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px;
  margin: 20px 0; text-align: center;
}
.trust-strip div {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; padding: 12px 8px; color: #e2e8f0; font-size: 0.85rem; font-weight: 700;
}
.trust-strip strong { display: block; color: #fff; font-size: 1.05rem; margin-bottom: 2px; }

/* TOC */
.toc { background: #f8fafc; border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin: 16px 0; }
.toc strong { display: block; margin-bottom: 8px; color: var(--text-dark); }
.toc a { display: inline-block; margin: 4px 8px 4px 0; font-weight: 700; font-size: 0.9rem; }

/* Print */
@media print {
  .site-header, .site-footer, #cookie-banner, .actions-row, .side-tools, .nav-toggle,
  .examples, .fab-share, .share-platform, .hero-cta { display: none !important; }
  body { background: #fff; }
  .panel, .results-box { box-shadow: none; border: 1px solid #ddd; }
  .results-wrap { display: block !important; }
}

/* Mobile nav */
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; top: var(--header-h); inset-inline: 0;
    background: var(--primary); flex-direction: column; padding: 12px; gap: 4px;
    border-bottom: 1px solid rgba(255,255,255,.08); max-height: calc(100vh - var(--header-h)); overflow: auto;
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; padding: 12px 14px; }
}

/* Ultra small */
@media (max-width: 380px) {
  .container { width: min(100% - 20px, var(--max)); }
  .hero { padding: 48px 12px 80px; }
}

/* Utility */
.ltr-num { direction: ltr; unicode-bidi: plaintext; font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.alert {
  padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 0.94rem;
}
.alert-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.details-list { margin: 0; padding: 0; list-style: none; }
.details-list li {
  padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 0.93rem;
}
.details-list li:last-child { border-bottom: none; }
.progress {
  height: 10px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-top: 8px;
}
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, #db2777, #f472b6); border-radius: inherit; width: 0; transition: width .4s ease; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
