/* =========================================================
   صفحة الدخول — تصميم غامر مع شاشة ترحيب متحركة
   ========================================================= */
:root { --primary: #0d7a6b; --primary-rgb: 13, 122, 107; --primary-d: #09594e; --gold: #e2b54a; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; font-family: 'IBM Plex Sans Arabic', Tahoma, sans-serif; color: #e8f1f4; overflow-x: hidden;
  background: radial-gradient(1200px 700px at 85% 10%, rgba(var(--primary-rgb), .55), transparent 60%),
              radial-gradient(900px 600px at 0% 100%, rgba(226, 181, 74, .16), transparent 60%),
              linear-gradient(160deg, #071a2e 0%, #0a2238 45%, #061524 100%);
  background-attachment: fixed;
}
#bg { position: fixed; inset: 0; z-index: 0; }
.grid-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
.orb { position: fixed; border-radius: 50%; filter: blur(70px); z-index: 0; pointer-events: none; animation: float 16s ease-in-out infinite; }
.o1 { width: 420px; height: 420px; background: rgba(var(--primary-rgb), .55); top: -120px; right: 18%; }
.o2 { width: 360px; height: 360px; background: rgba(226, 181, 74, .25); bottom: -120px; left: 8%; animation-delay: -5s; }
.o3 { width: 260px; height: 260px; background: rgba(56, 189, 248, .18); top: 40%; left: 40%; animation-delay: -9s; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(40px, -30px) scale(1.08); } 66% { transform: translate(-30px, 25px) scale(.95); } }

.stage { position: relative; z-index: 2; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); transition: opacity .5s, transform .6s, filter .6s; }
body.leaving .stage { opacity: 0; transform: scale(.96); }
body.leaving .orb { animation-play-state: paused; }

/* ---------- لوحة الهوية ---------- */
.brand { padding: 44px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; }
.brand-top { display: flex; align-items: center; gap: 14px; animation: rise .8s .1s both; }
.brand-top small { display: block; color: #8fb1c4; font-size: 12.5px; }
.brand-top b { font-size: 17px; font-weight: 600; color: #fff; }
.emblem { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; color: #fff; overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--gold)); box-shadow: 0 10px 30px rgba(var(--primary-rgb), .45); flex: none; }
.emblem img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 4px; }

.kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 30px; font-size: 13.5px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); color: #f6d58a; animation: rise .8s .25s both; }
.brand h1 { font-family: 'Reem Kufi', sans-serif; font-weight: 700; margin: 18px 0 14px; line-height: 1.08; font-size: clamp(48px, 7vw, 96px); }
.brand h1 span { display: block; }
.brand h1 .l1 { color: #fff; animation: rise .9s .35s both; }
.brand h1 .l2 { background: linear-gradient(90deg, #5eead4, var(--gold), #5eead4); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rise .9s .5s both, shine 6s linear infinite; }
@keyframes shine { to { background-position: 200% center; } }
.lead { font-size: 17px; line-height: 1.9; color: #b9cfdb; max-width: 520px; margin: 0; animation: rise .9s .65s both; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

.ticker { margin-top: 28px; overflow: hidden; max-width: 560px; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); animation: rise .9s .8s both; }
.ticker-track { display: flex; gap: 12px; width: max-content; animation: marquee 26s linear infinite; }
.ticker span { white-space: nowrap; padding: 7px 16px; border-radius: 30px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); font-size: 14px; color: #dcebf1; }
.ticker span i { color: var(--gold); margin-left: 4px; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(50%); } }

.brand-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; animation: rise .9s .95s both; }
.clock { display: flex; align-items: center; gap: 16px; }
.clock b { font-size: 44px; font-weight: 300; letter-spacing: 1px; color: #fff; font-variant-numeric: tabular-nums; direction: ltr; }
.clock b em { font-style: normal; font-size: 16px; color: var(--gold); margin-right: 4px; }
.clock span { display: block; font-size: 14.5px; color: #e6f2f6; }
.clock small { color: #8fb1c4; font-size: 13px; }
.feat { display: flex; flex-wrap: wrap; gap: 8px; max-width: 360px; }
.feat span { font-size: 12.5px; color: #a9c4d2; padding: 4px 10px; border-radius: 8px; background: rgba(255, 255, 255, .05); }
.feat i { color: #5eead4; margin-left: 4px; }

/* ---------- بطاقة الدخول ---------- */
.login-side { display: grid; place-items: center; padding: 30px; }
.login-card {
  --mx: 50%; --my: 0%;
  position: relative; width: min(430px, 100%); padding: 38px 34px 26px; border-radius: 28px; text-align: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .05));
  border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .15);
  transition: transform .25s ease-out; animation: cardIn 1s .3s cubic-bezier(.2, .9, .3, 1.2) both;
}
.login-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(400px circle at var(--mx) var(--my), rgba(255, 255, 255, .12), transparent 45%); }
@keyframes cardIn { from { opacity: 0; transform: translateY(40px) scale(.95); } to { opacity: 1; transform: none; } }
.login-card.shake { animation: shake .5s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

.lc-avatar { position: relative; width: 96px; height: 96px; margin: -86px auto 14px; }
.lc-ring { position: absolute; inset: -6px; border-radius: 50%; background: conic-gradient(from 0deg, #5eead4, var(--gold), #38bdf8, #5eead4); animation: spin 6s linear infinite; }
.lc-ring::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: #0c2a40; }
@keyframes spin { to { transform: rotate(360deg); } }
.lc-img { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--primary-d)); z-index: 1; }
.lc-img img { width: 100%; height: 100%; object-fit: cover; }
.lc-img span { font-family: 'Reem Kufi', sans-serif; font-size: 40px; color: #fff; }
.lc-greet { margin: 0; color: var(--gold); font-size: 14.5px; }
.login-card h2 { margin: 4px 0 4px; font-size: 22px; font-weight: 600; color: #fff; }
.lc-sub { margin: 0 0 22px; color: #a9c4d2; font-size: 13.5px; }
.lc-error { display: flex; gap: 8px; align-items: center; text-align: right; background: rgba(239, 68, 68, .16); border: 1px solid rgba(239, 68, 68, .35); color: #fecaca; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; margin-bottom: 14px; }

.fl { position: relative; display: block; margin-bottom: 14px; }
.fl > i { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: #7fa6b8; font-size: 18px; transition: color .2s; z-index: 1; }
.fl input { width: 100%; height: 58px; padding: 20px 48px 6px 48px; border-radius: 16px; font: inherit; font-size: 16px; color: #fff; text-align: right;
  background: rgba(4, 18, 32, .45); border: 1px solid rgba(255, 255, 255, .14); outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.fl input:focus { border-color: #5eead4; box-shadow: 0 0 0 4px rgba(94, 234, 212, .15); background: rgba(4, 18, 32, .6); }
.fl input:focus ~ i, .fl:focus-within > i { color: #5eead4; }
.fl > span { position: absolute; right: 48px; top: 50%; transform: translateY(-50%); color: #8fb1c4; font-size: 15px; pointer-events: none; transition: all .2s; }
.fl input:focus + span, .fl input:not(:placeholder-shown) + span { top: 15px; font-size: 11.5px; color: #5eead4; }
.eye { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #8fb1c4; font-size: 18px; cursor: pointer; padding: 8px; }
.eye:hover { color: #fff; }
.caps { font-size: 12.5px; color: #fcd34d; text-align: right; margin: -6px 4px 10px; }

.lc-btn { position: relative; width: 100%; height: 56px; border: 0; border-radius: 16px; cursor: pointer; overflow: hidden; margin-top: 6px;
  font: inherit; font-size: 16.5px; font-weight: 600; color: #fff; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(135deg, #14b8a6, var(--primary) 55%, var(--primary-d)); box-shadow: 0 14px 30px rgba(var(--primary-rgb), .45); transition: transform .2s, box-shadow .2s; }
.lc-btn::before { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; right: -60%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); transform: skewX(-20deg); animation: sweep 3.5s ease-in-out infinite; }
@keyframes sweep { 0%, 60% { right: -60%; } 100% { right: 130%; } }
.lc-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(var(--primary-rgb), .55); }
.lc-btn i { transition: transform .25s; }
.lc-btn:hover i { transform: translateX(-5px); }
.lc-btn .spin { display: none; width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; }
.lc-btn.loading .t, .lc-btn.loading i { display: none; }
.lc-btn.loading .spin { display: block; }
.lc-foot { margin-top: 18px; font-size: 12.5px; color: #7fa6b8; }
.lc-foot i { color: #5eead4; }

/* ---------- شاشة الترحيب ---------- */
.welcome { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity .6s;
  background: radial-gradient(900px 600px at 50% 40%, rgba(var(--primary-rgb), .55), transparent 70%), rgba(5, 16, 28, .94); }
.welcome.show { opacity: 1; }
.welcome.out { opacity: 0; transform: scale(1.05); transition: opacity .45s, transform .45s; }
.w-center { text-align: center; max-width: 720px; width: 100%; position: relative; z-index: 2; }
.w-avatar { position: relative; width: 150px; height: 150px; margin: 0 auto 26px; animation: popIn .9s .15s cubic-bezier(.2, .9, .3, 1.4) both; }
@keyframes popIn { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }
.w-wave { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(94, 234, 212, .6); animation: wave 2.4s ease-out infinite; }
.w-wave.d2 { animation-delay: .8s; } .w-wave.d3 { animation-delay: 1.6s; }
@keyframes wave { from { transform: scale(1); opacity: .8; } to { transform: scale(2.1); opacity: 0; } }
.w-spin { position: absolute; inset: -8px; border-radius: 50%; background: conic-gradient(from 0deg, transparent, #5eead4, var(--gold), transparent 70%); animation: spin 1.6s linear infinite;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); }
.w-img { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--primary-d)); border: 4px solid rgba(255, 255, 255, .2); box-shadow: 0 20px 50px rgba(0, 0, 0, .4); }
.w-img img { width: 100%; height: 100%; object-fit: cover; }
.w-img span { font-family: 'Reem Kufi', sans-serif; font-size: 64px; color: #fff; }
.w-check { position: absolute; bottom: 4px; left: 4px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; color: #fff;
  background: linear-gradient(135deg, #22c55e, #15803d); border: 3px solid #0a2238; animation: popIn .6s 1s cubic-bezier(.2, .9, .3, 1.6) both; z-index: 2; }
.w-greet { margin: 0; font-size: 19px; color: var(--gold); animation: rise .7s .85s both; }
.w-name { margin: 6px 0 8px; font-family: 'Reem Kufi', sans-serif; font-weight: 600; font-size: clamp(30px, 5vw, 48px); color: #fff; min-height: 1.3em; }
.caret { display: inline-block; width: 3px; height: .9em; background: #5eead4; margin-right: 6px; vertical-align: middle; animation: blink .8s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.w-role { color: #b9cfdb; margin: 0 0 26px; font-size: 16px; animation: rise .7s 1.6s both; }
.w-role i { color: #5eead4; }
.w-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.w-stat { padding: 14px 10px; border-radius: 16px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); animation: rise .6s var(--d) both; }
.w-stat i { font-size: 20px; color: #5eead4; display: block; }
.w-stat b { display: block; font-size: 22px; color: #fff; margin-top: 4px; font-variant-numeric: tabular-nums; }
.w-stat small { color: #9fbccb; font-size: 12px; }
.w-load { max-width: 360px; margin: 0 auto; animation: rise .6s 1.3s both; }
.w-bar { height: 6px; border-radius: 10px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.w-bar span { display: block; height: 100%; width: 0; border-radius: 10px; background: linear-gradient(90deg, #5eead4, var(--gold)); box-shadow: 0 0 14px rgba(94, 234, 212, .7); }
.w-load small { display: block; margin-top: 10px; color: #9fbccb; font-size: 13px; }
.w-last { margin-top: 18px; font-size: 12.5px; color: #6f91a4; animation: rise .6s 2.4s both; }
.w-skip { position: absolute; bottom: 26px; left: 26px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .15); color: #cfe3ea; padding: 8px 18px; border-radius: 30px; font: inherit; font-size: 13.5px; cursor: pointer; z-index: 3; }
.w-skip:hover { background: rgba(255, 255, 255, .16); }
.w-burst { position: absolute; top: 50%; left: 50%; width: 0; height: 0; z-index: 1; margin-top: -120px; }
.w-burst i { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: var(--c); opacity: 0; animation: burst 1.6s cubic-bezier(.1, .8, .3, 1) both; box-shadow: 0 0 10px var(--c); }
@keyframes burst { 0% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(.3); } }

/* ---------- الاستجابة ---------- */
@media (max-width: 980px) {
  .stage { grid-template-columns: 1fr; }
  .brand { padding: 28px 22px 10px; gap: 18px; }
  .brand h1 { font-size: 54px; margin: 12px 0 8px; }
  .brand h1 span { display: inline; }
  .lead { font-size: 15px; }
  .brand-foot .feat, .ticker { display: none; }
  .clock b { font-size: 32px; }
  .login-side { padding: 70px 16px 40px; }
}
@media (max-width: 560px) {
  .w-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-card { padding: 34px 20px 22px; }
  .brand h1 { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
