/* ============================================================
   ABOALI MARKETING — الأساس المشترك
   ============================================================ */

:root {
  --bg: #06060a;
  --bg-2: #0a0a11;
  --panel: #0e0e17;
  --panel-2: #13131e;
  --panel-3: #181824;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --gold: #e9c46a;
  --gold-2: #c9a227;
  --gold-3: #f7e1a0;
  --gold-soft: rgba(233, 196, 106, 0.12);
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --green: #34d399;
  --red: #f87171;
  --text: #f4f4f7;
  --muted: #a2a7b5;
  --muted-2: #737a8c;
  --radius: 22px;
  --radius-sm: 14px;
  --font-head: "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Tajawal", "Cairo", system-ui, sans-serif;
  --shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
}

img, svg, video, iframe {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

ul, ol { margin: 0; padding: 0; list-style: none; }

::selection {
  background: rgba(233, 196, 106, 0.28);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb {
  background: #26262f;
  border-radius: 99px;
  border: 2px solid var(--bg-2);
}
::-webkit-scrollbar-thumb:hover { background: #3a3a46; }

/* ---------------------------- أدوات ---------------------------- */

.container {
  width: min(1200px, calc(100% - 40px));
  margin-inline: auto;
}

.hidden { display: none !important; }
[hidden] { display: none !important; }

body.no-scroll { overflow: hidden; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  right: 20px;
  z-index: 999;
  padding: 12px 22px;
  border-radius: 12px;
  background: var(--gold);
  color: #151006;
  font-family: var(--font-head);
  font-weight: 800;
  transition: top 0.25s;
}
.skip-link:focus { top: 16px; }

.grad-text {
  background: linear-gradient(100deg, var(--gold-3) 0%, var(--gold) 32%, var(--gold-2) 55%, var(--gold-3) 78%, var(--gold) 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 7s linear infinite;
}

@keyframes shimmer {
  to { background-position: 220% center; }
}

/* ---------------------------- الأزرار ---------------------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.9rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, background 0.3s, border-color 0.3s, color 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: translateY(1px) scale(0.99); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn-gold {
  overflow: hidden;
  background: linear-gradient(135deg, var(--gold-3), var(--gold) 45%, var(--gold-2));
  color: #171105;
  box-shadow: 0 14px 34px -14px rgba(233, 196, 106, 0.65);
}

.btn-gold::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
  transform: translateX(-130%);
  transition: transform 0.75s var(--ease);
}

.btn-gold:hover::after { transform: translateX(130%); }
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px -16px rgba(233, 196, 106, 0.75);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line-strong);
  color: var(--text);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  border-color: rgba(233, 196, 106, 0.45);
  background: rgba(233, 196, 106, 0.08);
  transform: translateY(-2px);
}

.btn-dark {
  background: #14141d;
  border-color: var(--line);
  color: var(--text);
}
.btn-dark:hover { background: #1b1b27; border-color: var(--line-strong); }

.btn-sm { padding: 0.6rem 1.1rem; font-size: 0.82rem; }
.btn-lg { padding: 1.05rem 2rem; font-size: 1.02rem; }
.btn-block { width: 100%; }

.btn i { font-size: 0.95em; }

/* ---------------------------- شرائح وشارات ---------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.25s;
}
.chip:hover { color: #fff; border-color: var(--line-strong); background: rgba(255, 255, 255, 0.07); }
.chip.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #171105;
  box-shadow: 0 8px 24px -12px rgba(233, 196, 106, 0.8);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}
.badge.gold { background: var(--gold-soft); border-color: rgba(233, 196, 106, 0.3); color: var(--gold); }
.badge.green { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.28); color: var(--green); }
.badge.red { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.28); color: var(--red); }

/* ---------------------------- الحقول ---------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field > label,
.field-label {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 8, 13, 0.75);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.94rem;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.input::placeholder,
.textarea::placeholder { color: #5c6373; }

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: rgba(233, 196, 106, 0.6);
  box-shadow: 0 0 0 4px rgba(233, 196, 106, 0.12);
  background: rgba(10, 10, 16, 0.95);
}

.textarea { min-height: 120px; resize: vertical; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a2a7b5' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 38px;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--muted);
  user-select: none;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .track {
  width: 44px;
  height: 25px;
  border-radius: 99px;
  background: #24242f;
  border: 1px solid var(--line-strong);
  position: relative;
  transition: 0.25s;
  flex-shrink: 0;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #8a8f9d;
  transition: 0.25s var(--ease);
}
.switch input:checked + .track { background: rgba(233, 196, 106, 0.25); border-color: rgba(233, 196, 106, 0.55); }
.switch input:checked + .track::after { transform: translateX(-19px); background: var(--gold); }
.switch input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------------------------- النوافذ المنبثقة ---------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 3, 6, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.modal.open { display: flex; }

.modal-panel {
  position: relative;
  width: min(880px, 100%);
  max-height: min(90vh, 900px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #12121c, #0c0c13);
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  box-shadow: 0 40px 120px -30px #000;
  animation: modalIn 0.4s var(--ease) both;
}
.modal-panel.sm { width: min(520px, 100%); }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(26px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(6, 6, 10, 0.7);
  color: #fff;
  font-size: 1rem;
  backdrop-filter: blur(8px);
  transition: 0.25s;
}
.modal-close:hover { background: var(--gold); color: #171105; border-color: var(--gold); transform: rotate(90deg); }

/* ---------------------------- التنبيهات ---------------------------- */

.toast-stack {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 48px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: #14141f;
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 50px -20px #000;
  font-size: 0.88rem;
  animation: toastIn 0.35s var(--ease) both;
}
.toast i { margin-top: 3px; color: var(--gold); }
.toast.ok i { color: var(--green); }
.toast.err i { color: var(--red); }
.toast.out { animation: toastOut 0.3s ease both; }

@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ---------------------------- الحركة والظهور ---------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

html:not(.js) .reveal { opacity: 1; transform: none; }

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@keyframes pulseRing {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}
@keyframes spinSlow { to { transform: rotate(360deg); } }

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

/* ---------------------------- استجابة عامة ---------------------------- */

@media (max-width: 640px) {
  .container { width: calc(100% - 32px); }
  .btn { padding: 0.82rem 1.3rem; font-size: 0.9rem; }
  .btn-lg { padding: 0.95rem 1.5rem; }
  .toast-stack { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}
