/* ═══════════════════════════════════════════════════════
   الجسر الرقمي — Auth Pages Shared Styles
   الهوية البصرية: كحلي عميق + ذهب معدني
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;900&family=Plus+Jakarta+Sans:wght@500;700;800&display=swap');

:root {
  --void:  #030810;
  --d1:    #050C1A;
  --d2:    #080F1C;
  --d3:    #0A111E;
  --d4:    #0F1929;
  --d5:    #132237;

  --gold:  #D4AF37;
  --gold2: #E8C547;
  --gold3: #F9E7B9;
  --goldd: #9A7B33;
  --goldx: #7A5E20;

  --t1: #FFFFFF;
  --t2: #C8DAEA;
  --t3: #7A95B0;
  --t4: #3A5570;

  --green: #22c55e;
  --red:   #ef4444;

  --bdr:  rgba(212,175,55,.12);
  --bdr2: rgba(212,175,55,.25);
  --bdr3: rgba(212,175,55,.4);

  --gm: linear-gradient(135deg,#7A5E20 0%,#C5A050 30%,#F9E7B9 55%,#C5A050 78%,#7A5E20 100%);
  --gt: linear-gradient(135deg,#A37A3E 0%,#E8C86B 45%,#F9E7B9 55%,#E8C86B 65%,#A37A3E 100%);
  --gs: linear-gradient(90deg,#9A7B33 0%,#D4AF37 40%,#F2D96B 55%,#D4AF37 70%,#9A7B33 100%);
}

@keyframes shimmer { 0%{background-position:-200% center} 100%{background-position:200% center} }
@keyframes fadeUp  { from{opacity:0;transform:translateY(22px)} to{opacity:1;transform:none} }
@keyframes float   { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
@keyframes glow    { 0%,100%{opacity:.5} 50%{opacity:1} }
@keyframes spin    { to{transform:rotate(360deg)} }
@keyframes slideIn { from{opacity:0;transform:translateX(-10px)} to{opacity:1;transform:none} }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--void);
  color: var(--t2);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ── خلفية ──────────────────────────────────────────── */
.auth-bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(212,175,55,.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 90% 80%, rgba(212,175,55,.04) 0%, transparent 50%),
    var(--void);
}
.auth-bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(212,175,55,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,175,55,.025) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 20%, transparent 75%);
}

/* ── الصفحة ──────────────────────────────────────────── */
.auth-page {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* ── الشعار ──────────────────────────────────────────── */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-bottom: 28px;
  animation: fadeUp .5s ease both;
}
.auth-logo-ico {
  width: 52px; height: 52px;
  border-radius: 15px;
  background: var(--gm); background-size: 200%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: 0 8px 28px rgba(212,175,55,.3);
  animation: shimmer 3s linear infinite, float 5s ease-in-out infinite;
}
.auth-logo-name {
  font-size: 1.3rem; font-weight: 900;
  background: var(--gt); background-size: 200%;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; animation: shimmer 4s linear infinite;
}
.auth-logo-sub {
  font-size: .62rem; color: var(--t4);
  -webkit-text-fill-color: var(--t4);
  letter-spacing: .1em; margin-top: 2px;
}

/* ── البطاقة ──────────────────────────────────────────── */
.auth-card {
  width: 100%; max-width: 460px;
  background: rgba(8, 15, 28, 0.9);
  border: 1px solid var(--bdr2);
  border-radius: 24px;
  padding: 36px;
  box-shadow:
    0 0 80px rgba(212,175,55,.08),
    0 40px 80px rgba(0,0,0,.6),
    inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  animation: fadeUp .5s ease .1s both;
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--gm); background-size: 200%;
  animation: shimmer 3s linear infinite;
}
.auth-card::after {
  content: '';
  position: absolute; top: -80px; right: -80px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,55,.06) 0%, transparent 70%);
  pointer-events: none;
}

/* ── رأس البطاقة ──────────────────────────────────────── */
.auth-head {
  text-align: center;
  margin-bottom: 28px;
}
.auth-head h1 {
  font-size: 1.6rem; font-weight: 900; color: var(--t1);
  margin-bottom: 6px; letter-spacing: -0.01em;
}
.auth-head p { font-size: .88rem; color: var(--t3); }
.auth-divider {
  width: 48px; height: 2px;
  background: var(--gs); background-size: 200%;
  animation: shimmer 3s linear infinite;
  margin: 12px auto 0; border-radius: 2px;
}

/* ── التنبيهات ────────────────────────────────────────── */
.auth-alert {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-size: .84rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn .3s ease both;
}
.auth-alert.error   { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.25);  color: #fca5a5; }
.auth-alert.success { background: rgba(34,197,94,.1);  border: 1px solid rgba(34,197,94,.25);  color: #86efac; }
.auth-alert.warning { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.25); color: #fcd34d; }

/* ── حقول الإدخال ─────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8rem;
  font-weight: 700;
  color: var(--t3);
  margin-bottom: 7px;
}
.form-label a { color: var(--gold); font-size: .76rem; text-decoration: none; transition: .2s; }
.form-label a:hover { color: var(--gold2); }
.req { color: var(--gold); }

.input-wrap { position: relative; }

.form-input {
  width: 100%;
  padding: 13px 16px 13px 46px;
  background: rgba(212,175,55,.04);
  border: 1px solid var(--bdr);
  border-radius: 12px;
  color: var(--t1);
  font-family: 'Tajawal', sans-serif;
  font-size: .9rem;
  transition: all .25s;
  outline: none;
  appearance: none;
}
.form-input:focus {
  border-color: rgba(212,175,55,.5);
  background: rgba(212,175,55,.07);
  box-shadow: 0 0 0 3px rgba(212,175,55,.1);
}
.form-input:hover:not(:focus) { border-color: var(--bdr2); }
.form-input::placeholder { color: var(--t4); }
.form-input.error { border-color: rgba(239,68,68,.4); }

.input-ico {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--goldd); font-size: .9rem;
  pointer-events: none;
}
.input-eye {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--t4); cursor: pointer;
  font-size: .88rem; padding: 4px;
  transition: color .2s;
}
.input-eye:hover { color: var(--gold2); }

/* ── الخيارات ─────────────────────────────────────────── */
.form-opts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.remember-label {
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; color: var(--t3); cursor: pointer;
}
.remember-label input {
  width: 16px; height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}

/* ── الزر الرئيسي ─────────────────────────────────────── */
.btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--gm); background-size: 200%;
  border: none; border-radius: 50px;
  color: #0A0800;
  font-family: 'Tajawal', sans-serif;
  font-weight: 700; font-size: .95rem;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(212,175,55,.3);
  animation: shimmer 3s linear infinite;
  transition: all .25s;
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(212,175,55,.5);
}
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled {
  opacity: .6; cursor: not-allowed; transform: none;
}
.btn-submit .spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(0,0,0,.3);
  border-top-color: #0A0800;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-text { display: none; }

/* ── الفاصل ──────────────────────────────────────────── */
.or-sep {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--t4); font-size: .78rem;
}
.or-sep::before, .or-sep::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,.15), transparent);
}

/* ── أزرار المصادقة الاجتماعية ─────────────────────────── */
.social-btns { display: flex; gap: 12px; margin-bottom: 4px; }
.social-btn {
  flex: 1; padding: 11px;
  border-radius: 12px;
  border: 1px solid var(--bdr);
  background: rgba(255,255,255,.03);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; font-family: 'Tajawal', sans-serif;
  font-size: .82rem; font-weight: 700; color: var(--t2);
  text-decoration: none;
  transition: all .25s;
}
.social-btn:hover {
  border-color: var(--bdr2);
  background: rgba(212,175,55,.06);
  transform: translateY(-2px);
}

/* ── رابط الدعم ────────────────────────────────────────── */
.support-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--bdr);
  background: rgba(255,255,255,.02);
  margin-top: 16px;
  text-decoration: none; color: inherit;
  transition: .2s;
}
.support-link:hover { border-color: var(--bdr2); background: rgba(212,175,55,.04); }
.support-title { font-size: .8rem; font-weight: 700; color: var(--t1); margin-bottom: 2px; }
.support-sub   { font-size: .72rem; color: var(--t4); }

/* ── رابط التسجيل ──────────────────────────────────────── */
.auth-footer-link {
  text-align: center;
  margin-top: 20px;
  font-size: .84rem; color: var(--t3);
  animation: fadeUp .5s ease .3s both;
}
.auth-footer-link a {
  color: var(--gold); font-weight: 700;
  text-decoration: none; transition: color .2s;
}
.auth-footer-link a:hover { color: var(--gold2); }

/* ── شريط التقدم (خطوات التسجيل) ──────────────────────── */
.steps-bar {
  display: flex; align-items: center;
  gap: 0; margin-bottom: 28px;
  animation: fadeUp .5s ease .15s both;
}
.step-item {
  flex: 1; display: flex; align-items: center; gap: 0;
}
.step-dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; flex-shrink: 0;
  transition: .3s;
}
.step-dot.done {
  background: var(--gm); background-size: 200%;
  color: #0A0800; animation: shimmer 3s linear infinite;
  box-shadow: 0 4px 12px rgba(212,175,55,.3);
}
.step-dot.active {
  background: rgba(212,175,55,.15);
  border: 2px solid var(--gold);
  color: var(--gold); animation: glow 2s ease-in-out infinite;
}
.step-dot.pending {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(212,175,55,.15);
  color: var(--t4);
}
.step-line {
  flex: 1; height: 2px;
  background: rgba(212,175,55,.1);
  transition: .5s;
}
.step-line.done { background: var(--gs); background-size: 200%; animation: shimmer 3s linear infinite; }
.step-lbl { font-size: .65rem; color: var(--t4); text-align: center; margin-top: 6px; }

/* ── شريط قوة كلمة المرور ─────────────────────────────── */
.password-strength { margin-top: 8px; }
.ps-bar {
  height: 3px; border-radius: 3px;
  background: rgba(255,255,255,.06); overflow: hidden;
}
.ps-fill { height: 100%; border-radius: 3px; transition: all .4s; }
.ps-text { font-size: .7rem; margin-top: 5px; font-weight: 600; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-card { padding: 26px 20px; border-radius: 20px; }
  .auth-head h1 { font-size: 1.4rem; }
  .social-btns { flex-direction: column; }
}
