:root {
  --blue: #0645b7;
  --blue-dark: #053790;
  --blue-soft: #e7eefc;
  --ink: #10213f;
  --muted: #5d6880;
  --white: #ffffff;
  --line: rgba(6, 69, 183, .14);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--blue);
  color: var(--ink);
  font-family: "Tajawal", "SF Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* الورقة = خلفية الهوية (الإطار الأزرق + الرمادي) */
.sheet {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100svh;
  background: #d9d9d9 url("assets/background.jpg") center / cover no-repeat;
}

.wrap {
  padding: calc(34px + env(safe-area-inset-top)) 20px calc(34px + env(safe-area-inset-bottom));
}

/* ---------- Header ---------- */
.head { text-align: center; margin-bottom: 22px; }

/* شريحة بيضاء عشان تبان سواء وقعت على الأزرق أو على الرمادي */
.brand {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  background: var(--white);
  padding: 7px 18px;
  border-radius: 999px;
  margin-bottom: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}

.head h1 {
  font-size: clamp(26px, 7vw, 36px);
  font-weight: 800;
  margin: 0 0 8px;
  line-height: 1.25;
  color: var(--ink);
}

.sub {
  margin: 0 auto;
  max-width: 330px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

/* ---------- Video ---------- */
/* العرض محدد من العرض نفسه (مش من الارتفاع) عشان ما يصير دوران في الحساب */
.video-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: 0 18px 44px rgba(6, 69, 183, .2);
  margin: 0 auto 30px;
  width: min(78vw, 320px, calc(62vh * 0.5625));
  width: min(78vw, 320px, calc(62svh * 0.5625));
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

/* احتياط للمتصفحات القديمة اللي ما تدعم aspect-ratio */
@supports not (aspect-ratio: 9 / 16) {
  .video-frame { height: 0; padding-bottom: 177.78%; }
}

.video-frame iframe,
.video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: cover;
}

/* زر تشغيل كبير */
.play-btn {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .15s ease, opacity .2s ease;
}

.play-btn svg { width: 34px; height: 34px; fill: var(--blue); margin-right: 4px; }
.play-btn:active { transform: scale(.94); }

.video-frame.playing .play-btn {
  opacity: 0;
  pointer-events: none;
}

/* ---------- Branches ---------- */
.branches { text-align: center; }

.branches h2 {
  font-size: clamp(19px, 5vw, 23px);
  margin: 0 0 16px;
  font-weight: 800;
  color: var(--ink);
}

.branch-grid { display: grid; gap: 12px; }

.branch-btn {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 72px;
  text-align: right;
  text-decoration: none;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 8px 22px rgba(6, 69, 183, .1);
  transition: transform .15s ease, box-shadow .15s ease;
}

.branch-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(6, 69, 183, .18); }
.branch-btn:active { transform: scale(.985); }

.pin {
  flex: 0 0 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(150deg, var(--blue), var(--blue-dark));
}

.pin svg { width: 25px; height: 25px; fill: var(--white); }

.branch-txt { flex: 1; min-width: 0; }

.branch-txt strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 3px;
}

.branch-txt small { color: var(--muted); font-size: 13px; }

.open {
  flex: 0 0 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-soft);
}

.open svg { width: 17px; height: 17px; fill: var(--blue); }

/* ---------- Footer ---------- */
/* الفوتر ينزل أحياناً على الشريط الأزرق — الشريحة تخليه مقروء في الحالتين */
.foot {
  margin-top: 34px;
  text-align: center;
  font-size: 12px;
}

.foot span {
  display: inline-block;
  color: var(--muted);
  background: rgba(255, 255, 255, .8);
  padding: 6px 15px;
  border-radius: 999px;
}

/* ---------- شاشات قصيرة (جوالات صغيرة بالعرض الأفقي) ---------- */
@media (max-height: 680px) {
  .video-card { width: min(70vw, 260px, calc(54vh * 0.5625)); }
  .wrap { padding-top: 22px; }
  .head { margin-bottom: 16px; }
}
