@font-face { font-family: "Cairo"; src: url("fonts/cairo-arabic.woff2") format("woff2"); font-weight: 200 1000; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; font-display: swap; }
@font-face { font-family: "Cairo"; src: url("fonts/cairo-latin.woff2") format("woff2"); font-weight: 200 1000; unicode-range: U+0000-00FF, U+2000-206F; font-display: swap; }

:root {
  --ink: #0f172a; --muted: #64748b; --line: #e2e8f0; --bg: #f8fafc; --panel: #ffffff;
  --brand: #4f46e5; --brand-2: #6366f1; --brand-3: #312e81; --gold: #e0b44c; --bad: #e11d48; --ok: #059669;
  --ring: 0 0 0 4px rgba(99, 102, 241, .16);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Cairo", system-ui, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.auth { display: grid; grid-template-columns: 1.08fr 1fr; min-height: 100vh; }

/* ============ نصف الهوية ============ */
.brand-side { position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column;
  background: radial-gradient(1200px 700px at 110% -10%, #6d28d9 0%, transparent 55%),
              radial-gradient(900px 600px at -20% 110%, #1d4ed8 0%, transparent 55%),
              linear-gradient(160deg, #1e1b4b 0%, #0f0c29 55%, #090718 100%); }
.brand-side::before { content: ""; position: absolute; inset: 0; opacity: .14; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 60% 40%, #000 20%, transparent 75%); }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; pointer-events: none; animation: drift 18s ease-in-out infinite alternate; }
.orb.o1 { width: 420px; height: 420px; background: #7c3aed; top: -120px; left: -80px; }
.orb.o2 { width: 360px; height: 360px; background: #2563eb; bottom: -140px; right: -60px; animation-duration: 22s; }
.orb.o3 { width: 240px; height: 240px; background: var(--gold); top: 42%; left: 38%; opacity: .22; animation-duration: 26s; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(40px, -30px) scale(1.12); } 100% { transform: translate(-30px, 40px) scale(.95); } }

.brand-top { position: relative; display: flex; align-items: center; gap: 14px; z-index: 2; }
.mark { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-weight: 900; font-size: 26px;
  background: linear-gradient(135deg, var(--gold), #b7791f); color: #1e1b4b; box-shadow: 0 10px 30px rgba(224,180,76,.35), inset 0 1px 0 rgba(255,255,255,.5); }
.brand-top .nm { font-weight: 900; font-size: 24px; letter-spacing: -.3px; }
.brand-top .sub { font-size: 13px; color: #c7d2fe; }

.brand-mid { position: relative; z-index: 2; margin: auto 0; max-width: 520px; }
.brand-mid h1 { font-size: clamp(30px, 3.2vw, 46px); line-height: 1.25; margin: 0 0 14px; font-weight: 900; letter-spacing: -.5px; }
.brand-mid h1 .gl { background: linear-gradient(90deg, #fde68a, var(--gold), #f59e0b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-mid p { color: #c7d2fe; font-size: 16px; line-height: 1.9; margin: 0 0 26px; }
.feat { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.feat li { display: flex; gap: 12px; align-items: center; font-size: 15px; color: #e0e7ff; opacity: 0; transform: translateX(-14px); animation: in-x .7s cubic-bezier(.2,.8,.2,1) forwards; }
.feat li:nth-child(1) { animation-delay: .35s; } .feat li:nth-child(2) { animation-delay: .5s; } .feat li:nth-child(3) { animation-delay: .65s; } .feat li:nth-child(4) { animation-delay: .8s; }
.feat .ck { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.feat .ck svg { width: 16px; height: 16px; stroke: var(--gold); }
@keyframes in-x { to { opacity: 1; transform: none; } }

.float-card { position: absolute; z-index: 2; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(14px);
  border-radius: 18px; padding: 14px 18px; box-shadow: 0 20px 50px rgba(0,0,0,.35); animation: bob 6s ease-in-out infinite; }
.float-card .k { font-size: 12px; color: #c7d2fe; } .float-card .v { font-size: 22px; font-weight: 800; }
.float-card .bar { height: 6px; border-radius: 9px; background: rgba(255,255,255,.12); margin-top: 8px; overflow: hidden; }
.float-card .bar i { display: block; height: 100%; width: 0; border-radius: 9px; background: linear-gradient(90deg, var(--gold), #f59e0b); animation: grow 2.2s 1s cubic-bezier(.2,.8,.2,1) forwards; }
.fc1 { top: 120px; left: 48px; width: 210px; } .fc2 { bottom: 150px; left: 92px; width: 190px; animation-delay: -3s; }
@keyframes bob { 50% { transform: translateY(-12px); } }
@keyframes grow { to { width: 78%; } }

.brand-foot { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pay-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pay-row span { background: #fff; border-radius: 10px; padding: 6px 10px; height: 38px; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.pay-row img { height: 22px; width: auto; display: block; }
.brand-foot small { color: #a5b4fc; }

/* ============ نصف النموذج ============ */
.form-side { display: grid; place-items: center; padding: 40px 24px; background:
  radial-gradient(700px 400px at 100% 0%, rgba(99,102,241,.08), transparent 60%), var(--bg); }
.card { width: 100%; max-width: 430px; }
.card .hi { font-size: 28px; font-weight: 900; margin: 0 0 4px; letter-spacing: -.3px; }
.card .lead { color: var(--muted); margin: 0 0 22px; }
.stagger > * { opacity: 0; transform: translateY(14px); animation: in-y .65s cubic-bezier(.2,.8,.2,1) forwards; }
.stagger > *:nth-child(1) { animation-delay: .05s; } .stagger > *:nth-child(2) { animation-delay: .12s; } .stagger > *:nth-child(3) { animation-delay: .19s; }
.stagger > *:nth-child(4) { animation-delay: .26s; } .stagger > *:nth-child(5) { animation-delay: .33s; } .stagger > *:nth-child(6) { animation-delay: .40s; }
.stagger > *:nth-child(7) { animation-delay: .47s; } .stagger > *:nth-child(8) { animation-delay: .54s; } .stagger > *:nth-child(9) { animation-delay: .61s; }
@keyframes in-y { to { opacity: 1; transform: none; } }

.tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: #eef2ff; border-radius: 14px; padding: 5px; margin-bottom: 22px; }
.tabs a { position: relative; z-index: 1; text-align: center; padding: 10px; font-weight: 700; color: #475569; border-radius: 10px; transition: color .25s; }
.tabs a:hover { text-decoration: none; }
.tabs a.on { color: var(--brand-3); }
.tabs .pill { position: absolute; top: 5px; bottom: 5px; width: calc(50% - 5px); right: 5px; background: #fff; border-radius: 10px;
  box-shadow: 0 2px 10px rgba(49,46,129,.12); transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.tabs.reg .pill { transform: translateX(-100%); }

.field { position: relative; margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: #334155; margin-bottom: 6px; }
.field .ctl { position: relative; }
.field input { width: 100%; height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-size: 15px;
  padding: 0 46px 0 46px; color: var(--ink); transition: border-color .2s, box-shadow .2s, transform .2s; outline: none; }
.field input:focus { border-color: var(--brand-2); box-shadow: var(--ring); }
.field input[dir="ltr"] { text-align: right; }
.field .ico { position: absolute; top: 50%; right: 15px; transform: translateY(-50%); width: 19px; height: 19px; stroke: #94a3b8; transition: stroke .2s; pointer-events: none; }
.field input:focus ~ .ico { stroke: var(--brand); }
.field .eye { position: absolute; top: 50%; left: 10px; transform: translateY(-50%); border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: 8px; color: #94a3b8; }
.field .eye:hover { background: #f1f5f9; color: var(--brand); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn-main { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; margin: 8px auto 0; width: 100%; height: 54px;
  border: 0; border-radius: 16px; cursor: pointer; color: #fff; font: inherit; font-weight: 800; font-size: 16px; overflow: hidden;
  background: linear-gradient(135deg, #4f46e5 0%, #6d28d9 60%, #7c3aed 100%); box-shadow: 0 12px 28px rgba(79,70,229,.35);
  transition: width .5s cubic-bezier(.65,0,.35,1), border-radius .5s cubic-bezier(.65,0,.35,1), transform .15s, box-shadow .3s; }
.btn-main:hover { box-shadow: 0 16px 36px rgba(79,70,229,.45); }
.btn-main:active { transform: scale(.96); }
.btn-main::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(120%); transition: transform .8s; }
.btn-main:hover::after { transform: translateX(-120%); }
.btn-main .lbl { transition: opacity .2s; white-space: nowrap; }
.btn-main .spin { position: absolute; width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; opacity: 0; }
.btn-main.loading { width: 54px; border-radius: 50%; pointer-events: none; }
.btn-main.loading .lbl { opacity: 0; }
.btn-main.loading .spin { opacity: 1; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.alt { text-align: center; color: var(--muted); font-size: 14px; margin-top: 18px; }
.secure-note { display: flex; gap: 8px; align-items: center; justify-content: center; color: #64748b; font-size: 12.5px; margin-top: 22px; }
.secure-note svg { width: 15px; height: 15px; stroke: var(--ok); }

.flash { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 14px; animation: shake .5s; }
.flash.error { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }
.flash.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; animation: in-y .4s; }
.flash svg { width: 18px; height: 18px; flex: none; }
@keyframes shake { 0%,100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }

/* رمز التحقق */
.otp { display: flex; gap: 10px; justify-content: center; direction: ltr; margin: 8px 0 6px; }
.otp input { width: 52px; height: 62px; text-align: center; font-size: 26px; font-weight: 800; border-radius: 14px; border: 1.5px solid var(--line);
  background: #fff; outline: none; transition: border-color .2s, box-shadow .2s, transform .2s; font-family: inherit; }
.otp input:focus { border-color: var(--brand-2); box-shadow: var(--ring); transform: translateY(-2px); }
.otp input.filled { border-color: var(--brand); background: #eef2ff; }
.shield { width: 74px; height: 74px; margin: 0 auto 14px; border-radius: 22px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #4f46e5, #7c3aed); box-shadow: 0 16px 34px rgba(79,70,229,.35); animation: pulse 2.4s infinite; }
.shield svg { width: 34px; height: 34px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 16px 34px rgba(79,70,229,.35), 0 0 0 0 rgba(99,102,241,.35); } 50% { box-shadow: 0 16px 34px rgba(79,70,229,.35), 0 0 0 16px rgba(99,102,241,0); } }

@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .brand-side { min-height: 250px; padding: 28px; }
  .brand-mid h1 { font-size: 26px; } .brand-mid p, .feat, .float-card { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
