/* عقار لينك برو — نظام التصميم الأساسي */
:root {
  --bg: #0B0B0B;
  --bg-2: #101010;
  --bg-3: #161616;
  --glass: rgba(255, 255, 255, .035);
  --glass-2: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #F4F1EA;
  --text-2: #CFC9BC;
  --muted: #8E897F;
  --gold: #D4AF37;
  --gold-2: #C9A227;
  --gold-hi: #F1D77C;
  --gold-deep: #9C7A1A;
  --gold-text: #E2C35A;
  --gold-soft: rgba(212, 175, 55, .1);
  --gold-line: rgba(212, 175, 55, .32);
  --gold-grad: linear-gradient(135deg, #F3DD8B 0%, #D4AF37 42%, #B8921F 78%, #CDA733 100%);
  --wa: #1EA952;
  --wa-2: #128C4A;
  --danger: #E06C5F;
  --ok: #4CC38A;
  --on-gold: #0B0B0B;
  --shadow: 0 30px 80px -20px rgba(0, 0, 0, .75), 0 10px 30px -10px rgba(0, 0, 0, .6);
  --shadow-sm: 0 12px 30px -12px rgba(0, 0, 0, .7);
  --glow: 0 0 0 1px rgba(212, 175, 55, .25), 0 18px 50px -18px rgba(212, 175, 55, .45);
  --r: 22px;
  --r-sm: 14px;
  --blur: saturate(140%) blur(22px);
  --font: 'Tajawal', 'Cairo', system-ui, sans-serif;
  --font-d: 'Cairo', 'Tajawal', system-ui, sans-serif;
  --font-l: 'Cormorant Garamond', Georgia, serif;
  --ease: cubic-bezier(.22, .8, .2, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F6F2E9;
  --bg-2: #FBF8F1;
  --bg-3: #EFE9DC;
  --glass: rgba(255, 255, 255, .62);
  --glass-2: rgba(255, 255, 255, .85);
  --line: rgba(20, 16, 8, .09);
  --line-2: rgba(20, 16, 8, .16);
  --text: #15130F;
  --text-2: #3C372D;
  --muted: #7C7466;
  --gold: #B8921F;
  --gold-2: #A8841F;
  --gold-text: #8E6E12;
  --gold-soft: rgba(184, 146, 31, .1);
  --gold-line: rgba(168, 132, 31, .35);
  --shadow: 0 30px 70px -28px rgba(60, 45, 10, .28), 0 8px 24px -12px rgba(60, 45, 10, .18);
  --shadow-sm: 0 10px 28px -14px rgba(60, 45, 10, .3);
  --glow: 0 0 0 1px rgba(168, 132, 31, .25), 0 18px 40px -20px rgba(168, 132, 31, .5);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background .5s var(--ease), color .5s var(--ease);
}
/* حبيبات خفيفة + توهج ذهبي علوي */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(212, 175, 55, .09), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(212, 175, 55, .05), transparent 60%);
}
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="light"] body::after { opacity: .06; mix-blend-mode: multiply; }
img, video, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--gold); color: #0B0B0B; }
h1, h2, h3, h4 { font-family: var(--font-d); margin: 0; line-height: 1.3; letter-spacing: -.01em; }
.num { font-family: var(--font-d); font-variant-numeric: lining-nums tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.gold { color: var(--gold-text); }
.gold-txt { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { position: relative; z-index: 1; width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ——— الزجاج ——— */
.glass {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .04);
}
:root[data-theme="light"] .glass { box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .9); }
.eyebrow {
  font-family: var(--font-d); font-size: 12px; font-weight: 700; letter-spacing: .14em;
  color: var(--gold-text); display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--gold-grad); }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--gold-line), transparent); border: 0; margin: 0; }

/* ——— الأزرار ——— */
.btn {
  --h: 48px; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 22px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--glass); color: var(--text); font-family: var(--font-d); font-weight: 700; font-size: 15px;
  white-space: nowrap; transition: transform .25s var(--ease), box-shadow .3s var(--ease), background .3s, border-color .3s, opacity .2s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { border-color: var(--gold-line); background: var(--glass-2); }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .field:focus-within, .chip:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn-gold {
  background: var(--gold-grad); background-size: 160% 160%; color: var(--on-gold); border: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 14px 34px -14px rgba(212, 175, 55, .75);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .25); overflow: hidden;
}
.btn-gold::after {
  content: ""; position: absolute; inset: 0; transform: translateX(120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  transition: transform .9s var(--ease);
}
.btn-gold:hover { background-position: 100% 0; box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 20px 44px -14px rgba(212, 175, 55, .9); border: 0; }
.btn-gold:hover::after { transform: translateX(-120%); }
.btn-lg { --h: 58px; padding: 0 34px; font-size: 17px; }
.btn-sm { --h: 38px; padding: 0 14px; font-size: 13.5px; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--glass); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: rgba(224, 108, 95, .4); background: rgba(224, 108, 95, .08); }
.btn-wa {
  background: linear-gradient(135deg, #2BC76A, var(--wa) 45%, var(--wa-2)); color: #fff; border: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 16px 36px -14px rgba(30, 169, 82, .7);
}
.btn-wa:hover { border: 0; box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 22px 44px -14px rgba(30, 169, 82, .9); }
.btn-block { width: 100%; }
.icon-btn {
  width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: var(--glass); transition: all .25s var(--ease); flex: none;
}
.icon-btn:hover { border-color: var(--gold-line); color: var(--gold-text); }
.icon-btn svg { width: 19px; height: 19px; }

/* ——— الحقول ——— */
.label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; font-family: var(--font-d); }
.label small { font-weight: 500; color: var(--muted); font-family: var(--font); }
.field {
  display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 16px;
  background: rgba(255, 255, 255, .025); border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color .25s, background .25s, box-shadow .25s;
}
:root[data-theme="light"] .field { background: rgba(255, 255, 255, .7); }
.field:hover { border-color: var(--line-2); }
.field:focus-within { outline: none; border-color: var(--gold-line); box-shadow: 0 0 0 4px var(--gold-soft); background: rgba(212, 175, 55, .03); }
.field input, .field select, .field textarea {
  flex: 1; min-width: 0; width: 100%; height: 52px; border: 0; outline: 0; background: transparent; font-size: 16px;
}
.field textarea { height: auto; min-height: 96px; padding: 14px 0; resize: vertical; line-height: 1.8; }
.field select { appearance: none; cursor: pointer; }
.field select option { background: var(--bg-3); color: var(--text); }
.field .suffix { color: var(--muted); font-size: 14px; font-weight: 700; font-family: var(--font-d); flex: none; }
.field > svg { width: 19px; height: 19px; color: var(--muted); flex: none; }
.field:focus-within > svg { color: var(--gold-text); }
.field.ltr input { direction: ltr; text-align: right; }
.field.err { border-color: rgba(224, 108, 95, .6); box-shadow: 0 0 0 4px rgba(224, 108, 95, .08); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 7px; }
.input-plain { width: 100%; border: 0; outline: 0; background: transparent; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }

/* مفتاح التبديل */
.switch { position: relative; width: 50px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: .3s var(--ease); }
.switch span::after {
  content: ""; position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .35); transition: .35s var(--ease);
}
.switch input:checked + span { background: var(--gold-grad); }
.switch input:checked + span::after { right: 25px; }
.switch input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 3px; }

/* شارات */
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--glass); font-size: 13.5px; font-weight: 600; white-space: nowrap;
  transition: all .25s var(--ease);
}
.chip svg { width: 15px; height: 15px; }
.chip-gold { border-color: var(--gold-line); color: var(--gold-text); background: var(--gold-soft); }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--gold-soft); color: var(--gold-text); border: 1px solid var(--gold-line); }

/* الشعار */
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(160deg, #1b1b1b, #0b0b0b); border: 1px solid var(--gold-line); box-shadow: var(--glow); flex: none; overflow: hidden; }
.brand-mark svg { width: 28px; height: 28px; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-family: var(--font-d); font-weight: 800; font-size: 18px; line-height: 1.1; }
.brand-name small { display: block; font-family: var(--font-l); font-weight: 600; font-size: 11.5px; letter-spacing: .32em; color: var(--gold-text); margin-top: 3px; direction: ltr; text-align: right; }

/* الإشعارات */
.toasts { position: fixed; z-index: 1000; left: 16px; right: 16px; bottom: 24px; display: grid; justify-items: center; gap: 10px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 18px; font-weight: 700; font-size: 14.5px;
  background: rgba(20, 20, 20, .92); color: #F4F1EA; border: 1px solid var(--gold-line); box-shadow: var(--shadow);
  backdrop-filter: var(--blur); animation: toastIn .5s var(--ease) both; max-width: 100%; line-height: 1.5;
}
.toast svg { width: 18px; height: 18px; color: var(--gold); }
.toast.err svg { color: var(--danger); }
.toast.out { animation: toastOut .4s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(18px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.97); } }

/* النوافذ المنبثقة */
.modal-bg {
  position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 16px;
  background: rgba(0, 0, 0, .62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: fade .35s var(--ease) both;
}
.modal { width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 28px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 26px; box-shadow: var(--shadow); animation: pop .45s var(--ease) both; }
.modal h3 { font-size: 20px; margin-bottom: 6px; }
.modal-bg.out { animation: fadeOut .3s var(--ease) both; }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }

/* رمز QR */
.qr-frame { position: relative; padding: 14px; border-radius: 22px; background: #FBF8F0; box-shadow: 0 0 0 1px var(--gold-line), 0 0 0 7px rgba(212, 175, 55, .08), var(--shadow-sm); }
.qr-frame canvas { width: 100%; height: auto; border-radius: 8px; }
.qr-frame::before, .qr-frame::after { content: ""; position: absolute; width: 22px; height: 22px; border: 2px solid var(--gold); }
.qr-frame::before { top: -6px; right: -6px; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.qr-frame::after { bottom: -6px; left: -6px; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }

.skeleton { background: linear-gradient(90deg, var(--glass) 25%, var(--glass-2) 50%, var(--glass) 75%); background-size: 300% 100%; animation: shimmer 1.6s infinite linear; border-radius: 12px; }
@keyframes shimmer { to { background-position: -300% 0; } }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--gold); animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.reveal { animation: rise .8s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
