/* ===== WELCOME SCREEN — MA-ZAL V2 ===== */

.mz101-no-welcome #mz101Welcome {
  display: none !important;
}

.mz101-welcome {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 1000px 600px at 25% 30%, rgba(201, 168, 76, 0.10), transparent 60%),
    radial-gradient(ellipse 800px 500px at 78% 70%, rgba(168, 120, 50, 0.08), transparent 65%),
    #2C2416;
  overflow: hidden;
}

/* خطوط زخرفية خفية */
.mz101-welcome::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201, 168, 76, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 168, 76, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* الكارد المركزي */
.mz101-welcome-card {
  position: relative;
  width: min(820px, 96vw);
  border-radius: 28px;
  border: 1px solid rgba(201, 168, 76, 0.32);
  background: linear-gradient(145deg, rgba(52, 40, 22, 0.96), rgba(44, 34, 16, 0.98));
  box-shadow:
    0 0 0 1px rgba(201, 168, 76, 0.08),
    0 40px 100px rgba(10, 6, 0, 0.60),
    inset 0 1px 0 rgba(201, 168, 76, 0.16);
  overflow: hidden;
  animation: wc-appear 0.7s cubic-bezier(.16,1,.3,1) forwards;
}

@keyframes wc-appear {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* شريط ذهبي علوي */
.mz101-welcome-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.65), rgba(201, 168, 76, 0.9), rgba(201, 168, 76, 0.65), transparent);
}

/* داخل الكارد */
.mz101-welcome-inner {
  padding: 44px 40px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

/* الشعار */
.mz101-welcome-logo {
  width: auto;
  height: 72px;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 0 20px rgba(201, 168, 76, 0.22));
  animation: wc-logo 0.9s cubic-bezier(.16,1,.3,1) 0.1s both;
}

@keyframes wc-logo {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* اسم الشركة */
.mz101-welcome-brand {
  margin-top: 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: rgba(201, 168, 76, 0.80);
  animation: wc-fade 0.8s ease 0.2s both;
}

/* الفاصل */
.mz101-welcome-sep {
  margin: 22px auto;
  width: 56px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.45), transparent);
}

/* الترحيب */
.mz101-welcome-greeting {
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: wc-fade 0.8s ease 0.3s both;
}

.mz101-welcome-flag-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(201, 168, 76, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  display: none; /* تظهر عند الاكتشاف */
}

.mz101-welcome-flag-img.mz101-visible {
  display: block;
}

.mz101-welcome-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(22px, 3.2vw, 36px);
  font-weight: 400;
  font-style: normal;
  color: #E8D9B8;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.mz101-welcome-country {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  padding: 6px 18px;
  border-radius: 999px;
  border: 0px solid rgba(201, 168, 76, 0.42);
  background:
    radial-gradient(circle at 50% 0%, rgba(201, 168, 76, 0.04), transparent 62%),
    rgba(201, 168, 76, 0.08);
  color: #C9A84C;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: clamp(12px, 1.4vw, 15px);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow:
    0 0 18px rgba(201, 168, 76, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.mz101-welcome-text[dir="rtl"],
.mz101-welcome-text [dir="rtl"] {
  font-weight: 300;
}

/* العنوان الرئيسي */
.mz101-welcome-title {
  margin-top: 18px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(14px, 1.5vw, 18px);
  font-weight: 300;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(201, 168, 76, 0.70);
  animation: wc-fade 0.8s ease 0.4s both;
}

/* اختيار اللغة */
.mz101-welcome-langs {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  animation: wc-fade 0.8s ease 0.5s both;
  direction: ltr;
}

.mz101-welcome-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(201, 168, 76, 0.22);
  background: rgba(201, 168, 76, 0.05);
  color: rgba(232, 217, 184, 0.72);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: .2s ease;
  font-family: 'DM Sans', system-ui, sans-serif;
}

.mz101-welcome-lang-btn:hover {
  border-color: rgba(201, 168, 76, 0.50);
  color: #E8D9B8;
  background: rgba(201, 168, 76, 0.09);
}

.mz101-welcome-lang-btn.mz101-active {
  border-color: rgba(201, 168, 76, 0.65);
  background: rgba(201, 168, 76, 0.14);
  color: #C9A84C;
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.08);
}

.mz101-welcome-lang-flag {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* زر الدخول */
.mz101-welcome-enter {
  margin-top: 30px;
  animation: wc-fade 0.8s ease 0.6s both;
}

.mz101-welcome-enter-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  border-radius: 14px;
  border: 1px solid rgba(201, 168, 76, 0.50);
  background: rgba(122, 92, 30, 0.22);
  color: #E8D9B8;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: .22s ease;
  position: relative;
  overflow: hidden;
}

.mz101-welcome-enter-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.12), transparent);
  opacity: 0;
  transition: opacity .22s ease;
}

.mz101-welcome-enter-btn:hover {
  border-color: rgba(201, 168, 76, 0.80);
  background: rgba(122, 92, 30, 0.32);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(122, 92, 30, 0.25);
}

.mz101-welcome-enter-btn:hover::before {
  opacity: 1;
}

.mz101-welcome-enter-btn span {
  position: relative;
}

.mz101-welcome-enter-arrow {
  position: relative;
  font-size: 16px;
  transition: transform .2s ease;
}

.mz101-welcome-enter-btn:hover .mz101-welcome-enter-arrow {
  transform: translateX(4px);
}

[dir="rtl"] .mz101-welcome-enter-btn:hover .mz101-welcome-enter-arrow {
  transform: translateX(-4px);
}

/* hint */
.mz101-welcome-hint {
  margin-top: 14px;
  color: rgba(196, 172, 122, 0.45);
  font-size: 11px;
  letter-spacing: 0.08em;
  animation: wc-fade 0.8s ease 0.7s both;
}

@keyframes wc-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* body أثناء Welcome */
body.mz101-welcome-on {
  overflow: hidden;
}

body.mz101-welcome-on header {
  opacity: 0;
  pointer-events: none;
}

/* إخفاء بـ fade */
.mz101-welcome.mz101-hiding {
  animation: wc-hide 0.45s cubic-bezier(.4,0,.2,1) forwards;
}

@keyframes wc-hide {
  from { opacity: 1; }
  to   { opacity: 0; pointer-events: none; }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .mz101-welcome-inner {
    padding: 32px 22px 28px;
  }

  .mz101-welcome-logo {
    height: 54px;
  }

  .mz101-welcome-lang-btn {
    padding: 7px 11px;
    font-size: 11px;
  }
}

@media (max-height: 680px) {
  .mz101-welcome-inner {
    padding: 24px 28px 20px;
  }
  .mz101-welcome-sep {
    margin: 14px auto;
  }
  .mz101-welcome-langs {
    margin-top: 18px;
  }
  .mz101-welcome-enter {
    margin-top: 18px;
  }
}

/* ── RTL overflow fix ── */
html[dir="rtl"],
html[dir="rtl"] body {
  overflow-x: hidden;
}
/* ── Flash prevention — hide content until welcome decision is made ── */
html.mz101-show-welcome body {
  overflow: hidden;
}

html.mz101-show-welcome #mz101Main,
html.mz101-show-welcome .mz101-header,
html.mz101-show-welcome footer {
  visibility: hidden;
}

html.mz101-show-welcome .mz101-welcome {
  visibility: visible;
  pointer-events: auto;
}

html.mz101-no-welcome .mz101-welcome {
  display: none !important;
}
