/* =========================
   Theme: Corporate RTL UI
   ========================= */

:root{
  /* Brand */
  --brand-900:#000000;
  --brand-800:#111827;
  --brand-700:#1f2937;
  --brand-600:#374151;
  --brand-500:#4b5563;
  --brand-100:#f3f4f6;

  /* Neutrals */
  --bg:#f9fafb;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --border:#e5e7eb;

  /* Status (Grayscale) */
  --success:#111827;
  --warning:#6b7280;
  --danger:#000000;
  --info:#374151;

  /* UI */
  --radius:16px;
  --radius-sm:12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .08);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, .07);

  --focus: 0 0 0 4px rgba(0, 0, 0, .1);
}

/* Base */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: "Cairo", "Tahoma", system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  color: var(--text);
  direction: rtl;

  /* ✅ خلفية صورة + تدرّج */
  background:
    linear-gradient(135deg, rgba(11,18,32,.78), rgba(15,27,51,.78)),
    url("/static/img/bg-3d.jpg") center/cover no-repeat fixed;
}

/* طبقة 3D ضبابية متحركة فوق الخلفية */
body::before,
body::after{
  content:"";
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(55px);
  opacity: .42;
  pointer-events:none;
  z-index: 0;
  animation: floaty 12s ease-in-out infinite;
}

body::before{
  top: -120px;
  right: -120px;
  background: rgba(255,255,255,.18);
}

body::after{
  bottom: -140px;
  left: -140px;
  background: rgba(255,255,255,.12);
  animation-duration: 16s;
}

@keyframes floaty{
  0%,100%{ transform: translate(0,0) scale(1); }
  50%{ transform: translate(40px,-25px) scale(1.06); }
}

/* إذا المستخدم مفعّل تقليل الحركة بالنظام */
@media (prefers-reduced-motion: reduce){
  body::before, body::after{ animation: none; }
}

/* ✅ نخلي كل عناصر الواجهة فوق الطبقات */
.page, .header, .main, .container{
  position: relative;
  z-index: 1;
}

a{ color:inherit; text-decoration:none; }
hr{ border:0; border-top:1px solid var(--border); }

/* Layout */
.container{
  width:min(1200px, calc(100% - 32px));
  margin: 0 auto;
}
.page{
  min-height:100%;
  display:flex;
  flex-direction:column;
}
.header{
  background: var(--brand-900);
  color:#fff;
  padding:16px 0;
  box-shadow: var(--shadow-sm);
}
.header .bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  letter-spacing:.2px;
}
.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  font-size: 13px;
}

.main{ padding:22px 0 30px; }

/* Cards */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:18px;
}
.card-title{
  font-size:18px;
  margin:0 0 10px;
  font-weight:800;
}
.card-sub{
  margin:0 0 14px;
  color:var(--muted);
  font-size:14px;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius: 14px;
  border:1px solid transparent;
  cursor:pointer;
  font-weight:700;
  transition:.15s;
  user-select:none;
}
.btn:active{ transform: translateY(1px); }

.btn-primary{
  background: var(--brand-600);
  color:#fff;
}
.btn-primary:hover{ filter: brightness(.97); }

.btn-ghost{
  background:transparent;
  border-color: rgba(255,255,255,.25);
  color:#fff;
}
.btn-outline{
  background:transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover{ background: #f8fafc; }

.btn-danger{
  background: var(--danger);
  color:#fff;
}

/* Forms */
.field{ display:flex; flex-direction:column; gap:6px; margin-bottom:12px; }
label{ font-weight:800; font-size:14px; }
input, select, textarea{
  width:100%;
  padding:11px 12px;
  border-radius: 14px;
  border:1px solid var(--border);
  background:#fff;
  outline:none;
  font-size:14px;
}
input:focus, select:focus, textarea:focus{
  box-shadow: var(--focus);
  border-color: var(--brand-500);
}
.help{ color:var(--muted); font-size:12px; }

/* Table */
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background:#fff;
}
.table th, .table td{
  padding:12px 12px;
  border-bottom:1px solid var(--border);
  text-align:right;
  font-size:14px;
}
.table th{
  background:#f8fafc;
  font-weight:900;
}
.table tr:last-child td{ border-bottom:0; }

/* Alerts */
.alert{
  border-radius: var(--radius);
  padding:12px 14px;
  border:1px solid var(--border);
  background:#fff;
  display:flex;
  gap:10px;
  align-items:flex-start;
}
.alert.success{ border-color: rgba(22,163,74,.25); background: rgba(22,163,74,.06); }
.alert.warning{ border-color: rgba(245,158,11,.28); background: rgba(245,158,11,.08); }
.alert.danger{ border-color: rgba(220,38,38,.25); background: rgba(220,38,38,.06); }
.alert.info{ border-color: rgba(14,165,233,.25); background: rgba(14,165,233,.06); }

/* Responsive */
.grid-2{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:16px;
}
@media (max-width: 900px){
  .grid-2{ grid-template-columns: 1fr; }
  .header .bar{ flex-direction:column; align-items:flex-start; }
}
/* ===== تحسين تناسق الخلفية ===== */
.page{
  position: relative;
}

/* طبقة تعتيم + بلور فوق الخلفية */
.page::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  /* تعتيم ناعم */
  background: rgba(10, 14, 22, .55);

  /* بلور خفيف للخلفية (يدعم معظم المتصفحات الحديثة) */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* نخلي كل شيء فوق الطبقة */
.header, .main, .container, .card{
  position: relative;
  z-index: 1;
}
/* ===== كارت أنعم (Glass) ===== */
.auth-card{
  background: rgba(255,255,255,.92) !important;
  border: 1px solid rgba(255,255,255,.35) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.25) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
/* ===== توحيد المقاسات ===== */
.field input,
.field select,
.field textarea{
  height: 48px;
  border-radius: 16px;
}

/* الأيقونات داخل الحقول: خليها بنفس اللون */
.input-ico .ico{
  opacity: .75;
  color: #111827;
}

/* زر العين */
.ico-btn{
  opacity: .75;
}
.ico-btn:hover{
  background: rgba(0,0,0,.06);
}

/* أزرار الدخول/مساعدة بنفس الارتفاع */
.auth-actions .btn{
  height: 48px;
  border-radius: 16px;
  font-weight: 800;
}
/* ===== تنبيه علوي أنعم ===== */
.alert{
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
