
/* =======================
   Overlay & Form Container
======================= */
.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(10, 10, 10, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 1000;
}

.overlay.active {
  display: flex;
  animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.form-container {
  background: rgba(10, 10, 10, 0.5);
  height: auto;
  border-radius: 20px;
  width: 100%;
  max-width: 450px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: slideUp 0.4s ease;
    max-height: 95vh;   /* أقصى ارتفاع (80% من الشاشة) */
  overflow-y: auto;   /* يضيف سكرول عمودي لو المحتوى زاد */
}
.form-container::-webkit-scrollbar {
  width: 8px;
}

.form-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1); 
  border-radius: 10px;
}

.form-container::-webkit-scrollbar-thumb {
  background: rgba(26, 177, 223, 0.6);      /* لون السهم نفسه */
    border-radius: 10px;                    /* تقوس الزوايا للسهم */
    border: 2px solid rgba(0,0,0,0.3);     /* مسافة بين السهم والحواف */
}

.form-container::-webkit-scrollbar-thumb:hover {
   background: rgba(26, 177, 223, 0.6);      /* لون عند المرور عليه */
}
/* تنسيق الحقول عند ملئها تلقائيًا */
input:-webkit-autofill,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0px 1000px rgba(0, 0, 0, 0.7) inset; /* يغيّر لون الخلفية */
  -webkit-text-fill-color: #ffffff; /* يغيّر لون الكتابة */
  transition: background-color 5000s ease-in-out; /* يمنع الرجوع للون الأصفر */
}

/* لمتصفحات أخرى ممكن تجرب */
input:-moz-autofill {
  box-shadow: 0 0 0px 1000px rgba(0, 0, 0, 0.7) inset;
  -moz-text-fill-color: #ffffff;
}

@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* =======================
   Header
======================= */
.form-header {
  background: rgba(10, 10, 10, 0.6);
  color: #fff;
  padding: 10px;
  position: relative;
  text-align: center;
}

.form-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.form-header p {
  margin-top: 5px;
  font-size: 0.7rem;
  opacity: 0.9;
}

.close-btn {
  position: absolute;
  top: 15px; left: 15px;
  cursor: pointer;
  font-size: 1.2rem;
  color: #fff;
  transition: var(--transition);
  background: rgba(255, 0, 0, 0.6);
  width: 30px;
            height: 30px;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            transition: all 0.3s ease;
}

  .close-btn:hover {
            background: rgba(255, 0, 0, 0.9);
            transform: rotate(90deg);
        }

/* =======================
   Body & Inputs
======================= */
.form-body {
  padding: 15px;
}

.input-group {
  margin-bottom: 12px;
  position: relative;
}

.input-field {
  width: 100%;
  padding: 12px 15px;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  direction: rtl;

}

.input-field:focus {
  border-color: rgba(56, 159, 207, 0.6);
  box-shadow: 0 0 5px rgba(0,119,182,0.3);
  color: #ffffff;

}

/* phone split */
.phone-group {
  display: flex;
  gap: 10px;
}

.country-code{
  flex: 1;
}
.phone-number{
  flex: 3;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 12px;
}
input::placeholder {
  color: #ffffff;  /* لون الـ placeholder */
  opacity: 1;   /* علشان بعض المتصفحات بتخليها باهتة */
}
  .form-links {
            display: flex;
            justify-content: space-between;
            margin-bottom: 15px;
        }
        
        .form-links a {
            color: #ffffff;
            text-decoration: none;
            font-size: 14px;
            transition: all 0.3s ease;
        }
        
        .form-links a:hover {
            color: #2282d1;
            text-decoration: underline;
        }
/* الحالة عند وجود خطأ */
.input-field.error {
    border-color: #ff4d4f; /* أحمر */
}
.error-message {
  font-size: 0.9rem;
  color: rgba(255, 0, 0, 0.8);
  margin-top: 3px;
  
}

.success-message {
  background: rgba(30, 253, 0, 0.7);
  color: #fff;
  padding: 10px;
  border-radius: 12px;
  margin-top: 10px;
  display: none;
}

.success-message.show {
  display: block;
  animation: fadeIn 0.4s ease;
}

/* =======================
   Password Toggle
======================= */
.password-group {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: rgba(0, 0, 0, 0.7);
}

/* =======================
   Terms
======================= */
.terms {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  font-size: 0.9rem;
}

.terms a {
  color: var(--primary);
  text-decoration: none;
}

.terms a:hover {
  text-decoration: underline;
}

    .submit-btn {
            background:  rgba(0, 0, 0, 0.7);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.7);
            padding: 15px;
            border-radius: 12px;
            width: 100%;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        
        .submit-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(37, 117, 252, 0.3);
        }

/* =======================
   Modal (الشروط والأحكام)
======================= */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 1100;
}

.modal.active { display: flex; }

.modal-content {
  background: rgba(0, 0, 0, 0.9);
  padding: 20px;
  border-radius:15px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: slideUp 0.4s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
  text-align: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.3rem;
  color:white;
}

.modal-close {
 position: absolute;
  top: 0px; left: 0px;
  cursor: pointer;
  font-size: 1.2rem;
  color: #fff;
  transition: var(--transition);
  background: rgba(255, 0, 0, 0.6);
  width: 30px;
            height: 30px;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            transition: all 0.3s ease;
}

.modal-close:hover {     background: rgba(255, 0, 0, 0.9);
            transform: rotate(90deg); }
/* للمتصفحات الحديثة (Chrome, Edge, Safari) */
.modal-content::-webkit-scrollbar {
    width: 8px;           /* عرض السكّول بار */
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);  /* لون خلفية المسار */
    border-radius: 10px;                   /* تقوس الزوايا للمسار */
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(26, 177, 223, 0.6);      /* لون السهم نفسه */
    border-radius: 10px;                    /* تقوس الزوايا للسهم */
    border: 2px solid rgba(0,0,0,0.3);     /* مسافة بين السهم والحواف */
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(26, 177, 223, 0.6);      /* لون عند المرور عليه */
}

/* للـ Firefox */
.modal-content {
    scrollbar-width: thin;                  /* حجم السكّول بار */
    scrollbar-color: rgba(26, 177, 223, 0.6) rgba(255,255,255,0.1); /* thumb و track */
}

.terms-content h3 {
  margin-top: 15px;
  font-size: 1rem;
  color: rgba(37, 183, 228, 0.6);
}

.terms-content p {
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 5px 0 15px;
}


/* =======================
   Responsive
======================= */
@media (max-width: 480px) {
  .form-container { max-width: 100%; }
  .modal-content { max-width: 100%; }
}
.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    z-index: 9999;
    pointer-events: none;
    transition: all 0.3s ease;
      justify-content: center;

}

.popup.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.popup.hide {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

.popup.success { background-color: #2ed573; }
.popup.error { background-color: #ff4757; }
.popup.warning { background-color: #ffa502; }
