/* ============================================================
   وسيط زواج المودة — نظام التصميم الفاخر v2
   (RTL، متجاوب، سريع: بلا خطوط أو مكتبات خارجية)
   ============================================================ */
:root {
  --wine: #5e0b2a;
  --wine-deep: #45061d;
  --magenta: #c4184f;
  --rose: #a4133c;
  --gold: #eab040;
  --gold-light: #f3d98a;
  --gold-pale: #fff2cb;
  --gold-deep: #a8792f;
  --bg: #fff6e0;
  --card: #fffdf8;
  --ink: #4a2a1c;
  --muted: #8a7360;
  --line: #f0dfb8;
  --green: #7a1f3d;
  --green-2: #5e0b2a;
  --green-soft: #f9e8ee;
  --danger: #b3402f;
  --danger-soft: #f9e8e4;
  --ok: #1e7d4f;
  --radius: 20px;
  --shadow: 0 14px 38px rgba(94, 11, 42, .13);
  --shadow-sm: 0 5px 18px rgba(168, 121, 47, .13);
  --font: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Helvetica Neue", Arial, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.8;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(255, 196, 90, .38), transparent 42%),
    radial-gradient(circle at 90% 8%, rgba(196, 24, 79, .10), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(255, 180, 80, .30), transparent 46%);
  background-attachment: fixed;
}
img, canvas, svg { max-width: 100%; }
a { color: var(--green); }

/* ═══════════ الترويسة ═══════════ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 253, 248, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 16px rgba(168, 121, 47, .08);
}
.topbar-in {
  max-width: 1150px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.12rem; color: var(--wine); text-decoration: none; }
.brand .logo, .brand img.logo { width: 44px; height: 44px; flex: 0 0 auto; filter: drop-shadow(0 2px 6px rgba(168, 121, 47, .35)); }
.brand small { display: block; font-size: .68rem; color: var(--muted); font-weight: 600; }
.spacer { flex: 1; }

/* ═══════════ الأزرار (مع لمعة تحويم) ═══════════ */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; text-decoration: none; font-family: inherit;
  font-size: .95rem; font-weight: 700; border-radius: 30px; padding: 11px 22px;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
  line-height: 1.4; min-height: 44px;
}
.btn::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 44%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg); transition: left .55s ease; pointer-events: none;
}
.btn:hover::after { left: 140%; }
.btn:active { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn-primary { background: linear-gradient(135deg, var(--wine), var(--magenta)); color: #fff; box-shadow: 0 7px 20px rgba(196, 24, 79, .32); }
.btn-primary:hover { filter: brightness(1.07); transform: translateY(-2px); }
.btn-gold { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #5a2a06; box-shadow: 0 7px 20px rgba(232, 176, 64, .42); }
.btn-gold:hover { filter: brightness(1.04); transform: translateY(-2px); }
.btn-wa { background: linear-gradient(135deg, #25D366, #128C7E); color: #fff; box-shadow: 0 7px 20px rgba(18, 140, 126, .38); }
.btn-wa:hover { transform: translateY(-2px); }
.btn-outline { background: var(--card); color: var(--wine); border: 1.8px solid var(--gold-light); box-shadow: var(--shadow-sm); }
.btn-outline:hover { background: var(--gold-pale); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--muted); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: #fff; color: var(--wine); }
.btn-danger { background: linear-gradient(135deg, #c0392b, #8e2a20); color: #fff; }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-sm { padding: 7px 14px; min-height: 36px; font-size: .85rem; }
.btn-lg { padding: 15px 32px; font-size: 1.08rem; min-height: 54px; }
.btn-block { width: 100%; }

/* ═══════════ البطاقات ═══════════ */
.card {
  position: relative;
  background: linear-gradient(180deg, #fffdf8, var(--cream-2));
  border: 1.7px solid var(--gold-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, var(--magenta), var(--gold), var(--magenta));
}
.card:hover { box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card-h h2, .card-h h3 { font-size: 1.08rem; color: var(--wine); }
.card-h > svg { width: 22px; height: 22px; color: var(--gold-deep); flex: 0 0 auto; }

/* ═══════════ البطل (Hero) ═══════════ */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--wine-deep) 0%, var(--wine) 44%, var(--magenta) 100%);
  border-bottom: 5px solid var(--gold);
  color: #fff; text-align: center;
  padding: 30px 20px 52px;
}
.hero::after {
  content: ""; position: absolute; inset: 0; opacity: .22; pointer-events: none;
  background: radial-gradient(circle at 50% -20%, rgba(255, 235, 180, .75), transparent 60%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(46px); opacity: .5; pointer-events: none; animation: orbFloat 10s ease-in-out infinite; }
.orb-1 { width: 300px; height: 300px; background: rgba(255, 200, 100, .5); top: -90px; right: -70px; }
.orb-2 { width: 260px; height: 260px; background: rgba(255, 170, 200, .35); bottom: -70px; left: -60px; animation-delay: -4s; }
@keyframes orbFloat { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-22px) scale(1.06); } }
.hero > * { position: relative; z-index: 2; }

.crest-wrap { position: relative; width: 116px; margin: 0 auto 2px; }
.crest-wrap img { display: block; width: 100%; height: auto; animation: floaty 6s ease-in-out infinite; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .4)); }
.crest-ring { position: absolute; inset: -9px; border-radius: 50%; border: 2px dashed rgba(243, 217, 138, .65); animation: spin 26s linear infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes spin { to { transform: rotate(360deg); } }

.hero h1 { font-size: clamp(1.4rem, 3.8vw, 2.05rem); font-weight: 800; color: #fff8e2; margin: 8px 0 10px; line-height: 1.6; text-shadow: 0 2px 0 rgba(120, 20, 50, .5), 0 8px 26px rgba(0, 0, 0, .35); }
.hero .ayah {
  max-width: 780px; margin: 0 auto 16px; color: #fff3c9; font-size: clamp(.92rem, 2.2vw, 1.05rem); line-height: 2.15;
  background: rgba(69, 6, 29, .38); border: 1.6px solid var(--gold-light); border-radius: 16px; padding: 10px 16px;
}
.hero .ayah .src { display: block; font-size: .84rem; color: #ffd9e3; margin-top: 6px; }

.play-btn {
  position: relative; width: 82px; height: 82px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .9); cursor: pointer;
  background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
  transition: transform .16s ease;
}
.play-btn::before, .play-btn::after {
  content: ""; position: absolute; inset: -12px; border-radius: 50%;
  border: 2px solid rgba(243, 217, 138, .55); animation: pulse 2.6s ease-out infinite; pointer-events: none;
}
.play-btn::after { animation-delay: 1.3s; }
@keyframes pulse { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.play-btn:hover { transform: scale(1.07); }
.play-btn svg { width: 34px; height: 34px; margin-right: -3px; }
.play-label { display: block; font-size: 1.06rem; font-weight: 800; margin-top: 0; color: #fff8e2; }
.hero .cta { display: flex; gap: 11px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.hero .note { margin-top: 10px; font-size: .82rem; color: #ffd9e3; }

.features { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.feature {
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(243, 217, 138, .4);
  border-radius: 14px; padding: 7px 13px; font-size: .84rem; font-weight: 600;
  display: flex; align-items: center; gap: 9px; backdrop-filter: blur(4px);
}
.feature svg { width: 20px; height: 20px; color: var(--gold-light); }

/* ═══════════ الأقسام ═══════════ */
.wrap { max-width: 1150px; margin: 0 auto; padding: 16px 16px 54px; }
section.blk { padding: 24px 0 6px; }
.blk-title { text-align: center; font-size: clamp(1.3rem, 3.4vw, 1.7rem); color: var(--wine); margin-bottom: 6px; }
.divider { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 2px 0 22px; color: var(--gold); font-size: 1.05rem; }
.divider::before, .divider::after { content: ""; height: 2px; width: min(150px, 26vw); border-radius: 2px; }
.divider::before { background: linear-gradient(90deg, transparent, var(--gold)); }
.divider::after { background: linear-gradient(90deg, var(--gold), transparent); }
.blk-sub { text-align: center; color: var(--muted); margin: -10px auto 26px; font-size: .98rem; max-width: 780px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(265px, 1fr)); }
@media (max-width: 920px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* أيقونة دائرية مذهّبة داخل البطاقات */
.ico-badge {
  width: 54px; height: 54px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 1.55rem;
  background: linear-gradient(135deg, var(--gold-pale), var(--gold-light));
  border: 2px solid var(--gold); box-shadow: 0 4px 12px rgba(232, 176, 64, .3);
  margin: 0 auto 10px;
}
.ico-badge.wine { background: linear-gradient(135deg, #f9e8ee, #f3cfdd); border-color: var(--magenta); }
.ico-badge.rose { background: linear-gradient(135deg, #ffe9dd, #ffd6c2); border-color: #e07a4f; }
.ico-badge.green { background: linear-gradient(135deg, #e4f3ea, #c8e8d6); border-color: #3f9d6e; }
.card h3 { font-size: 1.06rem; color: var(--wine); margin-bottom: 8px; text-align: center; }
.card p { font-size: .93rem; color: #5b4433; text-align: center; }

/* بطاقات الاقتباسات (الأحاديث) */
.quote {
  background: linear-gradient(180deg, #fffdf8, #fff6e4);
  border: 1.6px solid var(--gold-light); border-radius: 20px;
  padding: 20px; position: relative; box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.quote:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.quote::before { content: "❝"; position: absolute; top: 6px; left: 14px; font-size: 2.6rem; color: rgba(234, 176, 64, .3); font-family: serif; }
.quote .txt { font-size: 1.02rem; color: var(--wine); line-height: 2.2; text-align: center; }
.quote .src { text-align: center; font-size: .8rem; color: var(--gold-deep); margin-top: 8px; font-weight: bold; }
.quote .src::before { content: "✦ "; color: var(--gold); }

/* خطوات العمل */
.step {
  display: flex; gap: 15px; align-items: flex-start; text-align: right;
  background: linear-gradient(180deg, #fffdf8, #fff6e0);
  border: 1.7px solid var(--gold-light); border-radius: 20px; padding: 20px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .18s ease;
}
.step:hover { transform: translateY(-3px); }
.step-num {
  flex: 0 0 auto; width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.25rem; color: #fff;
  background: linear-gradient(135deg, var(--magenta), var(--wine));
  border: 2px solid var(--gold-light); box-shadow: 0 5px 14px rgba(196, 24, 79, .35);
}
.step h3 { text-align: right; margin-bottom: 3px; }
.step p { text-align: right; font-size: .9rem; color: var(--muted); }

/* الأسئلة الشائعة */
details.faq {
  background: linear-gradient(180deg, #fffdf8, #fff6e4);
  border: 1.6px solid var(--gold-light); border-radius: 16px;
  box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow .18s;
}
details.faq[open] { box-shadow: var(--shadow); }
details.faq summary {
  cursor: pointer; font-weight: 800; color: var(--wine);
  padding: 15px 18px; list-style: none; display: flex; align-items: center; gap: 10px;
  user-select: none;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::before { content: "✦"; color: var(--gold); }
details.faq summary::after { content: "+"; margin-right: auto; font-size: 1.3rem; color: var(--gold-deep); transition: transform .2s; }
details.faq[open] summary::after { transform: rotate(45deg); }
details.faq .faq-b { padding: 0 18px 15px; font-size: .92rem; color: #5b4433; }

/* النداء الأخير */
.cta-final {
  background: linear-gradient(135deg, var(--wine-deep), var(--wine) 45%, var(--magenta));
  color: #fff; border-radius: 26px; padding: 34px 22px; text-align: center;
  border: 3px solid var(--gold); box-shadow: 0 16px 40px rgba(69, 6, 29, .35);
}
.cta-final h2 { color: #fff3c9; font-size: clamp(1.25rem, 3.5vw, 1.55rem); margin-bottom: 8px; }
.cta-final .dua { color: #ffe9ab; font-size: 1.02rem; margin: 10px auto 18px; max-width: 720px; line-height: 2.2; }

/* ═══════════ نموذج الكود ═══════════ */
.login-wrap { max-width: 470px; margin: -40px auto 40px; padding: 0 16px; position: relative; z-index: 5; }
.login-card {
  background: linear-gradient(180deg, #fffdf8, #fff6e0);
  border: 2px solid var(--gold-light); border-radius: 24px;
  box-shadow: 0 20px 50px rgba(94, 11, 42, .22); padding: 30px 26px;
}
.login-card h2 { color: var(--wine); font-size: 1.22rem; display: flex; align-items: center; gap: 10px; justify-content: center; }
.login-card h2 svg { width: 22px; height: 22px; color: var(--gold-deep); }
.login-card .hint { color: var(--muted); font-size: .86rem; text-align: center; margin: 8px 0 18px; }
.code-input {
  direction: ltr; text-align: center; letter-spacing: 4px; font-size: 1.3rem; font-weight: 800;
  width: 100%; padding: 15px; border: 2px solid var(--line); border-radius: 16px;
  font-family: ui-monospace, "Courier New", monospace; text-transform: uppercase; background: #fffdf6;
  transition: border-color .15s, box-shadow .15s;
}
.code-input:focus { outline: none; border-color: var(--gold); background: #fff; box-shadow: 0 0 0 5px rgba(234, 176, 64, .18); }

/* ═══════════ النماذج ═══════════ */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; color: var(--ink); }
.field .req { color: var(--danger); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; border: 1.7px solid var(--line); border-radius: 13px;
  font-family: inherit; font-size: .98rem; background: #fffdf6; color: var(--ink);
  transition: border-color .14s, box-shadow .14s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold); background: #fff; box-shadow: 0 0 0 4px rgba(234, 176, 64, .15);
}
.field input[type="tel"], .field input.ltr { direction: ltr; text-align: right; }
.field textarea { min-height: 120px; resize: vertical; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.field .err { font-size: .8rem; color: var(--danger); margin-top: 4px; display: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); background: #fffaf9; }
.field.invalid .err { display: block; }
.field .checkline, .checkline {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px;
  border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: 7px;
  cursor: pointer; background: #fffdf6; font-size: .92rem; transition: border-color .14s;
}
.checkline:hover { border-color: var(--gold); }
.checkline input { width: 18px; height: 18px; accent-color: var(--magenta); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ═══════════ الشارات ═══════════ */
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700;
  padding: 4px 12px; border-radius: 999px; background: var(--gold-pale); color: var(--wine);
  border: 1px solid rgba(232, 176, 64, .4);
}
.chip.gold { background: linear-gradient(135deg, var(--gold-pale), var(--gold-light)); color: #6a4a10; }
.chip.gray { background: #f3efe6; color: #6a5c48; border-color: #e5dcc6; }
.chip.red { background: var(--danger-soft); color: var(--danger); border-color: rgba(179, 64, 47, .3); }
.chip svg { width: 15px; height: 15px; }

/* ═══════════ التبويبات ═══════════ */
.tabs {
  display: flex; gap: 7px; overflow-x: auto; padding: 12px 16px; max-width: 1150px;
  margin: 0 auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 1.6px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 14px; padding: 9px 17px; font-family: inherit; font-size: .92rem; font-weight: 700;
  cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px;
  transition: all .15s ease;
}
.tab svg { width: 17px; height: 17px; }
.tab:hover { border-color: var(--gold); color: var(--wine); }
.tab.active {
  background: linear-gradient(135deg, var(--wine), var(--magenta)); border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px rgba(196, 24, 79, .3);
}

/* ═══════════ الإحصائيات ═══════════ */
.stat { display: flex; align-items: center; gap: 14px; }
.stat .ico {
  width: 52px; height: 52px; border-radius: 16px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold-pale), var(--gold-light)); color: var(--gold-deep);
  border: 1.6px solid rgba(232, 176, 64, .5);
}
.stat .ico svg { width: 25px; height: 25px; }
.stat:nth-child(1) .ico { background: linear-gradient(135deg, var(--gold-pale), var(--gold-light)); color: var(--gold-deep); }
.stat:nth-child(2) .ico { background: linear-gradient(135deg, #e4f3ea, #c8e8d6); color: #2c7a52; }
.stat:nth-child(3) .ico { background: linear-gradient(135deg, #ffe9dd, #ffd6c2); color: #c05621; }
.stat:nth-child(4) .ico { background: linear-gradient(135deg, #f9e8ee, #f3cfdd); color: var(--magenta); }
.stat .num { font-size: 1.55rem; font-weight: 800; color: var(--wine); line-height: 1.2; }
.stat .lbl { font-size: .8rem; color: var(--muted); font-weight: 600; }

/* ═══════════ بطاقة مستخدم ═══════════ */
.ucard {
  background: linear-gradient(180deg, #fffdf8, #fff6e4);
  border: 1.6px solid var(--gold-light); border-radius: var(--radius);
  padding: 16px; cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden;
}
.ucard::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--magenta), var(--gold), var(--magenta)); opacity: .8; }
.ucard:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--gold); }
.ucard .top { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 50px; height: 50px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #7a1f3d, #45061d); color: #fff;
  font-size: 1.35rem; font-weight: 800;
  box-shadow: 0 0 0 3px var(--gold-light), 0 4px 12px rgba(94, 11, 42, .3);
}
.avatar.big { width: 76px; height: 76px; font-size: 2.1rem; box-shadow: 0 0 0 4px var(--gold-light), 0 8px 22px rgba(94, 11, 42, .3); }
.avatar.f { background: linear-gradient(135deg, var(--magenta), #6d1637); }
.ucard .nm { font-weight: 800; font-size: 1rem; color: var(--ink); }
.ucard .sub { font-size: .78rem; color: var(--muted); }
.ucard .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.progress { height: 9px; background: #f1e8d2; border-radius: 99px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(168, 121, 47, .2); }
.progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--magenta), var(--gold)); border-radius: 99px; transition: width .5s ease; }

/* ═══════════ بطاقة الملف الشخصي (المستخدم) ═══════════ */
.profile-hero {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--wine-deep), var(--wine) 55%, var(--magenta));
  border: 2px solid var(--gold); border-radius: 24px; color: #fff;
  padding: 26px 24px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.profile-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 85% -30%, rgba(255, 235, 180, .35), transparent 55%); pointer-events: none; }
.profile-hero > * { position: relative; z-index: 1; }
.profile-hero .ph-info { flex: 1; min-width: 220px; }
.profile-hero .ph-name { font-size: 1.45rem; font-weight: 800; color: #fff8e2; }
.profile-hero .ph-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.profile-hero .ph-meta .chip { background: rgba(255, 255, 255, .14); color: #fff3c9; border-color: rgba(243, 217, 138, .45); }
.ring-wrap { position: relative; width: 118px; height: 118px; flex: 0 0 auto; margin: 0 auto; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, .18); stroke-width: 10; }
.ring-bar { fill: none; stroke: var(--gold-light); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 339.3; stroke-dashoffset: 339.3; transition: stroke-dashoffset .8s ease; }
.ring-pct { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; }
.ring-pct b { font-size: 1.35rem; color: #fff8e2; }
.ring-pct span { font-size: .68rem; color: #ffd9e3; }

/* بلاطات الإجراءات */
.tile {
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  padding: 18px; border-radius: 18px; cursor: pointer; text-decoration: none; font-family: inherit;
  background: linear-gradient(180deg, #fffdf8, #fff6e0);
  border: 1.6px solid var(--gold-light); box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  color: var(--ink); font-size: .95rem; font-weight: 700;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--gold); }
.tile .t-ico {
  width: 48px; height: 48px; border-radius: 15px; display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; background: linear-gradient(135deg, var(--gold-pale), var(--gold-light));
  border: 1.6px solid rgba(232, 176, 64, .55); box-shadow: 0 4px 10px rgba(232, 176, 64, .25);
}
.tile .t-ico svg { width: 23px; height: 23px; color: var(--gold-deep); }
.tile .t-ico.wine { background: linear-gradient(135deg, #f9e8ee, #f3cfdd); border-color: rgba(196, 24, 79, .4); }
.tile .t-ico.wine svg { color: var(--magenta); }
.tile .t-ico.green { background: linear-gradient(135deg, #e4f3ea, #c8e8d6); border-color: rgba(63, 157, 110, .4); }
.tile .t-ico.green svg { color: #2c7a52; }
.tile .t-ico.rose { background: linear-gradient(135deg, #ffe9dd, #ffd6c2); border-color: rgba(224, 122, 79, .45); }
.tile .t-ico.rose svg { color: #c05621; }
.tile small { font-weight: 600; color: var(--muted); font-size: .78rem; margin-top: -6px; }

/* ═══════════ الجداول ═══════════ */
.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tbl th, .tbl td { text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--gold-deep); font-size: .78rem; font-weight: 700; width: 38%; background: var(--gold-pale); }
.tbl th:first-child { border-radius: 0 10px 10px 0; }
.tbl tr:last-child th, .tbl tr:last-child td { border-bottom: none; }

/* ═══════════ بطاقة توافق ═══════════ */
.mcard {
  background: linear-gradient(180deg, #fffdf8, #fff6e4);
  border: 1.6px solid var(--gold-light); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-sm); position: relative;
  transition: transform .16s ease, box-shadow .16s ease;
}
.mcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.mcard .pct {
  width: 66px; height: 66px; border-radius: 50%; flex: 0 0 auto; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), #f1e5c8 0);
  font-weight: 800; color: var(--wine);
}
.mcard .pct::before { content: ""; position: absolute; inset: 6px; background: #fffdf8; border-radius: 50%; }
.mcard .pct span { position: relative; font-size: .92rem; }
.mcard .rank {
  position: absolute; top: -8px; right: -8px; width: 27px; height: 27px; border-radius: 50%;
  background: linear-gradient(135deg, var(--magenta), var(--wine)); color: #fff;
  font-size: .74rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff8e2; box-shadow: 0 3px 8px rgba(196, 24, 79, .35);
}
.mcard.r1 { border-color: var(--gold); box-shadow: 0 8px 24px rgba(234, 176, 64, .35); }
.mcard.r1::after { content: "✨ الأفضل توافقاً"; position: absolute; top: -11px; right: 22px; font-size: .68rem; font-weight: 800; background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #5a2a06; padding: 2px 12px; border-radius: 99px; border: 1px solid #fff8e2; }
.mcard .row { display: flex; gap: 14px; align-items: center; }
.mcard .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ═══════════ التوست ═══════════ */
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(430px, calc(100vw - 32px)); }
.toast {
  background: var(--wine-deep); color: #fff; padding: 12px 18px; border-radius: 14px;
  border: 1px solid rgba(243, 217, 138, .4);
  box-shadow: var(--shadow); font-size: .92rem; font-weight: 600; text-align: center;
  animation: slideDown .25s ease; display: flex; align-items: center; gap: 8px; justify-content: center;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* ═══════════ المودال ═══════════ */
.overlay {
  position: fixed; inset: 0; background: rgba(69, 6, 29, .6); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 14px;
  overflow-y: auto; backdrop-filter: blur(4px);
}
.modal {
  background: linear-gradient(180deg, #fffdf8, #fff6e0);
  border: 1.6px solid var(--gold-light); border-radius: 22px; box-shadow: 0 24px 60px rgba(69, 6, 29, .4);
  width: min(720px, 100%); padding: 22px; animation: slideDown .2s ease; margin-bottom: 40px;
}
.modal.wide { width: min(880px, 100%); }
.modal-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1.5px dashed var(--gold-light); }
.modal-h h3 { color: var(--wine); font-size: 1.1rem; flex: 1; }
.modal-x { background: var(--gold-pale); border: 1px solid var(--gold-light); cursor: pointer; color: var(--wine); width: 38px; height: 38px; border-radius: 12px; font-size: 1.1rem; }
.modal-x:hover { background: var(--gold-light); }

/* ═══════════ الشهادة ═══════════ */
.cert-box {
  background: linear-gradient(148deg, #4d0722 0%, #86183f 16%, #c4184f 32%, #f0b93f 50%, #c4184f 68%, #86183f 84%, #45061d 100%);
  border-radius: var(--radius); padding: 9px; box-shadow: 0 16px 40px rgba(78, 13, 36, .35);
}
.cert-box canvas { width: 100%; height: auto; border-radius: 14px; display: block; }

/* ═══════════ شريط الأدوات ═══════════ */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select {
  padding: 10px 13px; border: 1.6px solid var(--line); border-radius: 13px; font-family: inherit;
  font-size: .9rem; background: #fffdf6; color: var(--ink); min-height: 44px;
  transition: border-color .14s, box-shadow .14s;
}
.toolbar input[type="search"] { flex: 1 1 230px; }
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(234, 176, 64, .15); }

/* ═══════════ متفرقات ═══════════ */
.kv { display: flex; flex-wrap: wrap; gap: 10px 26px; padding: 10px 0; }
.kv .k { color: var(--muted); font-size: .8rem; }
.kv .v { font-weight: 700; color: var(--wine); }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.empty svg { width: 54px; height: 54px; opacity: .4; margin-bottom: 10px; }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.checklist { list-style: none; }
.checklist li { display: flex; align-items: center; gap: 9px; padding: 7px 0; font-size: .92rem; }
.checklist li svg { width: 19px; height: 19px; flex: 0 0 auto; }
.checklist li.done svg { color: var(--ok); }
.checklist li.todo { color: var(--danger); font-weight: 600; }
.checklist li.todo svg { color: var(--danger); }
code.mono { direction: ltr; unicode-bidi: embed; font-family: ui-monospace, "Courier New", monospace; background: var(--gold-pale); padding: 2px 9px; border-radius: 8px; font-size: .9em; color: #6a4a10; border: 1px solid rgba(232, 176, 64, .35); }
.footer {
  text-align: center; color: #ffd9e3; font-size: .85rem; padding: 30px 16px 36px;
  border-top: 4px solid var(--gold);
  background: linear-gradient(135deg, var(--wine-deep), var(--wine) 60%, #7a1035);
}
.footer b { color: #fff3c9; }
.view { display: none; }
.view.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hidden { display: none !important; }

/* ═══════════ زر واتساب العائم ═══════════ */
.wa-float {
  position: fixed; bottom: 20px; left: 20px; z-index: 90;
  width: 62px; height: 62px; border-radius: 50%;
  background: linear-gradient(135deg, #25D366, #128C7E); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 26px rgba(18, 140, 126, .45);
  transition: transform .16s ease; text-decoration: none;
}
.wa-float::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 2px solid rgba(37, 211, 102, .5); animation: pulse 2.4s ease-out infinite; }
.wa-float:hover { transform: scale(1.09); }
.wa-float svg { width: 33px; height: 33px; }
.wa-float .tip {
  position: absolute; left: 74px; background: var(--wine-deep); color: #fff; font-size: .78rem;
  font-weight: 700; padding: 7px 13px; border-radius: 11px; white-space: nowrap; opacity: 0;
  pointer-events: none; transition: opacity .16s; border: 1px solid rgba(243, 217, 138, .4);
}
.wa-float:hover .tip { opacity: 1; }
@media (max-width: 640px) { .wa-float { width: 56px; height: 56px; } .wa-float svg { width: 29px; height: 29px; } }

/* ═══════════ تجاوب ═══════════ */
@media (max-width: 640px) {
  .hero { padding: 24px 14px 42px; }
  .card { padding: 17px; }
  .login-card { padding: 24px 18px; }
  .tbl th { width: 42%; }
  .btn { font-size: .9rem; }
  .profile-hero { padding: 20px 16px; }
  .crest-wrap { width: 126px; }
}

/* ═══════════ الطباعة ═══════════ */
@media print {
  body.printing > :not(#printSheet) { display: none !important; }
  body.printing #printSheet { display: block !important; }
  #printSheet { display: none; }
}
#printSheet { display: none; }
body.printing #printSheet { display: block; background: #fff; color: #000; padding: 10mm; }
#printSheet h1 { font-size: 20pt; color: #5e0b2a; text-align: center; margin-bottom: 4pt; }
#printSheet .sub { text-align: center; font-size: 9pt; color: #555; margin-bottom: 14pt; }
#printSheet h2 { font-size: 13pt; color: #5e0b2a; border-bottom: 2px solid #eab040; padding-bottom: 4pt; margin: 14pt 0 8pt; }
#printSheet table { width: 100%; border-collapse: collapse; font-size: 10pt; }
#printSheet td { border: 1px solid #999; padding: 5pt 8pt; }
#printSheet td:first-child { background: #fff2cb; font-weight: bold; width: 30%; }

/* ═══════════ تقليل الحركة لمن يفضّل ذلك ═══════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
