/* ============================================
   Login Page Styles
   ============================================ */

body.login-page{
  min-height:100vh;
  min-height:100dvh;
  position:relative;
  overflow-x:hidden;
}

/* ===== الخلفية المزخرفة ===== */
.login-bg{
  position:fixed;inset:0;
  z-index:-1;
  overflow:hidden;
  pointer-events:none;
}
.bg-shape{
  position:absolute;
  border-radius:50%;
  filter:blur(80px);
  opacity:.6;
}
.shape-1{
  width:500px;height:500px;
  background:var(--cream);
  top:-200px;right:-100px;
  animation:floatGentle 8s ease-in-out infinite;
}
.shape-2{
  width:400px;height:400px;
  background:var(--cream-2);
  bottom:-100px;left:-100px;
  animation:floatGentle 10s ease-in-out infinite reverse;
}
.bg-grid{
  position:absolute;inset:0;
  background-image:
    linear-gradient(rgba(10,10,10,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10,10,10,0.025) 1px, transparent 1px);
  background-size:40px 40px;
}

/* ===== الـ Wrapper الرئيسي ===== */
.login-wrapper{
  min-height:100vh;
  min-height:100dvh;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0;
}

/* ===== العمود الأيمن: النموذج ===== */
.login-form-side{
  display:flex;
  flex-direction:column;
  padding:32px 48px;
  position:relative;
  background:var(--paper);
}

/* زر الرجوع */
.back-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  font-weight:500;
  color:var(--muted);
  padding:8px 14px;
  border-radius:var(--r-full);
  border:1px solid var(--line);
  transition:all var(--t-fast);
  align-self:flex-start;
  margin-bottom:24px;
}
.back-btn:hover{
  background:var(--cream);
  border-color:transparent;
  color:var(--ink);
}
.back-btn svg{width:14px;height:14px}

/* الشعار */
.login-brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-size:20px;
  font-weight:600;
  letter-spacing:-0.02em;
  margin-bottom:60px;
}
.login-brand .brand-mark{
  width:32px;height:32px;
  background:var(--ink);
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
}
.login-brand .brand-mark svg{width:18px;height:18px}

/* رأس الصفحة */
.login-header{margin-bottom:32px}
.login-header h1{
  font-size:32px;
  font-weight:600;
  letter-spacing:-0.025em;
  margin-bottom:8px;
  line-height:1.2;
}
.login-header p{
  font-size:15px;
  color:var(--muted);
  line-height:1.6;
}

/* النموذج */
.login-form{
  max-width:420px;
  width:100%;
}

/* رسالة التنبيه */
.alert{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  border-radius:12px;
  font-size:14px;
  margin-bottom:20px;
}
.alert svg{width:18px;height:18px;flex-shrink:0}
.alert-error{
  background:rgba(255,95,87,0.1);
  color:#cc3838;
  border:1px solid rgba(255,95,87,0.2);
}

/* الحقول */
.form-group{margin-bottom:20px}
.form-group label{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:13px;
  font-weight:500;
  margin-bottom:8px;
  color:var(--ink);
}
.forgot-link{
  font-size:12px;
  color:var(--muted);
  font-weight:400;
  transition:color var(--t-fast);
}
.forgot-link:hover{color:var(--ink);text-decoration:underline}

.input-wrap{
  position:relative;
  display:flex;
  align-items:center;
}
.input-icon{
  position:absolute;
  right:16px;
  top:50%;
  transform:translateY(-50%);
  color:var(--muted);
  display:flex;
  pointer-events:none;
  transition:color var(--t-fast);
}
.input-icon svg{width:18px;height:18px}

.input-wrap input{
  width:100%;
  padding:14px 48px 14px 16px;
  border:1px solid var(--line);
  border-radius:12px;
  font-family:inherit;
  font-size:15px;
  background:var(--paper);
  color:var(--ink);
  outline:none;
  transition:border-color var(--t-fast), background var(--t-fast);
}
.input-wrap input::placeholder{color:rgba(122,117,111,0.6)}
.input-wrap input:hover{border-color:rgba(10,10,10,0.2)}
.input-wrap input:focus{
  border-color:var(--ink);
  background:var(--paper);
}
.input-wrap:focus-within .input-icon{color:var(--ink)}

/* زر إظهار/إخفاء كلمة المرور */
.toggle-password{
  position:absolute;
  left:14px;
  top:50%;
  transform:translateY(-50%);
  width:32px;height:32px;
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  transition:background var(--t-fast), color var(--t-fast);
}
.toggle-password:hover{
  background:var(--cream);
  color:var(--ink);
}
.toggle-password svg{width:16px;height:16px}

/* صف Checkbox */
.form-row{
  margin-bottom:24px;
  display:flex;
  align-items:center;
}
.checkbox-wrap{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:14px;
  color:var(--muted);
  cursor:pointer;
  user-select:none;
}
.checkbox-wrap input{
  position:absolute;
  opacity:0;
  width:0;height:0;
}
.checkbox-mark{
  width:20px;height:20px;
  border:1.5px solid var(--line);
  border-radius:6px;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:all var(--t-fast);
  flex-shrink:0;
}
.checkbox-mark svg{
  width:12px;height:12px;
  color:var(--paper);
  opacity:0;
  transition:opacity var(--t-fast);
}
.checkbox-wrap input:checked + .checkbox-mark{
  background:var(--ink);
  border-color:var(--ink);
}
.checkbox-wrap input:checked + .checkbox-mark svg{opacity:1}
.checkbox-wrap:hover .checkbox-mark{border-color:var(--ink)}

/* زر تسجيل الدخول */
.btn-login{
  width:100%;
  background:var(--ink);
  color:var(--paper);
  padding:16px 24px;
  border-radius:12px;
  font-size:15px;
  font-weight:500;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  transition:transform var(--t-fast), box-shadow var(--t-fast);
}
.btn-login:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 30px rgba(0,0,0,0.15);
}
.btn-login:active{transform:translateY(0)}
.btn-login svg{
  width:18px;height:18px;
  transition:transform var(--t-fast);
}
.btn-login:hover svg{transform:translateX(-4px)}

/* الفاصل */
.divider{
  display:flex;
  align-items:center;
  gap:14px;
  margin:28px 0 24px;
  color:var(--muted);
  font-size:12px;
}
.divider::before,
.divider::after{
  content:"";
  flex:1;
  height:1px;
  background:var(--line);
}

/* رسالة المساعدة */
.login-help{
  text-align:center;
  font-size:13px;
  color:var(--muted);
  line-height:1.7;
}
.login-help a{
  color:var(--ink);
  font-weight:500;
  text-decoration:underline;
}

/* الفوتر */
.login-footer{
  margin-top:auto;
  padding-top:32px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:12px;
  color:var(--muted);
  flex-wrap:wrap;
  gap:16px;
}
.login-footer-links{
  display:flex;
  gap:20px;
}
.login-footer-links a{
  transition:color var(--t-fast);
}
.login-footer-links a:hover{color:var(--ink)}

/* ===== العمود الأيسر: الجانب البصري ===== */
.login-visual-side{
  background:var(--ink);
  color:var(--paper);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:48px;
  position:relative;
  overflow:hidden;
}

/* شبكة في الخلفية */
.login-visual-side::before{
  content:"";
  position:absolute;
  inset:0;
  background-image:
    linear-gradient(rgba(244,239,233,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244,239,233,0.04) 1px, transparent 1px);
  background-size:48px 48px;
}

.visual-content{
  max-width:480px;
  width:100%;
  position:relative;
  z-index:1;
}

/* الشارة العلوية */
.visual-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:rgba(244,239,233,0.08);
  border:1px solid rgba(244,239,233,0.12);
  padding:6px 14px;
  border-radius:var(--r-full);
  font-size:12px;
  color:var(--cream);
  margin-bottom:24px;
}
.pulse-dot{
  width:6px;height:6px;
  border-radius:50%;
  background:var(--success);
  animation:pulseAnim 2s infinite;
}

/* العنوان */
.visual-title{
  font-size:clamp(32px, 3.5vw, 44px);
  font-weight:500;
  line-height:1.2;
  letter-spacing:-0.025em;
  margin-bottom:16px;
}
.visual-accent{
  color:rgba(244,239,233,0.5);
  font-weight:400;
}
.visual-desc{
  font-size:15px;
  color:rgba(244,239,233,0.65);
  line-height:1.75;
  margin-bottom:48px;
  max-width:380px;
}

/* البطاقات العائمة */
.floating-cards{
  position:relative;
  height:340px;
  margin-bottom:32px;
}

.float-card{
  position:absolute;
  background:rgba(244,239,233,0.04);
  border:1px solid rgba(244,239,233,0.1);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  border-radius:16px;
  padding:18px;
  transition:transform var(--t-med);
}
.float-card:hover{
  transform:translateY(-4px);
  background:rgba(244,239,233,0.06);
}

/* بطاقة المشروع */
.card-project{
  top:0;
  right:0;
  width:280px;
  animation:floatGentle 5s ease-in-out infinite;
}
.card-head{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:16px;
}
.card-icon{
  width:36px;height:36px;
  border-radius:10px;
  background:rgba(244,239,233,0.08);
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}
.card-icon svg{width:18px;height:18px;color:var(--cream)}
.card-head strong{
  display:block;
  font-size:13px;
  font-weight:600;
  margin-bottom:2px;
}
.card-head span{
  font-size:11px;
  color:rgba(244,239,233,0.5);
}
.card-bars{
  display:flex;
  align-items:flex-end;
  gap:8px;
  height:60px;
}
.bar{
  flex:1;
  background:rgba(244,239,233,0.15);
  border-radius:4px 4px 0 0;
}
.bar.active{
  background:var(--success);
  box-shadow:0 0 16px rgba(40,201,64,0.3);
}

/* بطاقة الإشعار */
.card-notify{
  top:140px;
  left:0;
  width:240px;
  display:flex;
  align-items:center;
  gap:12px;
  animation:floatGentle 6s ease-in-out 1s infinite;
}
.notify-icon{
  width:36px;height:36px;
  border-radius:50%;
  background:var(--success);
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  box-shadow:0 0 24px rgba(40,201,64,0.3);
}
.notify-icon svg{width:16px;height:16px;color:var(--ink)}
.notify-text strong{
  display:block;
  font-size:13px;
  font-weight:600;
  margin-bottom:2px;
}
.notify-text span{
  font-size:11px;
  color:rgba(244,239,233,0.5);
}

/* بطاقة الإحصائيات */
.card-stats{
  bottom:0;
  right:40px;
  width:300px;
  animation:floatGentle 7s ease-in-out 0.5s infinite;
}
.stats-row{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:12px;
}
.stat-item{
  text-align:center;
  padding:8px;
}
.stat-num{
  font-size:22px;
  font-weight:600;
  letter-spacing:-0.02em;
  margin-bottom:4px;
}
.stat-label{
  font-size:11px;
  color:rgba(244,239,233,0.5);
}

/* النقاط */
.visual-dots{
  display:flex;
  gap:8px;
  justify-content:center;
}
.visual-dots .dot{
  width:6px;height:6px;
  border-radius:50%;
  background:rgba(244,239,233,0.2);
  transition:all var(--t-fast);
}
.visual-dots .dot.active{
  background:var(--cream);
  width:24px;
  border-radius:3px;
}


/* ============================================
   RESPONSIVE
   ============================================ */

/* تابلت */
@media (max-width: 1100px) {
  .login-form-side{padding:32px}
  .login-visual-side{padding:32px}
  .floating-cards{height:300px}
  .card-project{width:240px}
  .card-notify{width:220px}
  .card-stats{width:260px}
}

/* تابلت صغير + إخفاء الجانب البصري */
@media (max-width: 900px) {
  .login-wrapper{grid-template-columns:1fr}
  .login-visual-side{display:none}
  .login-form-side{
    padding:24px;
    max-width:520px;
    margin:0 auto;
    width:100%;
  }
  .login-form{max-width:100%}
}

/* جوال */
@media (max-width: 600px) {
  .login-form-side{padding:20px 16px}
  .back-btn{
    font-size:12px;
    padding:7px 12px;
    margin-bottom:16px;
  }
  .login-brand{
    font-size:18px;
    margin-bottom:40px;
  }
  .login-brand .brand-mark{
    width:28px;height:28px;
  }
  .login-brand .brand-mark svg{width:16px;height:16px}
  .login-header{margin-bottom:28px}
  .login-header h1{
    font-size:26px;
    margin-bottom:6px;
  }
  .login-header p{font-size:14px}

  .form-group{margin-bottom:16px}
  .form-group label{font-size:12px}
  .input-wrap input{
    padding:13px 44px 13px 14px;
    font-size:15px; /* لازم 16px على الأقل عشان iOS ما يزووم */
    font-size:max(16px, 15px);
  }
  .input-icon{right:14px}
  .input-icon svg{width:16px;height:16px}
  .toggle-password{
    left:10px;
    width:28px;height:28px;
  }

  .form-row{margin-bottom:20px}
  .checkbox-wrap{font-size:13px}
  .checkbox-mark{width:18px;height:18px}

  .btn-login{
    padding:14px 20px;
    font-size:14px;
  }
  .btn-login svg{width:16px;height:16px}

  .divider{margin:24px 0 20px;font-size:11px}

  .login-help{font-size:12px}

  .login-footer{
    padding-top:24px;
    flex-direction:column;
    text-align:center;
    gap:12px;
    font-size:11px;
  }
  .login-footer-links{gap:14px}
}

/* جوال صغير جداً */
@media (max-width: 380px) {
  .login-form-side{padding:16px 14px}
  .login-header h1{font-size:22px}
  .input-wrap input{padding:12px 42px 12px 14px}
}

/* Landscape phones */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  body.login-page{
    padding:16px 0;
  }
  .login-form-side{padding:16px}
  .login-brand{margin-bottom:20px}
  .login-header{margin-bottom:20px}
  .login-header h1{font-size:22px}
  .form-group{margin-bottom:14px}
  .login-footer{padding-top:20px}
}