/* ============================================================
   base.css — المتغيرات والـ Reset
   ============================================================ */

:root {
  /* الألوان — بيتم override من config.js */
  --gold:   #B8964A;
  --dark:   #1C1814;
  --cream:  #EFE6D3;
  --green:  #25D366;
  --red:    #E24B4A;
  --bg:     #F7F5F1;
  --card:   #ffffff;
  --border: rgba(184, 150, 74, 0.22);
  --muted:  #8A8378;
  --text:   #1C1814;

  /* أبعاد ثابتة */
  --radius: 14px;
  --shadow: 0 2px 16px rgba(28, 24, 20, 0.06);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overscroll-behavior: none;
  direction: rtl;
}

img { display: block; max-width: 100%; }
button { font-family: 'Tajawal', sans-serif; cursor: pointer; border: none; background: none; }
a { text-decoration: none; }

/* ============================================================
   Splash Screen
   ============================================================ */
#splash {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #FFFFFF 0%, #F7F5F1 50%, #FFFFFF 100%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}
#splash.hidden {
  opacity: 0;
  pointer-events: none;
}

/* دايرة التحميل */
.splash-ring-wrap {
  position: relative;
  width: 150px;
  height: 150px;
  margin-bottom: 28px;
}
.splash-logo {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 90px; height: 90px;
  border-radius: 22px;
  object-fit: cover;
  z-index: 2;
  box-shadow: 0 8px 28px rgba(184,150,74,.25);
}
.splash-logo-emoji {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 52px;
  z-index: 2;
  animation: splashPulse 1.5s ease-in-out infinite;
}
.ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(184,150,74,.15);
}
.ring-spin {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--gold);
  border-right-color: rgba(184,150,74,.4);
  animation: spin 1.2s linear infinite;
}
.ring-spin2 {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-bottom-color: rgba(184,150,74,.3);
  animation: spin 1.9s linear infinite reverse;
}
.ring-dot-wrap {
  position: absolute;
  inset: 0;
  animation: spin 3s linear infinite;
}
.ring-dot {
  position: absolute;
  width: 7px; height: 7px;
  background: var(--gold);
  border-radius: 50%;
  top: 0; left: 50%;
  transform: translateX(-50%);
}

/* نصوص الـ splash */
.splash-name {
  color: var(--dark);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 1px;
  text-align: center;
}
.splash-slogan {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
  text-align: center;
}
.splash-loader-text {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: .5px;
  margin-top: 22px;
  animation: blink 1.4s ease-in-out infinite;
}
.splash-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.splash-line::before, .splash-line::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(184,150,74,.5), transparent);
}

/* ============================================================
   Toast
   ============================================================ */
#toast {
  position: fixed;
  bottom: 24px;
  right: 50%;
  transform: translateX(50%) translateY(80px);
  background: var(--dark);
  color: var(--cream);
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  z-index: 8000;
  opacity: 0;
  transition: all 0.3s;
  white-space: nowrap;
  pointer-events: none;
}
#toast.show { transform: translateX(50%) translateY(0); opacity: 1; }
#toast.ok   { background: #1E7A4A; color: #fff; }
#toast.err  { background: var(--red); color: #fff; }

/* ============================================================
   Animations
   ============================================================ */
@keyframes spin         { to { transform: rotate(360deg); } }
@keyframes splashPulse  { 0%,100%{transform:translate(-50%,-50%) scale(1)} 50%{transform:translate(-50%,-50%) scale(1.07)} }
@keyframes blink        { 0%,100%{opacity:.55} 50%{opacity:1} }
@keyframes fadeUp       { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
