/* Cubic ERP — صفحة تسجيل الدخول (مطابقة للتصميم) */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

:root {
  --lg-bg: #060b13;
  --lg-bg-mid: #0a1520;
  --lg-surface: #0f1a26;
  --lg-card: rgba(18, 32, 48, 0.82);
  --lg-line: rgba(0, 209, 193, 0.22);
  --lg-cyan: #00d1c1;
  --lg-cyan-2: #00b4db;
  --lg-text: #f1f7fb;
  --lg-muted: #8fa3b5;
  --lg-input: #121f2c;
  --lg-glow: rgba(0, 209, 193, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }

html, body.page-login {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Cairo', Tahoma, sans-serif;
  color: var(--lg-text);
  background: var(--lg-bg);
  direction: rtl;
}

body.page-login {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* خلفية الشبكة والتوهج */
.lg-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 20% 40%, rgba(0, 180, 200, 0.12), transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 20%, rgba(0, 209, 193, 0.08), transparent 50%),
    radial-gradient(ellipse 40% 30% at 70% 80%, rgba(26, 74, 120, 0.15), transparent 50%),
    linear-gradient(165deg, #060b13 0%, #0a1520 45%, #071018 100%);
}

.lg-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 209, 193, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 209, 193, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 40% 45%, #000 20%, transparent 75%);
}

.lg-bg::after {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  top: 15%;
  right: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 209, 193, 0.18), transparent 68%);
  filter: blur(40px);
  animation: lg-pulse 8s ease-in-out infinite;
}

@keyframes lg-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.08); }
}

.lg-layout {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 28px;
  align-items: center;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 28px 36px 20px;
}

/* ——— العمود الأيسر: الهوية ——— */
.lg-brand {
  padding: 12px 8px 12px 20px;
  min-width: 0;
}

.lg-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.lg-logo-row img {
  height: 52px;
  width: auto;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.lg-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.lg-logo-text strong {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
}

.lg-logo-text span {
  font-size: 0.68rem;
  color: var(--lg-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lg-hello {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}

.lg-title {
  margin: 0 0 14px;
  font-size: clamp(1.85rem, 3.2vw, 2.55rem);
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(100deg, #5eead4 0%, #00d1c1 40%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lg-desc {
  margin: 0 0 28px;
  max-width: 460px;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--lg-muted);
}

/* مشهد المكعب */
.lg-hero {
  position: relative;
  height: 300px;
  margin: 8px 0 28px;
  display: grid;
  place-items: center;
}

.lg-cube-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  perspective: 900px;
  z-index: 2;
}

.lg-cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: lg-cube-spin 18s linear infinite;
}

@keyframes lg-cube-spin {
  from { transform: rotateX(-18deg) rotateY(0deg); }
  to { transform: rotateX(-18deg) rotateY(360deg); }
}

.lg-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #e6fffb;
  background: linear-gradient(145deg, rgba(15, 40, 55, 0.95), rgba(8, 24, 36, 0.98));
  border: 1px solid rgba(0, 209, 193, 0.55);
  box-shadow:
    inset 0 0 40px rgba(0, 209, 193, 0.18),
    0 0 30px rgba(0, 209, 193, 0.25);
  backface-visibility: hidden;
}

.lg-face span {
  text-shadow: 0 0 18px rgba(0, 209, 193, 0.8);
}

.lg-face--front  { transform: translateZ(80px); }
.lg-face--back   { transform: rotateY(180deg) translateZ(80px); }
.lg-face--right  { transform: rotateY(90deg) translateZ(80px); }
.lg-face--left   { transform: rotateY(-90deg) translateZ(80px); }
.lg-face--top    { transform: rotateX(90deg) translateZ(80px); }
.lg-face--bottom { transform: rotateX(-90deg) translateZ(80px); }

.lg-platform {
  position: absolute;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 209, 193, 0.45), transparent 70%);
  filter: blur(4px);
  z-index: 1;
  animation: lg-glow-plat 3s ease-in-out infinite;
}

.lg-platform::before {
  content: '';
  position: absolute;
  inset: -8px -20px;
  border-radius: 50%;
  border: 1px solid rgba(0, 209, 193, 0.35);
  box-shadow: 0 0 40px rgba(0, 209, 193, 0.35);
}

@keyframes lg-glow-plat {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.lg-feat {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(12, 24, 36, 0.75);
  border: 1px solid rgba(0, 209, 193, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 16px rgba(0, 209, 193, 0.12);
  font-size: 0.78rem;
  font-weight: 700;
  color: #d7f6f2;
  white-space: nowrap;
  z-index: 3;
  animation: lg-float 5s ease-in-out infinite;
}

.lg-feat svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--lg-cyan);
}

.lg-feat--1 { top: 18px; right: 8%; animation-delay: 0s; }
.lg-feat--2 { top: 18px; left: 6%; animation-delay: -1.2s; }
.lg-feat--3 { bottom: 58px; right: 2%; animation-delay: -2.4s; }
.lg-feat--4 { bottom: 58px; left: 4%; animation-delay: -3.6s; }

@keyframes lg-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.lg-secure {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.lg-secure-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(0, 209, 193, 0.12);
  border: 1px solid rgba(0, 209, 193, 0.35);
  color: var(--lg-cyan);
  flex-shrink: 0;
}

.lg-secure-ico svg { width: 22px; height: 22px; }

.lg-secure strong {
  display: block;
  font-size: 0.88rem;
  color: #e8f7f5;
  margin-bottom: 2px;
}

.lg-secure span {
  font-size: 0.75rem;
  color: var(--lg-muted);
}

/* ——— بطاقة الدخول ——— */
.lg-panel {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}

.lg-card {
  width: min(100%, 420px);
  padding: 28px 28px 22px;
  border-radius: 22px;
  background: var(--lg-card);
  border: 1px solid rgba(0, 209, 193, 0.28);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 50px -10px var(--lg-glow);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  position: relative;
  overflow: hidden;
}

.lg-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--lg-cyan), transparent);
  opacity: 0.7;
}

.lg-lang {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.lg-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--lg-muted);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  cursor: default;
}

.lg-lang-btn svg { width: 14px; height: 14px; }

.lg-card-head {
  text-align: center;
  margin-bottom: 22px;
}

.lg-lock {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(0, 209, 193, 0.25), rgba(0, 180, 219, 0.12));
  border: 1px solid rgba(0, 209, 193, 0.45);
  box-shadow: 0 0 24px rgba(0, 209, 193, 0.25);
  color: var(--lg-cyan);
}

.lg-lock svg { width: 26px; height: 26px; }

.lg-card-head h1 {
  margin: 0 0 8px;
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
}

.lg-card-head p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--lg-muted);
  line-height: 1.55;
}

.lg-alert {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.86rem;
  line-height: 1.45;
}

.lg-alert--err {
  background: rgba(127, 29, 29, 0.4);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fecaca;
}

.lg-alert--info {
  background: rgba(14, 116, 144, 0.25);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: #cffafe;
}

.lg-form {
  display: grid;
  gap: 14px;
}

.lg-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #d5e4ee;
}

.lg-input {
  position: relative;
  display: flex;
  align-items: center;
}

.lg-input > svg {
  position: absolute;
  right: 14px;
  width: 18px;
  height: 18px;
  color: var(--lg-muted);
  pointer-events: none;
  z-index: 1;
}

.lg-input input {
  width: 100%;
  min-height: 48px;
  padding: 10px 44px 10px 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--lg-input);
  color: var(--lg-text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lg-input input::placeholder { color: #5f7385; }

.lg-input input:focus {
  border-color: rgba(0, 209, 193, 0.65);
  box-shadow: 0 0 0 3px rgba(0, 209, 193, 0.18);
}

.lg-toggle-pw {
  position: absolute;
  left: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--lg-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 8px;
  padding: 0;
}

.lg-toggle-pw:hover { color: var(--lg-cyan); }
.lg-toggle-pw svg { width: 18px; height: 18px; }

.lg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.lg-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #c5d5e0;
  cursor: pointer;
  user-select: none;
}

.lg-remember input {
  width: 16px;
  height: 16px;
  accent-color: var(--lg-cyan);
  cursor: pointer;
}

.lg-forgot {
  font-size: 0.84rem;
  color: var(--lg-cyan);
  text-decoration: none;
  font-weight: 700;
}

.lg-forgot:hover { text-decoration: underline; }

.lg-submit {
  margin-top: 4px;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  color: #041016;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(90deg, #00b4db 0%, #00d1c1 100%);
  box-shadow: 0 8px 28px rgba(0, 209, 193, 0.35);
  transition: transform 0.15s, filter 0.15s, box-shadow 0.15s;
}

.lg-submit svg { width: 20px; height: 20px; }

.lg-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 12px 32px rgba(0, 209, 193, 0.45);
}

.lg-submit:active { transform: translateY(0); }

.lg-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: var(--lg-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.lg-or::before,
.lg-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.lg-otp {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(0, 209, 193, 0.45);
  background: transparent;
  color: var(--lg-cyan);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s, box-shadow 0.15s;
}

.lg-otp svg { width: 18px; height: 18px; }

.lg-otp:hover {
  background: rgba(0, 209, 193, 0.08);
  box-shadow: 0 0 16px rgba(0, 209, 193, 0.15);
}

.lg-copy {
  margin: 16px 0 0;
  text-align: center;
  font-size: 0.72rem;
  color: #6b7f91;
  line-height: 1.5;
}

/* شريط سفلي */
.lg-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 0;
  padding: 14px 20px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(6, 11, 19, 0.65);
  backdrop-filter: blur(8px);
}

.lg-footer-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 22px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--lg-muted);
}

.lg-footer-item + .lg-footer-item {
  border-inline-start: 1px solid rgba(255, 255, 255, 0.1);
}

.lg-footer-item svg {
  width: 16px;
  height: 16px;
  color: var(--lg-cyan);
}

@media (max-width: 980px) {
  .lg-layout {
    grid-template-columns: 1fr;
    padding: 20px 18px 12px;
    gap: 18px;
  }

  .lg-brand { order: 2; padding: 0; text-align: center; }
  .lg-panel { order: 1; }
  .lg-logo-row { justify-content: center; }
  .lg-desc { margin-inline: auto; }
  .lg-secure { justify-content: center; text-align: right; }
  .lg-hero { height: 260px; margin-bottom: 16px; }
  .lg-feat { font-size: 0.72rem; padding: 6px 10px; }
  .lg-feat--1 { right: 0; }
  .lg-feat--2 { left: 0; }
  .lg-feat--3 { right: 0; }
  .lg-feat--4 { left: 0; }
}

@media (max-width: 520px) {
  .lg-card { padding: 22px 18px 18px; }
  .lg-hero { display: none; }
  .lg-secure { display: none; }
  .lg-footer-item { padding: 4px 12px; font-size: 0.72rem; }
}

@media (prefers-reduced-motion: reduce) {
  .lg-cube, .lg-feat, .lg-bg::after, .lg-platform { animation: none !important; }
}
