/* a02-responsive.css (استبدل الملف القديم أو ألصقه بعده) */

/* إصلاحات أساسية لمنع أي overflow عرضي */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Amiri', serif;
  background-color: #ececec;
  direction: rtl;
  overflow-x: hidden; /* يمنع تمرير أفقي غير مرغوب */
}

/* الحاوية الآن تتكيّف مع الشاشة تمامًا */
.container {
  /* العرض = أصغر قيمة بين 420px أو عرض الشاشة مع هامش 32px */
  width: min(420px, calc(100% - 32px));
  max-width: 420px;
  margin: 0 auto;
  /* يجعل الحاوية تملأ ارتفاع الشاشة وتوسّط المحتوى رأسياً */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center; /* توسيط عمودي */
  align-items: center;
  padding: 24px;
  text-align: center;
  /* مساحة اضافية للحماية من شريط الاكشن المثبت أسفل الهواتف */
  padding-bottom: calc(env(safe-area-inset-bottom, 12px) + 24px);
}

/* شعار متجاوب */
.logo img {
  width: clamp(110px, 30vw, 260px); /* يصغر أو يكبر حسب الشاشة */
  height: auto;
  margin-bottom: 20px;
  display: block;
  max-width: 100%;
}

/* عنوان متجاوب: بدّل الحجم باتساع الشاشة */
.title {
  margin: 0 0 18px;
  color: #0f446b;
  font-size: clamp(22px, 5vw, 50px);
  line-height: 1.05;
}

/* الفورم يتوسّع لملء الحاوية بدون تجاوز */
.form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* الحقول */
.input-group input {
  width: 100%;
  padding: 14px;
  font-size: clamp(15px, 3.6vw, 16px);
  border: none;
  background-color: #ffffff;
  border-radius: 14px;
  text-align: right;
  font-weight: bold;
  color: #444;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.25s ease;
}
.input-group input:focus {
  outline: none;
  box-shadow: 0 6px 14px rgba(0, 77, 179, 0.18);
}
.input-group input::placeholder {
  color: #777;
  font-weight: bold;
}

/* رابط نسيت كلمة المرور */
.forgot-password {
  font-size: clamp(13px, 3vw, 14px);
  color: #777;
  margin: -4px 0 8px;
  line-height: 1.4;
}
.forgot-password a {
  color: #004db3;
  font-weight: bold;
  font-size: clamp(14px, 3.5vw, 15px);
  text-decoration: none;
}

/* أزرار */
.submit-btn {
  width: 100%;
  background-color: #0f446b;
  color: white;
  border: none;
  border-radius: 18px;
  padding: 12px;
  font-size: clamp(18px, 4vw, 24px);
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease;
}
.submit-btn:hover { transform: translateY(-2px); }

.submit2-btn {
  color: #dca200;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: clamp(16px, 4vw, 20px);
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.12s ease;
  background: transparent;
}
.submit2-btn:hover { transform: translateY(-2px); }

/* رسالة عائمة */
.message-box {
  position: fixed;
  left: 12px;
  right: 12px;
  top: 20px;
  max-width: calc(100% - 24px);
  margin: 0 auto;
  background-color: #004db3;
  color: white;
  font-size: 18px;
  font-weight: bold;
  padding: 12px 16px;
  border-radius: 12px;
  text-align: center;
  z-index: 9999;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: opacity 0.35s ease, transform 0.25s ease;
}
.message-box.success { background-color: #008118; }
.message-box.error { background-color: #d80000; }
.message-box.hidden { opacity: 0; pointer-events: none; transform: translateY(-8px); }
.message-box.show { opacity: 1; transform: translateY(0); }

/* سبنر تحميل */
.submit-btn.loading { position: relative; color: transparent; pointer-events: none; }
.submit-btn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 3px solid white;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* bottom-cta: ترتيب أفقي مرن (يتغير في الموبايل بواسطة الميديا كويري أدناه) */
.bottom-cta {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* زر احترافي لشرح التسجيل */
.cta-howto {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  font-weight: 800;
  font-size: clamp(15px, 3.5vw, 18px);
  border-radius: 14px;
  border: none;
  cursor: pointer;
  direction: rtl;
  color: #ffffff;
  background: linear-gradient(90deg, #f6b042 0%, #d77400 60%);
  box-shadow: 0 10px 30px rgba(215, 116, 0, 0.18), 0 2px 6px rgba(0,0,0,0.06);
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.cta-howto .cta-icon { display:inline-flex; align-items:center; justify-content:center; }
.cta-howto svg { width: 20px; height: 20px; stroke: rgba(255,255,255,0.98); fill: none; }

/* hover / active / focus */
.cta-howto:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(215,116,0,0.22); }
.cta-howto:active { transform: translateY(-1px) scale(0.998); }
.cta-howto:focus { outline: none; box-shadow: 0 0 0 5px rgba(15,68,107,0.08); }

/* bottom-cta عائم على شاشات صغيرة */
@media (max-width: 900px) {
  .bottom-cta {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: env(safe-area-inset-bottom, 12px);
    z-index: 999;
    padding: 10px;
    border-radius: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    background: #ececec;
    backdrop-filter: blur(6px);
    flex-direction: row;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  }

  .bottom-cta .new-user-text { color: #828282; font-size: 14px; margin: 0; }
  .bottom-cta .submit2-btn {
    padding: 10px 14px;
    font-size: 18px;
    border-radius: 10px;
  }

  /* نزيل ارتفاع كافٍ أسفل الفورم حتى لا يخفي الشريط الثابت محتوى */
  .form { padding-bottom: 110px; }
}

/* الشاشات الكبيرة */
@media (min-width: 901px) {
  .bottom-cta {
    position: static;
    flex-direction: column;
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin-top: 6px;
  }
  .form { padding-bottom: 0; }
}
