/* ============================================================
   1) المتغيرات (CSS Variables) — كل الألوان بمكان واحد
   ============================================================ */
:root {
  /* الأزرق الجديد تبع ميتا (تغيّر سنة 2023 من 1877F2 لهالدرجة) */
  --fb-blue: #0866ff;
  --fb-blue-dark: #0a5ae8;
  --fb-green: #42b72a;
  --fb-green-dark: #36a420;
  --bg: #f2f4f7;
  --white: #ffffff;
  --text: #080809;
  --text-muted: #65676b;
  --border: #ced0d4;
  --error: #dc3545;

  /* أنصاف أقطار موحّدة */
  --radius-card: 12px;
  --radius-input: 12px;
  --radius-pill: 999px; /* الكبسولة — أهم شكل بالتصميم الجديد */
}

/* ============================================================
   2) Reset بسيط — يلغي الهوامش الافتراضية للمتصفح
   ============================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box; /* مهم جداً: العرض يشمل الـ padding والـ border */
}

body {
  /* خط النظام الحديث — أقرب إحساس لخط "Optimistic" تبع ميتا */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  background-color: var(--white); /* التصميم الجديد خلفيتو بيضا */
  color: var(--text);
  /* الجسم عمودي: القسم الرئيسي يتمدد والفوتر ينزل تحت */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--fb-blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ============================================================
   3) القسم الرئيسي (Hero)
   ============================================================ */
.hero {
  flex: 1; /* ياخد كل المساحة الفاضية */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hero__container {
  display: flex;
  align-items: center;
  gap: 48px;
  max-width: 1000px;
  width: 100%;
}

/* ----- العمود اليساري ----- */
.hero__left {
  flex: 1;
}

/* شعار f الدايري */
.logo-f {
  width: 56px;
  height: 56px;
  display: block;
  margin-bottom: 40px;
}

/* العنوان الكبير: "Explore the things you love." */
.headline {
  font-size: 58px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -2px;
  color: var(--text);
}

.headline__accent {
  color: var(--fb-blue); /* "you love." بالأزرق */
}

/* ----- العمود اليميني ----- */
.hero__right {
  width: 430px;
  flex-shrink: 0; /* ما يصغّر لما تضيق الشاشة */
  /* الفاصل العمودي بالنص — علامة التصميم الجديد */
  border-left: 1px solid #dadde1;
  padding-left: 48px;
}

/* الكرت هلا بدون ظل ولا خلفية — الفورم على الأبيض مباشرة */
.card {
  background-color: transparent;
  padding: 0;
  text-align: center;
}

/* عنوان "Log into Facebook" فوق الفورم */
.form-title {
  font-size: 24px;
  font-weight: 700;
  text-align: left;
  margin-bottom: 18px;
}

/* ============================================================
   4) الفورم والحقول
   ============================================================ */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input {
  width: 100%;
  padding: 15px 18px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  outline: none;
  background: #fdfdfd;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  border-color: var(--fb-blue);
  box-shadow: 0 0 0 3px rgba(8, 102, 255, 0.15);
  background: var(--white);
}

/* حقل فيه خطأ — بنضيف الكلاس من الجافاسكربت */
.input.input--error {
  border-color: var(--error);
}

.error {
  color: var(--error);
  font-size: 13px;
  text-align: left;
  min-height: 16px; /* حتى ما ترقص الصفحة لما تظهر الرسالة */
}

/* ============================================================
   5) الأزرار
   ============================================================ */
.btn {
  border: none;
  border-radius: 8px; /* زوايا دايرية — مو كبسولة (هيك التصميم الحقيقي) */
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.05s;
}
.btn:active {
  transform: scale(0.99); /* ضغطة خفيفة عند النقر */
}

/* زر تسجيل الدخول الأزرق — عريض بكامل العرض */
.btn--primary {
  background-color: var(--fb-blue);
  color: var(--white);
  font-size: 17px;
  padding: 14px 16px;
  width: 100%;
}
.btn--primary:hover {
  background-color: var(--fb-blue-dark);
}

/* زر "Create new account" المفرّغ — أزرق بحدود، خلفية بيضا */
.btn--outline {
  background-color: transparent;
  color: var(--fb-blue);
  border: 1px solid var(--fb-blue);
  font-size: 17px;
  padding: 13px 16px;
  width: 100%;
}
.btn--outline:hover {
  background-color: rgba(8, 102, 255, 0.06);
}

/* الزر الأخضر — لسا مستعمل بزر "Sign Up" جوّا نافذة إنشاء الحساب */
.btn--secondary {
  background-color: var(--fb-green);
  color: var(--white);
  font-size: 15px;
  padding: 12px 20px;
}
.btn--secondary:hover {
  background-color: var(--fb-green-dark);
}

/* "Forgot password?" — أسود، غامق، بالنص (متل التصميم الجديد) */
.forgot {
  display: block;
  text-align: center;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  margin-top: 18px;
}
.forgot:hover {
  color: var(--fb-blue);
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.create-page {
  text-align: center;
  font-size: 14px;
  margin-top: 28px;
}
.create-page a {
  color: var(--text);
}

/* ============================================================
   6) الفوتر
   ============================================================ */
.footer {
  background-color: var(--white);
  border-top: 1px solid #dadde1; /* خط يفصل الفوتر عن الصفحة البيضا */
  padding: 20px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.footer__container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer__langs,
.footer__links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.footer__langs a,
.footer__links a {
  color: var(--text-muted);
}

.footer__plus {
  border: 1px solid var(--border);
  padding: 0 6px;
  border-radius: 2px;
}

.footer__line {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

.footer__copy {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

/* شعار Meta بالفوتر */
.meta-brand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--fb-blue);
}

.meta-logo {
  width: 30px;
  height: 17px;
  display: block;
}

.meta-word {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* ============================================================
   7) الاستجابة للشاشات الصغيرة (Responsive)
   ============================================================ */
@media (max-width: 900px) {
  .hero__container {
    flex-direction: column; /* العمودين يصيروا فوق بعض */
    align-items: center;
    text-align: center;
    gap: 24px;
  }

  .hero__left {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .logo-f {
    margin-bottom: 12px;
  }

  .headline {
    font-size: 34px;
    letter-spacing: -1px;
  }

  .hero__right {
    width: 100%;
    max-width: 396px;
    /* بالموبايل منشيل الفاصل العمودي */
    border-left: none;
    padding-left: 0;
  }

  .form-title {
    text-align: center;
  }
}

/* ============================================================
   8) زر جوجل + فاصل الـ OR
   ============================================================ */

/* خط أفقي مكتوب بنصّو OR */
.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--text-muted);
  font-size: 12px;
}

/* ::before و ::after = عناصر وهمية منرسم فيها الخطين */
.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

/* جوجل بترسم زرها جوّا هالـ div — منوسّطو بس */
.google-btn-wrap {
  display: flex;
  justify-content: center;
}

/* ============================================================
   9) شاشة "مسجّل دخول"
   ============================================================ */
.profile__pic {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
  margin-bottom: 12px;
}

.profile__name {
  font-size: 22px;
  margin-bottom: 4px;
}

.profile__email {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.profile__verified {
  font-size: 13px;
  color: var(--fb-green);
  margin-bottom: 20px;
  min-height: 18px;
}

/* ============================================================
   10) حالة التحميل + تعطيل الأزرار
   ============================================================ */
.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* سبينر صغير بيلف — بيظهر جوّا الزر وقت الانتظار */
.btn.is-loading {
  color: transparent;
  position: relative;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* شاشة تحميل أولية — لحد ما نعرف إذا في جلسة */
.card.is-checking {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   11) نافذة إنشاء الحساب (Modal)
   ============================================================ */
/* مهم: بدون هالسطر النافذة بتضل ظاهرة!
   لأن display:flex تبع الكلاس بيغلب خاصية hidden تبع المتصفح.
   القاعدة: أي عنصر بتعطيه display بالـ CSS، لازم تلغيه صراحةً وقت hidden. */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal__box {
  position: relative; /* فوق الـ backdrop */
  background: var(--white);
  border-radius: 8px;
  width: 100%;
  max-width: 432px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  animation: modal-in 0.15s ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.modal__header {
  padding: 10px 16px 10px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.modal__title {
  font-size: 32px;
  font-weight: bold;
}

.modal__subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 30px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}
.modal__close:hover { color: var(--text); }

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.modal__terms {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

.btn--signup {
  align-self: center;
  width: 194px;
  font-size: 18px;
  margin-top: 4px;
}

/* ============================================================
   12) شريط الإشعار (Banner) — بيطلع فوق فورم اللوغن
   ============================================================ */
.banner {
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: bold;
  text-align: center;
  animation: banner-in 0.25s ease-out;
}

.banner--success {
  background: #e7f8e9;
  color: #1a7f37;
  border: 1px solid #a6e3ad;
}

@keyframes banner-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
