:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --ink: #05284a;
  --muted: #64788c;
  --line: #dce7ef;
  --brand: #078fd3;
  --brand-dark: #05284a;
  --brand-soft: #e7f5fc;
  --accent: #a20045;
  --accent-soft: #f8e8f0;
  --danger: #d94b4b;
  --shadow: 0 18px 48px rgba(5, 40, 74, .13);
  --radius: 18px;
  font-family: "Tajawal", "IBM Plex Sans Arabic", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.wrap {
  width: min(1120px, calc(100% - 36px));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 247, 248, .92);
  border-bottom: 1px solid rgba(221, 230, 235, .9);
  backdrop-filter: blur(18px);
}

.nav {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.25rem;
}

.logo-img {
  display: block;
  width: 190px;
  height: 62px;
  object-fit: contain;
  object-position: center;
}

.topbar .logo-img {
  width: 168px;
  height: 56px;
}

.sidebar .logo,
.auth-side .logo,
.footer .logo {
  width: max-content;
  padding: 4px 10px;
  border-radius: 16px;
  background: #fff;
}

.sidebar .logo-img,
.auth-side .logo-img,
.footer .logo-img {
  width: 178px;
  height: 62px;
}

.logo-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  box-shadow: 0 12px 24px rgba(10, 60, 95, .24);
}

.links {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-weight: 800;
}

.links a:hover,
.links a.active {
  color: var(--brand-dark);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(10, 60, 95, .24);
}

.btn:hover {
  background: linear-gradient(135deg, var(--brand-dark), #031b2c);
}

.btn.secondary {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn.dark {
  background: var(--ink);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 82px 0 74px;
  background:
    linear-gradient(135deg, rgba(7, 143, 211, .1), rgba(162, 0, 69, .1)),
    var(--bg);
}

.hero:before {
  content: "";
  position: absolute;
  inset: -170px -15% auto auto;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(162, 0, 69, .2), transparent 66%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, .95fr);
  align-items: center;
  gap: 52px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: .9rem;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.35rem, 5vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.lead {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.15rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.trust span {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .68);
  color: var(--muted);
  font-weight: 800;
}

.phone-scene {
  position: relative;
  min-height: 520px;
}

.pass {
  position: absolute;
  top: 28px;
  right: 54px;
  width: 315px;
  min-height: 455px;
  padding: 18px;
  border-radius: 34px;
  background: var(--brand-dark);
  color: #fff;
  box-shadow: var(--shadow);
  transform: rotate(-3deg);
}

.pass-inner {
  min-height: 420px;
  padding: 24px;
  border-radius: 26px;
  background: linear-gradient(160deg, var(--accent), #7a0b44 42%, var(--brand) 74%, var(--brand-dark));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pass-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 900;
}

.pass h2 {
  margin: 34px 0 18px;
  font-size: 1.85rem;
  line-height: 1.25;
}

.stamps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
}

.stamp {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, .54);
  background: rgba(255, 255, 255, .15);
  font-weight: 900;
}

.stamp.done {
  background: #fff;
  color: var(--brand-dark);
  border-style: solid;
}

.qr {
  align-self: center;
  width: 110px;
  height: 110px;
  border: 10px solid #fff;
  border-radius: 18px;
  background:
    linear-gradient(90deg, #111 10px, transparent 10px 18px, #111 18px 28px, transparent 28px),
    linear-gradient(#111 10px, transparent 10px 18px, #111 18px 28px, transparent 28px),
    #fff;
  background-size: 36px 36px;
}

.float-card {
  position: absolute;
  left: 0;
  bottom: 60px;
  width: 220px;
  padding: 18px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.float-card strong {
  display: block;
  color: var(--brand-dark);
  font-size: 2rem;
  line-height: 1;
}

section {
  padding: 74px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 30px;
}

.section-head h2 {
  margin-bottom: 8px;
  font-size: clamp(1.9rem, 3vw, 3rem);
  line-height: 1.2;
}

.section-head p {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.five {
  grid-template-columns: repeat(5, 1fr);
}

.grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.grid.two {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 12px 30px rgba(10, 60, 95, .06);
}

.service-card i,
.feature-card i {
  display: block;
  margin-bottom: 12px;
  font-size: 1.65rem;
  font-style: normal;
}

.service-card {
  min-height: 128px;
  font-weight: 900;
}

.feature-card p,
.card p {
  color: var(--muted);
}

.dark-band {
  background:
    linear-gradient(135deg, rgba(5, 40, 74, .97), rgba(162, 0, 69, .86)),
    var(--brand-dark);
  color: #fff;
}

.dark-band .eyebrow {
  background: rgba(255, 255, 255, .1);
  color: #f3d9c3;
}

.dark-band p {
  color: rgba(255, 255, 255, .72);
}

.wallet-list {
  display: grid;
  gap: 14px;
}

.wallet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .06);
}

.wallet-row span {
  color: #f3d9c3;
  font-weight: 900;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.tab {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.program-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.program-visual {
  display: grid;
  place-items: center;
  min-height: 260px;
  background:
    linear-gradient(135deg, rgba(7, 143, 211, .13), rgba(162, 0, 69, .12) 52%, transparent),
    #fff;
}

.mini-pass {
  width: min(310px, 100%);
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent), var(--brand));
  color: #fff;
  box-shadow: var(--shadow);
}

.mini-pass .row {
  display: flex;
  gap: 9px;
  margin-top: 20px;
}

.mini-pass b {
  flex: 1;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, .18);
}

.pricing {
  background: #edf7f2;
}

.billing {
  display: inline-flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.billing button {
  min-width: 92px;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.billing button.active {
  background: var(--ink);
  color: #fff;
}

.price-card {
  position: relative;
}

.price-card.featured {
  border-color: var(--brand);
  transform: translateY(-10px);
  box-shadow: var(--shadow);
}

.badge {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #2d250f;
  font-size: .82rem;
  font-weight: 900;
}

.price {
  margin: 18px 0 6px;
  font-size: 2.7rem;
  line-height: 1;
  font-weight: 900;
}

.price small {
  color: var(--muted);
  font-size: .95rem;
}

.features {
  padding: 0;
  margin: 22px 0;
  list-style: none;
}

.features li {
  display: flex;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px solid #eef4f1;
}

.features li:before {
  content: "✓";
  color: var(--brand);
  font-weight: 900;
}

.page-hero {
  padding: 70px 0 44px;
  background:
    linear-gradient(135deg, rgba(8, 167, 122, .12), transparent 45%),
    #fff;
  border-bottom: 1px solid var(--line);
}

.contact-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 130px;
  resize: vertical;
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
}

.auth-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
  background:
    linear-gradient(145deg, rgba(5, 40, 74, .96), rgba(162, 0, 69, .84)),
    var(--brand-dark);
  color: #fff;
}

.auth-side p {
  color: rgba(255, 255, 255, .78);
}

.auth-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px;
}

.auth-card {
  width: min(430px, 100%);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  background: #f5f7f8;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background:
    linear-gradient(180deg, var(--brand-dark), #031b2c),
    var(--brand-dark);
  color: #fff;
}

.side-links {
  display: grid;
  gap: 8px;
  margin-top: 34px;
}

.side-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  color: rgba(255, 255, 255, .74);
  font-weight: 850;
}

.side-links a.active,
.side-links a:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.role-card {
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.role-card span {
  display: block;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, .66);
  font-size: .82rem;
  font-weight: 850;
}

.role-card strong {
  display: block;
  line-height: 1.35;
}

.logout-btn {
  width: 100%;
  margin-top: 10px;
  background: rgba(162, 0, 69, .92);
}

.logout-btn:hover {
  background: #7d0035;
}

.btn.danger {
  background: #a00045;
  color: #fff;
  border-color: #a00045;
}

.btn.danger:hover {
  background: #7d0035;
  border-color: #7d0035;
}

.dashboard {
  min-width: 0;
  padding: 24px;
}

.dash-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.dash-top h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.dash-section {
  display: none;
}

.dash-section.active {
  display: block;
}

.merchant-dashboard .dash-top {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(10, 60, 95, .08), rgba(182, 147, 117, .14)),
    #fff;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 12px 28px rgba(17, 34, 29, .05);
}

.stat span {
  color: var(--muted);
  font-weight: 850;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  line-height: 1;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf4f1;
  text-align: right;
}

th {
  color: var(--muted);
  font-size: .92rem;
}

.status {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 900;
  font-size: .84rem;
}

.status.paused {
  background: #fff3d4;
  color: #94640b;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.search {
  width: min(360px, 100%);
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.chart {
  height: 260px;
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 20px;
}

.bar {
  flex: 1;
  min-width: 28px;
  border-radius: 14px 14px 4px 4px;
  background: linear-gradient(180deg, var(--accent), var(--brand));
  position: relative;
}

.bar span {
  position: absolute;
  right: 50%;
  bottom: -28px;
  transform: translateX(50%);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}

.campaign-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.6;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-actions .btn {
  min-height: 36px;
  padding: 8px 12px;
}

.notification-preview {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(7, 143, 211, .1), rgba(162, 0, 69, .12)),
    #fff;
}

.notification-preview:before {
  content: "🔔";
  position: absolute;
  top: 18px;
  left: 22px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.5rem;
}

.notification-preview h3,
.notification-preview p,
.notification-preview ul {
  max-width: calc(100% - 74px);
}

.subscription-card {
  overflow: hidden;
}

.subscription-card h3 {
  margin: 8px 0 6px;
  font-size: 1.9rem;
}

.subscription-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.subscription-metrics div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbfa;
}

.subscription-metrics span {
  display: block;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 850;
}

.subscription-metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 1.15rem;
}

.usage-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9f2f0;
}

.usage-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width .35s ease;
}

.subscription-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.compact-fields {
  gap: 10px;
}

.wallet-preview {
  min-height: 300px;
  margin-top: 16px;
  padding: 24px;
  border-radius: 28px;
  background: #0a3c5f;
  color: #fff;
  box-shadow: 0 22px 46px rgba(5, 40, 74, .22);
}

.wallet-preview-top,
.wallet-preview-bottom {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.wallet-preview-top span,
.wallet-preview-bottom strong {
  font-weight: 900;
}

.wallet-preview-top strong,
.wallet-preview-bottom span {
  color: #b69375;
}

.wallet-preview h4 {
  margin: 28px 0 20px;
  font-size: 1.45rem;
  line-height: 1.5;
}

.wallet-stamps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 26px;
}

.wallet-stamps span {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 16px;
  background: rgba(255, 255, 255, .08);
  font-weight: 900;
}

.wallet-stamps span.done {
  background: rgba(255, 255, 255, .92);
  color: var(--brand-dark);
}

.wallet-stamps strong {
  grid-column: 1 / -1;
  display: block;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .12);
  font-size: 1.6rem;
  text-align: center;
}

.muted-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: .92rem;
}

.join-page .auth-side {
  background:
    linear-gradient(135deg, rgba(10, 60, 95, .94), rgba(162, 0, 69, .82)),
    var(--brand-dark);
}

.join-help {
  margin-top: 16px;
}

.qr-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(7, 143, 211, .18), transparent 34%),
    radial-gradient(circle at bottom left, rgba(162, 0, 69, .14), transparent 30%),
    #f6f8fb;
}

.qr-poster {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.qr-card {
  width: min(720px, 100%);
  text-align: center;
  padding: 38px;
}

.qr-card h1 {
  margin-bottom: 12px;
  font-size: clamp(2.1rem, 5vw, 4rem);
}

.qr-logo {
  width: 220px;
  max-width: 72%;
  margin-bottom: 18px;
}

.qr-box {
  width: min(430px, 100%);
  margin: 24px auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(5, 40, 74, .1);
}

.qr-box img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
}

.qr-link {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: .92rem;
}

.footer {
  padding: 34px 0;
  background: var(--brand-dark);
  color: rgba(255, 255, 255, .72);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer .logo {
  color: #fff;
}

@media (max-width: 980px) {
  .links {
    display: none;
  }

  .hero-grid,
  .program-panel,
  .grid.two,
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .grid.five {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid.three,
  .stat-grid,
  .campaign-grid,
  .subscription-metrics {
    grid-template-columns: 1fr;
  }

  .price-card.featured {
    transform: none;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .side-links {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .wrap {
    width: min(100% - 24px, 1120px);
  }

  .nav-actions .btn.secondary,
  .nav-actions .btn.dark {
    display: none;
  }

  .hero {
    padding-top: 46px;
  }

  .phone-scene {
    min-height: 455px;
  }

  .pass {
    width: min(310px, calc(100vw - 42px));
    right: 50%;
    transform: translateX(50%) rotate(-2deg);
  }

  .float-card {
    width: 190px;
    bottom: 12px;
  }

  .grid.five,
  .side-links {
    grid-template-columns: 1fr;
  }

  .section-head,
  .toolbar,
  .dash-top {
    display: block;
  }

  .toolbar .btn,
  .dash-top .btn {
    margin-top: 12px;
  }

  .auth-side,
  .auth-form,
  .dashboard {
    padding: 22px;
  }
}

@media print {
  .qr-page {
    background: #fff;
  }

  .qr-poster {
    min-height: auto;
    padding: 0;
  }

  .qr-card {
    box-shadow: none;
    border: 0;
  }

  .qr-card .actions {
    display: none;
  }
}
