/**
 * login.css — تنسيقات صفحة تسجيل الدخول
 * يستورد من: styles/theme.css (المتغيرات الأساسية)
 * القاعدة: لا تُعرِّف :root هنا — كل المتغيرات في theme.css
 */

/* ═══ Body ══════════════════════════════════════════════════ */
body {
  min-height: 100vh;
  background: #020617;
  color: #e2e8f0;
  font-family: "Inter", "Cairo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 32px 16px;
}

/* ═══ Background Layers ══════════════════════════════════════ */
.bg-grid {
  position: fixed; inset: -2px;
  background-image:
    linear-gradient(rgba(16,185,129,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,185,129,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, #000 35%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 85%);
  z-index: 0;
}

.bg-glow {
  position: fixed; top: 50%; left: 50%;
  width: 900px; height: 900px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at center, rgba(16,185,129,0.12) 0%, rgba(16,185,129,0.06) 35%, transparent 70%);
  filter: blur(20px);
  pointer-events: none; z-index: 0;
  animation: glow-pulse 8s ease-in-out infinite;
}
.bg-glow.secondary {
  top: 20%; left: 80%;
  width: 500px; height: 500px;
  background: radial-gradient(circle at center, rgba(52,211,153,0.08) 0%, transparent 65%);
  animation-delay: -3s; animation-duration: 11s;
}
@keyframes glow-pulse {
  0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
  50%       { opacity: 1;    transform: translate(-50%, -50%) scale(1.08); }
}

.bg-particles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-particles span {
  position: absolute; bottom: -10px;
  width: 2px; height: 2px; border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981, 0 0 16px rgba(16,185,129,0.6);
  opacity: 0; animation: float-up linear infinite;
}
@keyframes float-up {
  0%   { transform: translateY(0) scale(1);     opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.8; }
  100% { transform: translateY(-110vh) scale(0.4); opacity: 0; }
}

/* ═══ Card ═══════════════════════════════════════════════════ */
.card {
  position: relative; z-index: 1;
  width: 420px; max-width: 100%;
  padding: 32px; border-radius: 24px;
  background: rgba(2,6,23,0.9);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(16,185,129,0.2);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04);
  animation: card-in 0.7s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.card::before, .card::after {
  content: ""; position: absolute;
  width: 14px; height: 14px;
  border-color: rgba(16,185,129,0.55); border-style: solid; border-width: 0;
  pointer-events: none;
}
.card::before {
  top: -1px; right: -1px;
  border-top-width: 1px; border-right-width: 1px; border-top-right-radius: 24px;
  box-shadow: 0 0 10px rgba(16,185,129,0.4);
}
.card::after {
  bottom: -1px; left: -1px;
  border-bottom-width: 1px; border-left-width: 1px; border-bottom-left-radius: 24px;
  box-shadow: 0 0 10px rgba(16,185,129,0.4);
}

/* ═══ Header ═════════════════════════════════════════════════ */
.header { text-align: center; margin-bottom: 28px; }
.icon-box {
  width: 72px; height: 72px; border-radius: 20px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px; font-size: 34px; line-height: 1; color: #022c22;
  box-shadow: 0 12px 28px rgba(16,185,129,0.35), 0 0 0 1px rgba(52,211,153,0.4) inset, 0 1px 0 rgba(255,255,255,0.25) inset;
  position: relative; animation: float 4.5s ease-in-out infinite;
}
.icon-box::after {
  content: ""; position: absolute; inset: -8px; border-radius: 24px;
  border: 1px solid rgba(16,185,129,0.25); animation: ring-pulse 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0)    rotate(0deg); }
  50%       { transform: translateY(-6px) rotate(-2deg); }
}
@keyframes ring-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1);    }
  50%       { opacity: 0;   transform: scale(1.15); }
}
.brand-title {
  margin: 0 0 6px; font-family: "Inter", sans-serif;
  font-weight: 900; font-size: 26px; letter-spacing: -0.02em;
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; direction: ltr;
}
.brand-subtitle {
  margin: 0; font-family: "Inter", sans-serif;
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.22em; color: #475569; direction: ltr;
}

/* ═══ Status Strip ═══════════════════════════════════════════ */
.status-strip {
  display: flex; align-items: center; gap: 10px;
  margin: 22px 0 18px; font-family: "Inter", sans-serif;
  font-size: 10px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: #334155; direction: ltr;
}
.status-strip .line { flex: 1; height: 1px; background: linear-gradient(to right, transparent, rgba(16,185,129,0.25), transparent); }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,0.18), 0 0 12px #10b981;
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ═══ Form Heading ═══════════════════════════════════════════ */
.form-heading { text-align: center; margin-bottom: 22px; }
.form-heading h2 {
  margin: 0 0 6px; font-family: "Cairo", "Inter", sans-serif;
  font-weight: 700; font-size: 20px; color: #f1f5f9;
}
.form-heading p { margin: 0; font-family: "Cairo", "Inter", sans-serif; font-size: 13px; color: #94a3b8; }

/* ═══ Form Inputs ════════════════════════════════════════════ */
form { display: flex; flex-direction: column; gap: 14px; }
.field { position: relative; }
.field .icon {
  position: absolute; top: 50%; right: 14px; transform: translateY(-50%);
  font-size: 16px; line-height: 1; color: #64748b;
  pointer-events: none; transition: color 0.25s ease;
}
.field input {
  width: 100%; height: 50px; padding: 0 44px 0 16px;
  border-radius: 14px; background: rgba(15,23,42,0.75);
  border: 1px solid rgba(148,163,184,0.12);
  color: #f1f5f9; font-family: "Cairo", "Inter", sans-serif;
  font-size: 15px; font-weight: 500; direction: rtl; text-align: right;
  outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.field input::placeholder { color: #475569; font-weight: 500; }
.field input:hover { border-color: rgba(148,163,184,0.22); }
.field input:focus {
  border-color: rgba(16,185,129,0.6); background: rgba(15,23,42,0.9);
  box-shadow: 0 0 0 4px rgba(16,185,129,0.12), 0 0 24px rgba(16,185,129,0.15);
}
.field input:focus ~ .icon { color: #10b981; }
.field.has-toggle input { padding-left: 44px; }

.eye-btn {
  position: absolute; top: 50%; left: 8px; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; background: transparent;
  color: #64748b; cursor: pointer; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s ease, background 0.2s ease;
}
.eye-btn:hover { color: #10b981; background: rgba(16,185,129,0.08); }
.eye-btn svg { width: 18px; height: 18px; }

/* ═══ Options Row ════════════════════════════════════════════ */
.options {
  display: flex; align-items: center; justify-content: space-between;
  margin: 2px 2px 4px; font-family: "Cairo", "Inter", sans-serif; font-size: 12.5px;
}
.remember { display: flex; align-items: center; gap: 8px; color: #94a3b8; cursor: pointer; user-select: none; }
.remember input {
  appearance: none; -webkit-appearance: none; width: 16px; height: 16px;
  border-radius: 5px; border: 1px solid rgba(148,163,184,0.3);
  background: rgba(15,23,42,0.8); cursor: pointer; position: relative; transition: all 0.15s ease;
}
.remember input:checked { background: #10b981; border-color: #10b981; }
.remember input:checked::after {
  content: ""; position: absolute; top: 2px; left: 4px;
  width: 5px; height: 8px; border: solid #022c22; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.forgot { color: #34d399; text-decoration: none; font-weight: 600; transition: color 0.2s ease; }
.forgot:hover { color: #6ee7b7; }

/* ═══ Submit Button ══════════════════════════════════════════ */
.submit {
  margin-top: 6px; height: 52px; border: 0; border-radius: 14px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #022c22; font-family: "Cairo", "Inter", sans-serif;
  font-size: 15px; font-weight: 800; letter-spacing: 0.02em;
  cursor: pointer; position: relative; overflow: hidden;
  box-shadow: 0 10px 24px rgba(16,185,129,0.3), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.submit::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  transform: translateX(120%); transition: transform 0.7s ease;
}
.submit:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(16,185,129,0.45), inset 0 1px 0 rgba(255,255,255,0.35); filter: brightness(1.05); }
.submit:hover::before { transform: translateX(-120%); }
.submit:active { transform: translateY(0); }
.submit svg { width: 16px; height: 16px; }

/* ═══ Footer ═════════════════════════════════════════════════ */
.footer { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(148,163,184,0.08); text-align: center; }
.footer a {
  font-family: "Cairo", "Inter", sans-serif; font-size: 12.5px; color: #64748b;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: color 0.2s ease;
}
.footer a:hover { color: #34d399; }
.footer a svg { width: 12px; height: 12px; }

/* ═══ Telemetry ══════════════════════════════════════════════ */
.telemetry {
  position: relative; z-index: 1; margin-top: 18px;
  display: flex; justify-content: center; gap: 22px;
  font-family: "Inter", monospace; font-size: 10px; font-weight: 500;
  letter-spacing: 0.15em; text-transform: uppercase; color: #334155; direction: ltr;
}
.telemetry span { display: inline-flex; align-items: center; gap: 6px; }
.telemetry .dot { width: 5px; height: 5px; border-radius: 50%; background: #10b981; box-shadow: 0 0 8px #10b981; }
.telemetry .dot.amber { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }

.stack { display: flex; flex-direction: column; align-items: center; gap: 0; position: relative; z-index: 1; }

/* ═══ Animations ═════════════════════════════════════════════ */
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes fadeIn  { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%, 45%, 75% { transform: translateX(-6px); }
  30%, 60% { transform: translateX(6px); }
}
.shake { animation: shake .4s ease; }
