@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;700;800&display=swap');

/* ========================================= */
/* 🎨 VARIABLES & BASE STYLING (الأنماط الأساسية والمتغيرات) */
/* ========================================= */

:root {
    /* تم إضافة متغيرات مفقودة لضمان عمل الكود بشكل صحيح */
    --custom-background-image: none;
    --bg-color: #f0f4f8;
    --text-dark: #224231;
    --accent-green: #38b000;
    --accent-highlight: #70c465;
    --glass-bg: rgba(255, 255, 255, 0.2);
    --border-color: rgba(56, 176, 0, 0.4);
    --input-bg: rgba(255, 255, 255, 0.2);
    --shadow-light: rgba(255, 255, 255, 0.8);
    --shadow-dark: rgba(0, 0, 0, 0.15);
  --accent-green-rgb: 56, 176, 0; 
  --accent-highlight-rgb: 112, 196, 101; 
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Poppins', sans-serif;
  color: var(--text-dark);
  overflow: hidden; 
  min-height: 100vh;
  display: flex; 
  justify-content: center;
  align-items: center;
  position: relative;
  
  /* تطبيق الخلفية المخصصة */
  background: var(--bg-color);
  background-image: var(--custom-background-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}


/* ========================================= */
/* ✨ LIQUID ORBS & BACKGROUND (خلفيات بديلة) */
/* ========================================= */

.liquid-orbs {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; list-style: none; z-index: 1;
  filter: blur(100px); 
}

.liquid-orbs li {
  position: absolute; display: block; list-style: none; width: 200px; height: 200px;
  background: rgba(56, 176, 0, 0.3); animation: animateOrbs 25s linear infinite; bottom: -250px; border-radius: 50%;
}

.liquid-orbs li:nth-child(1){ left: 25%; animation-delay: 0s; } .liquid-orbs li:nth-child(2){ left: 10%; width: 150px; height: 150px; animation-delay: 2s; animation-duration: 12s; }
.liquid-orbs li:nth-child(3){ left: 70%; width: 250px; height: 250px; animation-delay: 4s; } .liquid-orbs li:nth-child(4){ left: 40%; width: 100px; height: 100px; animation-delay: 0s; animation-duration: 18s; background: rgba(112, 196, 101, 0.4); }
.liquid-orbs li:nth-child(5){ left: 65%; width: 180px; height: 180px; animation-delay: 6s; background: rgba(56, 176, 0, 0.5); }

@keyframes animateOrbs {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; border-radius: 50%; } 100% { transform: translateY(-1000px) rotate(720deg); opacity: 0; border-radius: 20%; }
}

.background {
  position: fixed; inset: -50px; background: radial-gradient(circle at 20% 30%, rgba(56,176,0,0.05), transparent 60%), radial-gradient(circle at 75% 80%, rgba(112,196,101,0.05), transparent 60%); 
  animation: moveGlow 15s ease-in-out infinite alternate; z-index: 0; filter: none; 
}
@keyframes moveGlow { 0% { transform: translate(0, 0); } 100% { transform: translate(10%, 10%); } }


/* ========================================= */
/* 💎 LOGIN CONTAINER (بطاقة الزجاج السائل) */
/* ========================================= */

.login-page { z-index: 10; padding: 20px; max-width: 450px; width: 100%; }

.login-container {
  background: var(--glass-bg);
  backdrop-filter: blur(40px) saturate(200%) contrast(110%); 
  border-radius: 35px;
  border: 1px solid var(--border-color);
  box-shadow: 
    0 15px 45px var(--shadow-dark), 
    inset 0 0 0 2px var(--shadow-light), 
    0 0 0 15px rgba(255, 255, 255, 0.05); 
  padding: 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* ========================================= */
/* 🟢 FORM TOGGLE BUTTONS (أزرار التبديل الزجاجية) */
/* ========================================= */

.form-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  position: relative;
  background: rgba(255, 255, 255, 0.1); 
  border-radius: 25px;
  padding: 3px; 
  box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
  border: 1px solid rgba(255, 255, 255, 0.4); 
}
.form-toggle button {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: rgba(255, 255, 255, 0.05); 
  color: var(--text-dark);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 22px; 
  transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  position: relative;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.form-toggle button:hover:not(.active) {
  background: rgba(255, 255, 255, 0.3); 
}

.form-toggle button.active {
  color: rgb(0, 0, 0); 
  background: linear-gradient(135deg, var(--accent-green) 10%, var(--accent-highlight) 90%);
  box-shadow: 0 6px 20px rgba(56, 176, 0, 0.4), 
        inset 0 0 8px rgba(255, 255, 255, 0.6); 
}


/* ========================================= */
/* 📝 FORM ELEMENTS (عناصر النموذج) */
/* ========================================= */

.login-form, .signup-form {
  display: none; 
  flex-direction: column;
  gap: 20px;
}
.login-form.active-form, .signup-form.active-form {
  display: flex;
}
.login-form h2, .signup-form h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 25px;
  color: var(--text-dark);
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border-radius: 15px;
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.5); 
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}
.input-group span {
  color: var(--accent-green);
  margin-right: 10px;
  font-size: 24px;
}
.input-group input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 16px;
  color: var(--text-dark);
  padding: 5px 0;
  outline: none; 
}
.input-group input::placeholder {
  color: rgba(34, 66, 49, 0.6);
}

.btn-submit {
  padding: 15px;
  border: none;
  border-radius: 15px;
  font-size: 18px;
  font-weight: 700;
  color: rgb(0, 0, 0); 
  background: linear-gradient(45deg, var(--accent-green) 30%, var(--accent-highlight));
  box-shadow: 0 10px 30px rgba(56, 176, 0, 0.6);
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  margin-top: 20px;
}
.btn-submit:hover {
  transform: translateY(-4px); 
  box-shadow: 0 15px 40px rgba(56, 176, 0, 0.8);
}

.forgot-password, .terms a {
  color: var(--accent-green);
  text-decoration: none;
  font-size: 14px;
  margin-top: 15px;
  transition: color 0.2s;
}
.forgot-password:hover, .terms a:hover {
  color: var(--text-dark);
}
.terms {
  font-size: 13px;
  color: rgba(34, 66, 49, 0.7);
  margin-top: 20px;
}

/* ========================================= */
/* ✨ GLASS SCENERY BACKGROUND (خلفية المجسمات البلورية) */
/* ========================================= */

.glass-scenery {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden; 
  display: block; 
  
  /* حركة خلفية خفيفة جداً للمشهد ككل */
  animation: moveScenery 20s ease-in-out infinite alternate;
}

/* الأشكال الأساسية (جبال، أشجار، فقاعات) */
.glass-scenery div {
  position: absolute;
  background: linear-gradient(135deg, rgba(var(--accent-green-rgb), 0.3), rgba(var(--accent-highlight-rgb), 0.2));
  backdrop-filter: blur(40px); 
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  opacity: 0.7; 
  transform-origin: center center;
  animation-duration: 15s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
  animation-direction: alternate;
}

/* الجبال البلورية */
.mountain {
  width: 300px;
  height: 300px;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0; 
  transform: rotate(45deg); 
}
.mountain-1 {
  left: -80px;
  bottom: -150px;
  width: 450px; height: 450px;
  background: linear-gradient(135deg, rgba(var(--accent-green-rgb), 0.4), rgba(var(--accent-highlight-rgb), 0.3));
  backdrop-filter: blur(50px) saturate(150%);
  animation-name: floatMountain1;
}
.mountain-2 {
  right: -100px;
  top: -100px;
  width: 350px; height: 350px;
  background: linear-gradient(45deg, rgba(var(--accent-highlight-rgb), 0.3), rgba(var(--accent-green-rgb), 0.2));
  backdrop-filter: blur(60px) saturate(180%);
  animation-name: floatMountain2;
}

/* الأشجار البلورية */
.tree {
  width: 150px;
  height: 250px;
  border-radius: 50%; 
  transform: scaleY(1.5); 
  background: linear-gradient(to top, rgba(var(--accent-green-rgb), 0.2), rgba(var(--accent-highlight-rgb), 0.1));
  backdrop-filter: blur(30px);
  opacity: 0.6;
}
.tree-1 {
  left: 20%;
  bottom: -100px;
  animation-name: floatTree1;
  animation-delay: 2s;
}
.tree-2 {
  right: 30%;
  top: 50px;
  transform: scaleY(1.2) rotate(10deg);
  animation-name: floatTree2;
  animation-delay: 4s;
}

/* الفقاعات البلورية الإضافية */
.orb {
  border-radius: 50%;
  backdrop-filter: blur(30px) saturate(120%);
  opacity: 0.5;
}
.orb-small {
  left: 10%; top: 10%; width: 80px; height: 80px;
  background: rgba(var(--accent-highlight-rgb), 0.2);
  animation-name: floatOrbSmall;
  animation-delay: 1s;
}
.orb-large {
  right: 5%; bottom: 20%; width: 120px; height: 120px;
  background: rgba(var(--accent-green-rgb), 0.15);
  animation-name: floatOrbLarge;
  animation-delay: 3s;
}

/* حركات العناصر الفردية */
@keyframes moveScenery {
  0% { transform: translate(0, 0); }
  100% { transform: translate(5%, 5%); }
}
@keyframes floatMountain1 {
  0%, 100% { transform: translate(0, 0) rotate(45deg); }
  50% { transform: translate(-10px, 20px) rotate(47deg); }
}
@keyframes floatMountain2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(15px, -10px); }
}
@keyframes floatTree1 {
  0%, 100% { transform: translate(0, 0) scaleY(1.5); }
  50% { transform: translate(10px, -5px) scaleY(1.55); }
}
@keyframes floatTree2 {
  0%, 100% { transform: translate(0, 0) scaleY(1.2) rotate(10deg); }
  50% { transform: translate(-8px, 12px) scaleY(1.18) rotate(12deg); }
}
@keyframes floatOrbSmall {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(10px, 15px); }
}
@keyframes floatOrbLarge {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-12px, -8px); }
}

/* الخلفية الرئيسية الشفافة (تبقى فارغة لتعتمد على .glass-scenery) */
.background {
  display: none; 
}

/* ========================================= */
/* 🧭 NEW HEADER & NAVIGATION (ترويسة الموقع المُصححة) */
/* ========================================= */

.new-header {
  position: absolute;
    top: 0;
    left: 0;
    width: 100%;
  z-index: 10;
  display: flex;
  justify-content: flex-start; 
  align-items: center;
  padding: 20px 40px;
}

.new-header .brand { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.new-header .logo { 
    font-size: 32px; 
    color: var(--accent-green); 
    margin: 0; 
} 

.new-header h1 { 
    font-weight: 800; 
    font-size: 24px; 
    letter-spacing: 0.5px; 
    color: var(--text-dark);
    margin: 0; 
}

/* ========================================= */
/* 🔄 GLASS LOADING OVERLAY (طبقة التحميل البلورية) */
/* ========================================= */

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20; /* أعلى من كل شيء داخل البطاقة */
    
    /* تأثير الـ Glassmorphism للودينغ */
    background: rgba(255, 255, 255, 0.1); 
    backdrop-filter: blur(15px); /* بلورية خفيفة */
    border-radius: 35px; /* نفس حواف البطاقة الأم */

    display: none; /* إخفاء افتراضي */
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
    
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.visible {
    opacity: 1;
    visibility: visible;
    display: flex; 
}

.loading-overlay p {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
}

/* 🟢 تصميم اللودر الدوار (Loader Spinner) */
.loader {
    border: 5px solid rgba(var(--accent-green-rgb), 0.3);
    border-top: 5px solid var(--accent-green);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}







/* ========================================= */
/* 📱 MEDIA QUERIES (التجاوبية) */
/* ========================================= */

@media (max-width: 500px) {
  .login-container {
    padding: 30px;
    margin: 0 20px;
  }
  .login-form h2, .signup-form h2 {
    font-size: 24px;
  }
}