:root{
  --bg:#070b14;
  --surface:#0d1322;
  --surface-2:#111a2e;
  --gold:#eab308;
  --gold-bright:#facc15;
  --gold-deep:#ca8a04;
  --text:#f1f5f9;
  --muted:#8a98ad;
  --muted-2:#5d6b80;
  --line:rgba(255,255,255,.07);
  --line-gold:rgba(234,179,8,.22);
  --danger:#ef4444;
  --success:#22c55e;
  --ease:cubic-bezier(.16,1,.3,1);
  --speed-fast:.18s;
  --speed-normal:.3s;
  --speed-slow:.5s;
  --radius-sm:.65rem;
  --radius:14px;
  --radius-lg:20px;
  --radius-pill:999px;
}

*,*::before,*::after{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html{scroll-behavior:smooth;background:var(--bg)}
body{
  font-family:'IBM Plex Sans Arabic',system-ui,sans-serif;
  background:
    radial-gradient(1100px 600px at 50% -10%,rgba(234,179,8,.08),transparent 60%),
    radial-gradient(800px 500px at 85% 110%,rgba(29,78,216,.07),transparent 55%),
    var(--bg);
  background-attachment:fixed;
  color:var(--text);
  min-height:100vh;min-height:100dvh;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.6;
}

/* خلفية ثابتة هادئة بدل الأجرام المتحركة الثقيلة */
.bg-orbs{display:none}

/* ---------- Card ---------- */
.glass-panel{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  box-shadow:0 20px 50px -18px rgba(0,0,0,.6);
  position:relative;
}
.glow-wrapper{display:none}
#glow-effect{display:none}

/* ---------- Title ---------- */
.reg-title{font-size:1.85rem;font-weight:700;color:var(--text);letter-spacing:-.01em}
.reg-title .accent{color:var(--gold)}

/* ---------- Inputs ---------- */
.input-group{position:relative;z-index:1;margin-bottom:1.5rem}
.floating-input{
  width:100%;background:rgba(255,255,255,.02);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:1.2rem 2.9rem .5rem 2.9rem;
  color:var(--text);font-size:.95rem;
  transition:border-color var(--speed-fast),background var(--speed-fast),box-shadow var(--speed-fast);
}
.floating-input:focus{
  outline:none;border-color:var(--line-gold);
  background:rgba(234,179,8,.04);
  box-shadow:0 0 0 3px rgba(234,179,8,.08);
}
.floating-input:-webkit-autofill,
.floating-input:-webkit-autofill:hover,
.floating-input:-webkit-autofill:focus{
  -webkit-text-fill-color:var(--text);
  -webkit-box-shadow:0 0 0 1000px var(--surface-2) inset;
  caret-color:var(--text);
  transition:background-color 9999s ease-in-out 0s;
}
.floating-label{
  position:absolute;right:2.9rem;top:1rem;
  color:var(--muted);font-size:.95rem;
  transition:transform var(--speed-fast) var(--ease),color var(--speed-fast);
  pointer-events:none;transform-origin:right top;
}
.floating-input:focus~.floating-label,
.floating-input:not(:placeholder-shown)~.floating-label,
.floating-input:-webkit-autofill~.floating-label{transform:translateY(-.62rem) scale(.74);color:var(--gold)}
.input-icon{position:absolute;right:1rem;top:1.05rem;color:var(--muted-2);transition:color var(--speed-fast);width:1.2rem;height:1.2rem;pointer-events:none}
.floating-input:focus~.input-icon{color:var(--gold)}
.valid-check{position:absolute;left:1rem;top:1.05rem;color:var(--success);opacity:0;transform:scale(.5);transition:opacity var(--speed-fast),transform var(--speed-fast) var(--ease);pointer-events:none}
.input-group.is-valid .valid-check{opacity:1;transform:scale(1)}

/* ---------- Custom dropdown ---------- */
.custom-dropdown-container{position:relative;z-index:10;margin-bottom:1.5rem}
.custom-dropdown-container.active{z-index:50}
.custom-dropdown-selected{
  width:100%;background:rgba(255,255,255,.02);
  border:1px solid var(--line);border-radius:var(--radius);
  padding:1rem;color:var(--muted);
  display:flex;justify-content:space-between;align-items:center;cursor:pointer;
  transition:border-color var(--speed-fast),background var(--speed-fast),box-shadow var(--speed-fast);
  font-size:.95rem;
}
.custom-dropdown-selected.has-value{color:var(--text)}
.custom-dropdown-selected:focus,
.custom-dropdown-container.active .custom-dropdown-selected{
  border-color:var(--line-gold);box-shadow:0 0 0 3px rgba(234,179,8,.08);background:rgba(234,179,8,.04);
}
.custom-dropdown-options{
  position:absolute;top:calc(100% + .5rem);left:0;right:0;
  background:var(--surface-2);
  border:1px solid var(--line);border-radius:var(--radius);
  overflow:hidden;opacity:0;visibility:hidden;transform:translateY(-6px);
  transition:opacity var(--speed-fast) var(--ease),transform var(--speed-fast) var(--ease),visibility var(--speed-fast);
  box-shadow:0 20px 40px -12px rgba(0,0,0,.7);z-index:70;max-height:220px;overflow-y:auto;
}
.custom-dropdown-container.active .custom-dropdown-options{opacity:1;visibility:visible;transform:translateY(0)}
.custom-dropdown-option{padding:.9rem 1rem;color:var(--text);cursor:pointer;transition:background var(--speed-fast),color var(--speed-fast);border-bottom:1px solid var(--line)}
.custom-dropdown-option:last-child{border-bottom:none}
.custom-dropdown-option:hover{background:rgba(234,179,8,.1);color:var(--gold)}
.custom-dropdown-label{position:absolute;right:1rem;top:-.62rem;background:var(--surface);padding:0 .5rem;font-size:.72rem;color:var(--gold);border-radius:4px;z-index:2}

/* ---------- Wizard ---------- */
.wizard-step{display:none}
.wizard-step.active{display:block;animation:stepIn var(--speed-normal) var(--ease) both}
@keyframes stepIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}

/* ---------- Progress ---------- */
.progress-container{display:flex;justify-content:space-between;align-items:center;position:relative;margin-bottom:2.5rem;padding:0 .5rem}
.progress-line{position:absolute;top:50%;left:.5rem;right:.5rem;height:2px;background:var(--line);transform:translateY(-50%);z-index:1}
.progress-line-fill{position:absolute;top:0;right:0;height:100%;background:linear-gradient(90deg,var(--gold-bright),var(--gold-deep));transition:width var(--speed-slow) var(--ease)}
.progress-dot{
  width:2.3rem;height:2.3rem;border-radius:50%;background:var(--surface-2);
  border:2px solid var(--line);display:flex;justify-content:center;align-items:center;
  position:relative;z-index:2;transition:border-color var(--speed-normal),background var(--speed-normal),color var(--speed-normal);
  color:var(--muted);font-weight:700;font-size:.85rem;
}
.progress-dot.active{border-color:var(--gold);background:rgba(234,179,8,.1);color:var(--gold)}
.progress-dot.completed{border-color:var(--gold);background:var(--gold);color:#07101f}
.progress-dot svg{width:1.1rem;height:1.1rem}

/* ---------- Buttons ---------- */
.btn-premium{
  background:linear-gradient(135deg,var(--gold),var(--gold-bright));
  color:#07101f;font-weight:700;padding:1.05rem;border-radius:var(--radius);
  position:relative;overflow:hidden;width:100%;
  box-shadow:0 10px 24px -8px rgba(234,179,8,.45);
  transition:transform var(--speed-fast),box-shadow var(--speed-fast),opacity var(--speed-fast);
}
.btn-premium:hover{transform:translateY(-2px);box-shadow:0 16px 32px -8px rgba(234,179,8,.55)}
.btn-premium:active{transform:translateY(0)}
.btn-premium:disabled{cursor:default;opacity:.7}
.btn-premium:focus-visible{outline:2px solid var(--text);outline-offset:3px}
.btn-secondary{
  background:rgba(255,255,255,.02);color:var(--text);padding:1.05rem;border-radius:var(--radius);
  border:1px solid var(--line);font-weight:600;width:100%;
  transition:background var(--speed-fast),border-color var(--speed-fast);
}
.btn-secondary:hover{background:rgba(255,255,255,.05);border-color:var(--line-gold)}

/* Smaller buttons on mobile */
@media (max-width:640px){
  .btn-premium,.btn-secondary{padding:.75rem .9rem;font-size:.92rem;border-radius:12px}
  .btn-premium svg,.btn-secondary svg{width:1rem;height:1rem}
}

/* ---------- Strength meter ---------- */
.strength-meter{height:4px;background:rgba(255,255,255,.08);border-radius:var(--radius-pill);overflow:hidden;margin-top:.5rem}
.strength-fill{height:100%;width:0;transition:width var(--speed-normal) var(--ease),background var(--speed-normal)}
.strength-text{font-size:.72rem;margin-top:.3rem;text-align:left;display:block;height:1rem;transition:color var(--speed-normal)}

/* ---------- Errors ---------- */
.inline-error{font-size:.72rem;color:var(--danger);position:absolute;bottom:-1.15rem;right:.5rem;opacity:0;transition:opacity var(--speed-fast)}
.has-error .inline-error{opacity:1}
.has-error .floating-input,
.has-error .custom-dropdown-selected{border-color:var(--danger) !important;box-shadow:0 0 0 3px rgba(239,68,68,.12) !important}
@keyframes errShake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(2px,0,0)}30%,50%,70%{transform:translate3d(-4px,0,0)}40%,60%{transform:translate3d(4px,0,0)}}
.error-shake{animation:errShake .4s cubic-bezier(.36,.07,.19,.97) both}

/* ---------- Success overlay ---------- */
.success-overlay{position:absolute;inset:0;background:rgba(7,11,20,.94);z-index:100;display:flex;flex-direction:column;justify-content:center;align-items:center;opacity:0;visibility:hidden;transition:opacity var(--speed-normal) ease,visibility var(--speed-normal);border-radius:inherit}
.success-overlay.active{opacity:1;visibility:visible}
.check-circle{width:84px;height:84px;border-radius:50%;border:3px solid var(--line-gold);display:flex;justify-content:center;align-items:center;box-shadow:0 0 30px rgba(234,179,8,.3);transform:scale(0)}
.success-overlay.active .check-circle{animation:ringPop var(--speed-normal) var(--ease) forwards}
@keyframes ringPop{to{transform:scale(1)}}
.check-path{stroke-dasharray:60;stroke-dashoffset:60}
.success-overlay.active .check-path{animation:drawCheck .45s ease forwards .2s}
@keyframes drawCheck{to{stroke-dashoffset:0}}

/* ---------- Entrance ---------- */
@keyframes fadeUp{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
.animate-fade-up{opacity:0;animation:fadeUp var(--speed-slow) var(--ease) forwards}
.stagger-1{animation-delay:.05s}
.stagger-2{animation-delay:.11s}
.stagger-3{animation-delay:.17s}

/* ---------- Scrollbar ---------- */
*{scrollbar-width:thin;scrollbar-color:rgba(234,179,8,.4) transparent}
::-webkit-scrollbar{width:8px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:rgba(255,255,255,.1);border-radius:4px;border:2px solid transparent;background-clip:padding-box}
::-webkit-scrollbar-thumb:hover{background:rgba(234,179,8,.5);background-clip:padding-box}
::selection{background:rgba(234,179,8,.3);color:#fff}

/* ---------- Step labels ---------- */
.step-labels{display:flex;justify-content:space-between;padding:0 .1rem;margin:-1.7rem 0 2.2rem}
.step-label{font-size:.68rem;color:var(--muted-2);width:2.9rem;text-align:center;transition:color var(--speed-normal);letter-spacing:.01em}
.step-label.active{color:var(--gold);font-weight:700}
.step-label.completed{color:var(--muted)}

/* ---------- Gate badge ---------- */
.gate-badge{
  display:inline-flex;align-items:center;gap:.45rem;margin-top:.9rem;
  padding:.32rem .85rem;border-radius:var(--radius-pill);
  background:rgba(255,255,255,.03);border:1px solid var(--line);
  font-size:.72rem;color:var(--muted);
  transition:border-color var(--speed-normal),color var(--speed-normal),background var(--speed-normal);
}
.gate-badge-dot{width:.5rem;height:.5rem;border-radius:50%;background:var(--muted-2);flex-shrink:0;transition:background var(--speed-normal),box-shadow var(--speed-normal)}
.gate-badge.is-open{border-color:rgba(34,197,94,.35);color:#86efac;background:rgba(34,197,94,.06)}
.gate-badge.is-open .gate-badge-dot{background:var(--success);box-shadow:0 0 8px rgba(34,197,94,.7);animation:gatePulse 2.2s ease-in-out infinite}
.gate-badge.is-closed{border-color:rgba(239,68,68,.35);color:#fca5a5;background:rgba(239,68,68,.06)}
.gate-badge.is-closed .gate-badge-dot{background:var(--danger);box-shadow:0 0 8px rgba(239,68,68,.7)}
@keyframes gatePulse{0%,100%{box-shadow:0 0 4px rgba(34,197,94,.5)}50%{box-shadow:0 0 12px rgba(34,197,94,.9)}}

/* ---------- Closed overlay (registration gate) ---------- */
.form-locked #regForm,
.form-locked .progress-container,
.form-locked .step-labels{
  filter:blur(7px) saturate(.6);
  pointer-events:none;user-select:none;
  opacity:.35;transition:filter var(--speed-slow) var(--ease),opacity var(--speed-slow) var(--ease);
}
.closed-overlay{
  position:absolute;inset:0;z-index:90;border-radius:inherit;
  display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;
  padding:2rem 1.5rem;gap:.4rem;
  background:linear-gradient(180deg,rgba(7,11,20,.55),rgba(7,11,20,.8));
  backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);
  animation:fadeUp var(--speed-slow) var(--ease) both;
}
.closed-overlay[hidden]{display:none}
.closed-lock-ring{
  width:88px;height:88px;border-radius:50%;
  display:flex;justify-content:center;align-items:center;
  color:var(--gold);background:rgba(234,179,8,.07);
  border:2px solid var(--line-gold);
  box-shadow:0 0 0 10px rgba(234,179,8,.04),0 0 40px rgba(234,179,8,.18);
  margin-bottom:1rem;position:relative;
}
.closed-lock-ring::after{
  content:'';position:absolute;inset:-10px;border-radius:50%;
  border:1px dashed rgba(234,179,8,.25);
  animation:lockOrbit 14s linear infinite;
}
@keyframes lockOrbit{to{transform:rotate(360deg)}}
.closed-title{font-size:1.45rem;font-weight:700;color:var(--text);letter-spacing:-.01em}
.closed-reason{font-size:.88rem;color:var(--muted);max-width:22rem;line-height:1.7}
.closed-countdown{
  display:flex;flex-direction:column;align-items:center;gap:.15rem;
  margin-top:.9rem;padding:.7rem 1.6rem;border-radius:var(--radius);
  background:rgba(255,255,255,.03);border:1px solid var(--line);
}
.closed-countdown[hidden]{display:none}
.closed-countdown-label{font-size:.68rem;color:var(--muted-2)}
.closed-countdown-time{font-size:1.35rem;font-weight:700;color:var(--gold);font-variant-numeric:tabular-nums;letter-spacing:.06em}
.closed-actions{display:flex;flex-direction:column;gap:.6rem;width:100%;max-width:19rem;margin-top:1.3rem}
.closed-login-btn{display:flex;justify-content:center;align-items:center;text-decoration:none;font-size:.92rem}
.closed-actions .btn-secondary{font-size:.85rem;padding:.8rem}
.closed-note{font-size:.68rem;color:var(--muted-2);margin-top:1rem}

/* ---------- Password checklist ---------- */
.pass-checklist{display:grid;grid-template-columns:1fr 1fr;gap:.35rem .8rem;margin-top:.65rem;padding:0;list-style:none}
.pass-checklist li{
  display:flex;align-items:center;gap:.45rem;
  font-size:.7rem;color:var(--muted-2);
  transition:color var(--speed-normal);
}
.rule-dot{
  width:.85rem;height:.85rem;border-radius:50%;flex-shrink:0;
  border:1.5px solid var(--muted-2);position:relative;
  transition:border-color var(--speed-normal),background var(--speed-normal);
}
.pass-checklist li.ok{color:#86efac}
.pass-checklist li.ok .rule-dot{border-color:var(--success);background:var(--success)}
.pass-checklist li.ok .rule-dot::after{
  content:'';position:absolute;inset:0;
  background:center/60% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23071120' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
}

/* ---------- Secure note ---------- */
.secure-note{
  display:flex;justify-content:center;align-items:center;gap:.35rem;
  margin-top:1rem;font-size:.68rem;color:var(--muted-2);
}
.secure-note svg{color:var(--success);opacity:.8}

.password-toggle{
  position:absolute;left:1rem;top:1.05rem;z-index:10;
  display:grid;place-items:center;width:1.5rem;height:1.5rem;
  color:var(--muted);border-radius:var(--radius-sm);
  transition:color var(--speed-fast),background var(--speed-fast);
}
.password-toggle:hover,.password-toggle:focus-visible{color:var(--gold);background:rgba(234,179,8,.08);outline:none}
.password-toggle svg{width:1.2rem;height:1.2rem}
.password-feedback{margin-bottom:1.25rem;padding:.8rem;border:1px solid var(--line);border-radius:var(--radius);background:rgba(255,255,255,.02)}
.password-feedback.is-weak{border-color:rgba(239,68,68,.32);background:rgba(239,68,68,.05)}
#errorMsgContainer{line-height:1.65;text-align:right}

@media (max-width:640px){
  body{align-items:flex-start;padding:.65rem;background:var(--bg)}
  .glass-panel{padding:1rem;border-radius:var(--radius);box-shadow:none;margin:0}
  .reg-title{font-size:1.45rem}
  #mainCard>.text-center{margin-bottom:1.25rem}
  #mainCard>.text-center>p{font-size:.8rem}
  .gate-badge{margin-top:.55rem}
  .progress-container{margin-bottom:1.8rem;padding:0 .2rem}
  .progress-line{left:.2rem;right:.2rem}
  .progress-dot{width:2rem;height:2rem;font-size:.75rem}
  .step-labels{margin:-1.25rem 0 1.45rem}
  .input-group,.custom-dropdown-container{margin-bottom:1.25rem}
  .floating-input{min-height:3.35rem;padding:1.1rem 2.65rem .45rem 2.65rem;font-size:.9rem}
  .floating-label{right:2.65rem;top:.9rem}
  .input-icon{right:.9rem;top:.95rem}
  .valid-check,.password-toggle{left:.9rem;top:.95rem}
  .pass-checklist{grid-template-columns:1fr;gap:.3rem;margin-top:.5rem}
  .pass-checklist li{font-size:.72rem}
  .secure-note{margin-top:.6rem}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none !important;transition:none !important}
  .animate-fade-up{opacity:1}
  .wizard-step.active{animation:none}
}

