/* =========================================================
   نتيجة الشهادة السودانية — result.jabirlabs.com
   تصميم يبدأ من الجوال (Mobile-first)
   ========================================================= */

:root {
  --night: #0B3B2E;      /* أخضر ليلي داكن — خلفية الرأس والتذييل */
  --night-2: #104A3A;
  --green: #1C8A4A;      /* أخضر شعار الوزارة */
  --green-tint: #E3F2E9;
  --sun: #F28C28;        /* برتقالي أشعة الشروق في الشعار */
  --paper: #F3F7F2;
  --ink: #10261E;
  --muted: #4B5F56;
  --line: #D5E3DA;

  --radius-lg: 22px;
  --radius-md: 14px;
  --shadow: 0 22px 44px -22px rgba(11, 59, 46, .55), 0 2px 6px rgba(11, 59, 46, .08);

  --font: "Cairo", system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
  --font-ruqaa: "Aref Ruqaa", "Cairo", serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0; /* لا تباعد بين الحروف في النص العربي */
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
}

/* ---------- الرأس (Hero) ---------- */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding:
    calc(14px + env(safe-area-inset-top))
    calc(20px + env(safe-area-inset-right))
    150px
    calc(20px + env(safe-area-inset-left));
  background: linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%);
  color: #fff;
  text-align: center;
}

.hero__glow {
  position: absolute;
  inset: auto 0 -40% 0;
  height: 90%;
  background: radial-gradient(closest-side at 50% 100%, rgba(255, 178, 74, .30), rgba(255, 178, 74, 0));
  z-index: -2;
}

.hero__rays {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: max(760px, 118vw);
  height: auto;
  max-width: none;
  transform: translateX(-50%);
  z-index: -1;
}

.ray {
  transform-box: view-box;
  transform-origin: 500px 520px;
  transform: scale(.12);
  opacity: 0;
  animation: rise 1.3s cubic-bezier(.16, .8, .24, 1) forwards;
  animation-delay: calc(var(--i) * 70ms + 150ms);
}

@keyframes rise {
  to { transform: scale(1); opacity: 1; }
}

.brandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
}

.brandbar__moe {
  flex: none;
  width: 76px;
  height: 76px;
  padding: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .12);
}

.brandbar__moe img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.brandbar__jl {
  display: block;
  border-radius: 8px;
  padding: 6px 2px;
}

.brandbar__jl img {
  width: auto;
  height: 34px;
}

.hero__text {
  max-width: 640px;
  margin: 34px auto 0;
}

.hero h1 {
  font-size: clamp(2rem, 9vw, 3.6rem);
  font-weight: 800;
  line-height: 1.3;
  text-wrap: balance;
  text-shadow: 0 2px 18px rgba(11, 59, 46, .55);
}

.hero p {
  max-width: 34ch;
  margin: 14px auto 0;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, .9);
  text-wrap: pretty;
  text-shadow: 0 1px 10px rgba(11, 59, 46, .8);
}

/* ---------- روابط النتيجة ---------- */

.links {
  position: relative;
  display: grid;
  gap: 14px;
  max-width: 920px;
  margin: -96px auto 0;
  padding: 0 calc(16px + env(safe-area-inset-right)) 0 calc(16px + env(safe-area-inset-left));
}

.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  padding: 16px 16px 16px 14px;
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .2s ease, transform .2s ease;
}

.link-card:hover { border-color: var(--sun); }
.link-card:active { transform: scale(.985); }

.link-card__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: var(--green-tint);
  color: var(--green);
}

.link-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.link-card__name {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.5;
}

.link-card__url {
  align-self: flex-start;
  font-size: .95rem;
  font-weight: 600;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.link-card__go {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--sun);
  color: #fff;
  transition: transform .2s ease;
}

.link-card:hover .link-card__go { transform: translateX(-4px); }

.links__hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 6px 0;
  font-size: .92rem;
  line-height: 1.7;
  color: var(--muted);
}

.links__hint svg {
  flex: none;
  margin-top: 4px;
  color: var(--green);
}

/* ---------- الخطوات ---------- */

.steps {
  max-width: 920px;
  margin: 56px auto 0;
  padding: 0 calc(20px + env(safe-area-inset-right)) 0 calc(20px + env(safe-area-inset-left));
}

.steps h2,
.wishes h2 { text-wrap: balance; }

.steps h2 {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.4;
}

.steps__list {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: 0;
}

.steps__list li {
  position: relative;
  counter-increment: step;
  padding: 0 58px 26px 0;
}

/* خط يربط الخطوات */
.steps__list li::after {
  content: "";
  position: absolute;
  top: 44px;
  bottom: 6px;
  right: 19px;
  width: 2px;
  background: var(--line);
}

.steps__list li:last-child { padding-bottom: 0; }
.steps__list li:last-child::after { display: none; }

.steps__list li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--night);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1;
}

.steps h3 {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.5;
  padding-top: 4px;
}

.steps p {
  margin-top: 2px;
  color: var(--muted);
}

/* ---------- تمنيات بالنجاح ---------- */

.wishes {
  max-width: 680px;
  margin: 64px auto 0;
  padding: 0 calc(22px + env(safe-area-inset-right)) 64px calc(22px + env(safe-area-inset-left));
  text-align: center;
}

/* شمس صغيرة تكرر أشعة الشعار */
.wishes::before {
  content: "";
  display: block;
  width: 120px;
  height: 60px;
  margin: 0 auto 6px;
  background: repeating-conic-gradient(from -90deg at 50% 100%, var(--sun) 0deg 7deg, transparent 7deg 15deg);
  -webkit-mask: radial-gradient(circle at 50% 100%, transparent 0 20px, #000 21px 58px, transparent 59px);
          mask: radial-gradient(circle at 50% 100%, transparent 0 20px, #000 21px 58px, transparent 59px);
}

.wishes h2 {
  font-family: var(--font-ruqaa);
  font-weight: 700;
  font-size: clamp(2.7rem, 13vw, 4.6rem);
  line-height: 1.35;
  color: var(--green);
}

.wishes__lead {
  margin-top: 14px;
  font-size: 1.12rem;
  line-height: 1.95;
  text-wrap: pretty;
}

.wishes__soft {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.9;
  text-wrap: pretty;
}

.wishes__verse {
  margin-top: 18px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--night);
}

.share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  margin-top: 30px;
  padding: 12px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s ease, transform .2s ease;
}

.share:hover { background: #167A40; }
.share:active { transform: scale(.97); }

.share__status {
  min-height: 1.75em;
  margin-top: 8px;
  font-size: .92rem;
  color: var(--green);
}

/* ---------- التذييل ---------- */

.footer {
  padding: 30px calc(20px + env(safe-area-inset-right)) calc(30px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left));
  background: var(--night);
  color: rgba(255, 255, 255, .78);
  text-align: center;
  font-size: .92rem;
}

.footer__note {
  max-width: 44ch;
  margin: 0 auto;
  line-height: 1.8;
}

.footer__credit {
  margin-top: 14px;
  color: #fff;
  font-weight: 600;
}

.footer__credit a {
  display: inline-block;
  margin-inline-start: 4px;
  padding: 2px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  text-decoration: none;
  transition: background-color .2s ease;
}

.footer__credit a:hover { background: rgba(255, 255, 255, .2); }

.footer__copy {
  margin-top: 10px;
  font-size: .85rem;
  color: rgba(255, 255, 255, .55);
}

/* ---------- الشاشات الأكبر ---------- */

@media (min-width: 720px) {
  .hero { padding-top: 22px; padding-bottom: 210px; }
  .brandbar__moe { width: 96px; height: 96px; }
  .brandbar__jl img { height: 44px; }
  .hero__text { margin-top: 28px; }
  .hero p { font-size: 1.15rem; }

  .links {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: -112px;
    padding-inline: 28px;
  }
  .links__hint { grid-column: 1 / -1; justify-content: center; text-align: center; }
  .link-card { min-height: 108px; padding: 22px 22px 22px 18px; }
  .link-card__name { font-size: 1.2rem; }

  .steps { margin-top: 80px; padding-inline: 28px; }
  .steps h2 { text-align: center; font-size: 1.7rem; }

  .steps__list {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-top: 32px;
    text-align: center;
  }
  .steps__list li { padding: 58px 0 0; }
  .steps__list li::before { right: 50%; transform: translateX(50%); }
  /* خط أفقي يصل بين الخطوات */
  .steps__list li::after {
    top: 19px;
    bottom: auto;
    right: calc(50% + 32px);
    width: calc(100% - 64px + 28px);
    height: 2px;
  }
  .steps__list li:last-child::after { display: none; }

  .wishes { margin-top: 96px; padding-bottom: 88px; }
}

@media (min-width: 1100px) {
  .hero { padding-bottom: 240px; }
  .links { margin-top: -124px; }
}

/* ---------- تقليل الحركة ---------- */

@media (prefers-reduced-motion: reduce) {
  .ray { animation: none; transform: none; opacity: 1; }
  .link-card,
  .link-card__go,
  .share { transition: none; }
}
