/* ============================================
   صفحة الترحيب — اختيار اللغة والبلد
   تصميم عصري بأسلوب التطبيقات الحديثة
   ============================================ */

.welcome-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(180deg, #fafafa 0%, #f5f5f5 100%);
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  direction: inherit;
  font-family: system-ui, -apple-system, sans-serif;
}

.welcome-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 24px 120px 24px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================
   الشعار والعنوان
   ============================================ */
.welcome-header {
  text-align: center;
  margin-bottom: 48px;
}

.welcome-logo-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #171717 0%, #404040 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(23, 23, 23, 0.15);
}

.welcome-logo-icon i {
  color: white;
  font-size: 32px;
}

.welcome-title {
  font-size: 28px;
  font-weight: 800;
  color: #171717;
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
}

.welcome-subtitle {
  font-size: 14px;
  color: #737373;
  margin: 0;
  font-weight: 500;
}

/* ============================================
   الأقسام
   ============================================ */
.welcome-section {
  margin-bottom: 24px;
}

.section-label {
  font-size: 13px;
  font-weight: 700;
  color: #404040;
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: start;
}

/* ============================================
   القائمة المنسدلة (Picker)
   ============================================ */
.picker {
  position: relative;
  width: 100%;
}

.picker-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: white;
  border: 2px solid #e5e5e5;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #171717;
  transition: all 0.2s ease;
  text-align: start;
}

.picker-trigger:hover {
  border-color: #a3a3a3;
}

.picker.open .picker-trigger {
  border-color: #171717;
  box-shadow: 0 0 0 4px rgba(23, 23, 23, 0.06);
}

.picker-flag {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.picker-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: start;
}

.picker-arrow {
  color: #a3a3a3;
  font-size: 14px;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.picker.open .picker-arrow {
  transform: rotate(180deg);
}

/* ============================================
   قائمة الخيارات
   ============================================ */
.picker-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline: 0;
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  display: none;
  animation: dropdownIn 0.18s ease;
}

.picker.open .picker-dropdown {
  display: block;
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.picker-dropdown::-webkit-scrollbar {
  width: 5px;
}

.picker-dropdown::-webkit-scrollbar-thumb {
  background: #d4d4d4;
  border-radius: 5px;
}

/* ============================================
   خيار داخل القائمة
   ============================================ */
.picker-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #171717;
  text-align: start;
  transition: background 0.15s ease;
}

.picker-option:hover {
  background: #f5f5f5;
}

.picker-option.active {
  background: #f0f0f0;
  font-weight: 700;
}

.picker-check {
  margin-inline-start: auto;
  color: #171717;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.picker-option.active .picker-check {
  opacity: 1;
}

[dir="rtl"] .picker-option {
  flex-direction: row;
}

[dir="ltr"] .picker-option {
  flex-direction: row;
}

/* ============================================
   ✅ روابط الصفحات القانونية (Footer)
   ============================================ */
.welcome-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 24px 8px 0;
  margin-top: 16px;
  font-size: 13px;
  text-align: center;
}

.welcome-legal a {
  color: #6b7280;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
  padding: 4px 6px;
  border-radius: 6px;
}

.welcome-legal a:hover {
  color: #171717;
  background: #f0f0f0;
}

.welcome-legal span {
  color: #d4d4d4;
  font-size: 10px;
}

/* ============================================
   زر المتابعة (ثابت في الأسفل)
   ============================================ */
.welcome-footer {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(245, 245, 245, 0) 0%, #f5f5f5 30%);
  display: flex;
  justify-content: center;
  z-index: 50;
}

.welcome-btn {
  width: 100%;
  max-width: 432px;
  padding: 16px 24px;
  background: #171717;
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 6px 20px rgba(23, 23, 23, 0.2);
}

.welcome-btn:hover:not(:disabled) {
  background: #404040;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(23, 23, 23, 0.25);
}

.welcome-btn:active:not(:disabled) {
  transform: translateY(0);
}

.welcome-btn:disabled {
  background: #d4d4d4;
  cursor: not-allowed;
  box-shadow: none;
}

[dir="rtl"] .welcome-btn i {
  transform: scaleX(-1);
}

/* ============================================
   التجاوب مع الشاشات الصغيرة
   ============================================ */
@media (max-width: 480px) {
  .welcome-container {
    padding: 24px 20px 120px 20px;
  }

  .welcome-logo-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
  }

  .welcome-logo-icon i {
    font-size: 28px;
  }

  .welcome-title {
    font-size: 24px;
  }

  .welcome-header {
    margin-bottom: 36px;
  }

  .picker-trigger {
    padding: 14px 16px;
    font-size: 14px;
  }

  .picker-flag {
    font-size: 20px;
  }

  /* ✅ روابط قانونية على الموبايل */
  .welcome-legal {
    font-size: 12px;
    padding: 20px 6px 0;
    gap: 6px;
  }
}

/* ============================================
   Landscape
   ============================================ */
@media (orientation: landscape) and (max-height: 500px) {
  .welcome-container {
    padding: 20px 24px 100px 24px;
    justify-content: flex-start;
  }

  .welcome-header {
    margin-bottom: 24px;
  }

  .welcome-logo-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 12px;
  }

  .welcome-logo-icon i {
    font-size: 24px;
  }

  .welcome-title {
    font-size: 22px;
  }

  .welcome-section {
    margin-bottom: 16px;
  }
}