/* Wasila / Libyana student offer — shared styles. RTL first. */
:root {
  /* Tokens taken from the live www.wasila-app.net design (2026-10-10). */
  --green: #16a34a;
  --green-dark: #15803d;
  --green-ink: #000000;
  --green-tint: #f0fdf4;
  --green-glow: 0 4px 12px rgba(22, 163, 74, .35);
  --ink: #111827;
  --muted: #4b5563;
  --line: #e5e7eb;
  --bg: #ffffff;
  --surface: #f9fafb;
  --card: #ffffff;
  --danger: #b42318;
  --danger-tint: #fdecea;
  --warn: #8a5a00;
  --warn-tint: #fff4d6;
  --info-tint: #eaf2fb;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 35px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .06);
  --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 16px; }
a { color: var(--green); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid #16a34a; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.brandbar { background: #000; color: #fff; }
.brandbar__inner { max-width: 560px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brandbar img { height: 30px; width: auto; display: block; }
.brandbar__tag { font-size: 13px; color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 9999px; padding: 4px 12px; }
.mockbar { background: var(--warn-tint); color: var(--warn); font-size: 13px; text-align: center; padding: 6px 12px; border-bottom: 1px solid #f1dfaa; }

/* ---------- student layout ---------- */
.page { max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; }
.hero { background: #000; color: #fff; border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: 26px 22px 56px; margin: 0 0 6px; clip-path: polygon(0 0, 100% 0, 100% 86%, 0 100%); }
.hero h1 .accent { color: var(--green); }
.hero h1 { margin: 0 0 8px; font-size: 26px; line-height: 1.35; font-weight: 700; }
.hero p { margin: 0; color: #d1d5db; font-size: 15px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--green-tint); color: var(--green-dark); }
.hero .badge { background: var(--green); color: #fff; margin-bottom: 12px; box-shadow: var(--green-glow); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card h2 { font-size: 19px; font-weight: 700; margin: 0 0 12px; color: #000; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 15px; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.input { width: 100%; min-height: 52px; padding: 12px 14px; font: inherit; font-size: 17px; border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); }
.input:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input--ltr { direction: ltr; text-align: right; }
.input--otp { letter-spacing: 10px; text-align: center; font-size: 26px; direction: ltr; }
.error { color: var(--danger); font-size: 14px; margin-top: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--green); flex: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 24px; border-radius: 9999px; border: 0; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none; transition: background .2s, transform .2s; }
.btn--primary { background: var(--green); color: #fff; box-shadow: var(--green-glow); }
.btn--primary:hover { background: var(--green-dark); transform: translateY(-1px); }
.btn--dark { background: #000; color: #fff; }
.btn--ghost { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn--quiet { background: var(--green-tint); color: var(--green-dark); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn--sm { min-height: 38px; padding: 6px 16px; font-size: 14px; }
.btn--danger { background: var(--danger); color: #fff; }

.alert { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; font-size: 15px; }
.alert--error { background: var(--danger-tint); color: var(--danger); }
.alert--info { background: var(--info-tint); color: #1d4f86; }
.alert--success { background: var(--green-tint); color: var(--green-dark); }
.alert--warn { background: var(--warn-tint); color: var(--warn); }

.tiers { width: 100%; border-collapse: collapse; font-size: 14px; }
.tiers th, .tiers td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
.tiers th { color: var(--muted); font-weight: 600; font-size: 13px; }

/* stages */
.stages { list-style: none; padding: 0; margin: 0 0 4px; display: grid; gap: 10px; }
.stage { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); }
.stage__dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; font-size: 12px; }
.stage--done { color: var(--ink); }
.stage--done .stage__dot { background: var(--green); border-color: var(--green); color: #fff; }
.stage--active .stage__dot { border-color: var(--green); border-top-color: transparent; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .stage--active .stage__dot { animation: none; } }

/* benefits */
.benefit { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 14px; background: #fff; box-shadow: var(--shadow); }
.benefit--ready { border-color: var(--green); border-width: 1.5px; }
.benefit__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.benefit__title { font-size: 17px; font-weight: 700; margin: 0; }
.benefit__terms { font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.code { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--green-tint); border: 1px dashed #86efac; border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.code__value { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 20px; font-weight: 700; letter-spacing: 2px; direction: ltr; }
.benefit__actions { display: grid; gap: 10px; }
.benefit__sms { font-size: 13px; color: var(--muted); margin-top: 10px; display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; color: var(--green); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 4px; min-height: 32px; }
.pending { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 15px; }

.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }

/* ---------- admin ---------- */
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: #000; color: #e5e7eb; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side__brand { padding: 8px 4px 16px; margin-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.1); }
.side__brand img { height: 26px; display: block; }
.side nav a { display: block; color: #e5e7eb; text-decoration: none; padding: 9px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 2px; }
.side nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side nav a[aria-current="page"] { background: var(--green); color: #fff; box-shadow: var(--green-glow); }
.side__user { border-top: 1px solid rgba(255,255,255,.12); margin-top: 16px; padding-top: 14px; font-size: 13px; }
.side__user button { background: none; border: 0; color: #86efac; font: inherit; cursor: pointer; padding: 0; }
.main { padding: 22px 26px 40px; min-width: 0; background: var(--surface); }
.main h1 { font-size: 22px; margin: 0 0 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 16px 0; }
.toolbar .field { margin: 0; }
.toolbar .input, .toolbar select { min-height: 40px; padding: 6px 10px; font-size: 14px; border-radius: 10px; }
select.input { appearance: auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.kpi__label { font-size: 12.5px; color: var(--muted); }
.kpi__value { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi__value--na { font-size: 16px; color: var(--muted); font-weight: 600; }
.kpi__note { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.chartcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.chartcard h3 { font-size: 14px; margin: 0 0 8px; }
.chartcard canvas { width: 100% !important; height: 240px !important; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.data th { background: #fafbfa; color: var(--muted); font-weight: 600; font-size: 12.5px; position: sticky; top: 0; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef1ef; color: #44504a; }
.pill--ok { background: var(--green-tint); color: var(--green-dark); }
.pill--bad { background: var(--danger-tint); color: var(--danger); }
.pill--warn { background: var(--warn-tint); color: var(--warn); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 12px; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.inline { display: inline; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--green-tint); }
.authwrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: #000; }
.authcard { width: 100%; max-width: 420px; background: #fff; border-radius: var(--radius-lg); padding: 26px 22px; box-shadow: var(--shadow); }
.authcard__brand { background: #000; border-radius: 9999px; padding: 12px; margin-bottom: 18px; text-align: center; }
.authcard__brand img { height: 30px; }
.qr svg { width: 200px; height: 200px; display: block; margin: 0 auto; }
.mono { font-family: ui-monospace, Consolas, monospace; direction: ltr; unicode-bidi: embed; }
.mobile-nav { display: none; }

@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 12px 16px; }
  .side nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px; }
  .side nav a { white-space: nowrap; }
  .main { padding: 16px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .charts { grid-template-columns: 1fr; }
}

/* ---------- entry screen (first screen opened from the app notification) ---------- */
.brandbar__partner { width: 34px; height: 34px; border-radius: 50%; background: #fff; padding: 2px; display: block; }
.entry-top { background: #000; padding: 26px 16px 70px; border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.entry-top__brands { max-width: 480px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 14px; }
.entry-top__brands > img { height: 35px; width: auto; }
.entry-top__x { color: #6b7280; font-size: 20px; line-height: 1; }
.entry-top__partner { width: 56px; height: 56px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: var(--green-glow); }
.entry-top__partner img { width: 48px; height: 48px; border-radius: 50%; }
.entry-top + .page { margin-top: -54px; padding-top: 0; position: relative; }
.entry-card { padding: 24px 20px; border-radius: 24px; text-align: center; }
.entry-card form { text-align: right; margin-top: 18px; }
.entry-card__title { margin: 12px 0 6px; font-size: 24px; line-height: 1.35; font-weight: 700; color: #000; }
.entry-card__title .accent { color: var(--green); }
.entry-card__lead { margin: 0; color: var(--muted); font-size: 15px; }
.entry-card__note { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.input--lg { min-height: 58px; font-size: 20px; letter-spacing: 1px; text-align: center; }
.btn--lg { min-height: 58px; font-size: 18px; }
.entry-tiers { padding: 0; }
.entry-tiers > summary { list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; min-height: 52px; }
.entry-tiers > summary::-webkit-details-marker { display: none; }
.entry-tiers > summary::after { content: "+"; color: var(--green); font-size: 22px; font-weight: 700; }
.entry-tiers[open] > summary::after { content: "−"; }
.entry-tiers[open] > summary { border-bottom: 1px solid var(--line); }
.entry-tiers .tiers, .entry-tiers > p { margin: 0 20px; }
.entry-tiers > p { padding-bottom: 16px; }
@media (min-width: 600px) {
  .entry-card__title { font-size: 28px; }
}

/* ---------- offer screen: one compact, fixed screen ---------- */
.offer-top { background: #000; color: #fff; border-radius: 0 0 var(--radius-xl) var(--radius-xl); padding: 14px 16px 48px; }
.offer-top__inner { max-width: 480px; margin: 0 auto; text-align: center; }
.offer-top__brands { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.offer-top__brands > img { height: 26px; width: auto; }
.offer-top__partner { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.offer-top__partner img { width: 30px; height: 30px; border-radius: 50%; }
.offer-top__tier { background: var(--green); color: #fff; box-shadow: var(--green-glow); }
.offer-top__title { margin: 8px 0 2px; font-size: 24px; font-weight: 700; line-height: 1.3; }
.offer-top__meta { margin: 0; color: #9ca3af; font-size: 13px; }
.offer-top + .page { margin-top: -34px; padding-top: 0; padding-bottom: 16px; position: relative; }
.offer-status { display: flex; gap: 8px; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); border-radius: 9999px; padding: 8px 14px; margin: 0 auto 10px; width: fit-content; font-size: 14px; color: var(--muted); box-shadow: var(--shadow); }
.offer-status[hidden] { display: none; }
.offer-status__spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--green); border-top-color: transparent; animation: spin 1s linear infinite; flex: none; }
@media (prefers-reduced-motion: reduce) { .offer-status__spin { animation: none; } }
.offer-list { display: grid; gap: 10px; }
.offer { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 14px 14px 10px; box-shadow: var(--shadow); }
.offer--ready { border-color: #bbf7d0; }
.offer__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.offer__title { margin: 0; font-size: 17px; font-weight: 700; color: #000; }
.offer__terms { font-size: 13px; color: var(--muted); }
.offer__row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
.offer__cta { min-height: 50px; padding: 10px 14px; font-size: 16px; }
.offer__code { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-width: 118px; padding: 4px 10px; border: 1px dashed #86efac; background: var(--green-tint); border-radius: 14px; cursor: pointer; font: inherit; color: var(--ink); }
.offer__code-value { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-weight: 700; font-size: 15px; letter-spacing: 1px; direction: ltr; }
.offer__code-hint { font-size: 11px; color: var(--green-dark); font-weight: 600; }
.offer__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 30px; margin-top: 4px; }
.offer__note { font-size: 12px; color: var(--danger); }
.offer__foot .linkbtn { font-size: 12.5px; margin-inline-start: auto; color: var(--muted); }
.offer__pending { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; min-height: 50px; }
.offer__note:empty { display: none; }
p.offer__note { margin: 8px 0 2px; }

/* Libyana package badge: Libyana purple with yellow text, white frame (from the approved reference). */
:root { --libyana-purple: #951b81; --libyana-yellow: #ffed00; }
.tier-badge { display: inline-block; background: var(--libyana-purple); color: var(--libyana-yellow); font-weight: 700; font-size: 18px; line-height: 1.3; padding: 8px 20px; border-radius: 14px; box-shadow: 0 0 0 3px #fff; margin: 4px 0 6px; }
.hero .tier-badge { margin: 4px 0 10px; }
