/* MaxStore public site — landing, privacy, terms */
:root {
  --font: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --brand: #3434d9;
  --brand-2: #6366f1;
  --accent: #e8458c;
  --bg: #f5f6fc;
  --surface: #ffffff;
  --surface-2: #f1f3fa;
  --ink: #11142a;
  --ink-2: #545a75;
  --ink-3: #8b91ad;
  --line: #e6e9f4;
  --r: 18px;
  --grad: linear-gradient(140deg, var(--brand), var(--brand-2));
  --sh: 0 2px 10px rgba(20, 24, 60, .06);
  --sh-lg: 0 18px 50px rgba(20, 24, 60, .14);
  /* derived from --brand so a palette swap needs no extra rules */
  --glow: 0 12px 34px color-mix(in srgb, var(--brand) 34%, transparent);
  --max: 1080px;
}

/* ---- alternate palettes (set html[data-brand] from /api/site/info) ---- */
html[data-brand="red"] {
  --brand: #d61f3c;
  --brand-2: #f4552f;
  --accent: #ff9f1c;
  --bg: color-mix(in srgb, #d61f3c 5%, #fbf6f6);
  --surface-2: color-mix(in srgb, #d61f3c 4%, #faf3f3);
  --line: color-mix(in srgb, #d61f3c 9%, #eee2e2);
  --ink: #1f1114;
  --ink-2: #6b545a;
  --ink-3: #a38f94;
}
html[data-brand="red"] .brand-mark { box-shadow: var(--glow); }
@media (prefers-color-scheme: dark) {
  html[data-brand="red"] {
    --bg: #14090b; --surface: #1e1113; --surface-2: #26171a;
    --ink: #fdf2f3; --ink-2: #d3b6ba; --ink-3: #9c8085;
    --line: #341f23;
  }
}
html[data-brand="green"] {
  --brand: #0e8a5f; --brand-2: #23b57e; --accent: #f59e0b;
  --bg: color-mix(in srgb, #0e8a5f 5%, #f4faf7);
  --line: color-mix(in srgb, #0e8a5f 9%, #e3efe9);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0e18; --surface: #151827; --surface-2: #1c2033;
    --ink: #f0f2fb; --ink-2: #a7aecb; --ink-3: #737a9c;
    --line: #262b42;
    --sh: 0 2px 10px rgba(0,0,0,.4); --sh-lg: 0 18px 50px rgba(0,0,0,.55);
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font); background: var(--bg); color: var(--ink);
  line-height: 1.75; font-size: 16px; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.hdr.on { border-bottom-color: var(--line); }
.hdr .wrap { display: flex; align-items: center; gap: 14px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 18px; color: var(--ink); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; background: var(--grad);
  color: #fff; display: grid; place-items: center; font-size: 17px; font-weight: 900;
  box-shadow: var(--glow);
}
.nav { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.nav a {
  padding: 8px 13px; border-radius: 10px; font-size: 14.5px; font-weight: 700;
  color: var(--ink-2); transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 800; font-size: 15px;
  background: var(--grad); color: #fff; box-shadow: var(--glow);
  transition: transform .15s, filter .15s; border: none; cursor: pointer;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn.ghost {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  box-shadow: var(--sh);
}
.btn.sm { padding: 9px 16px; font-size: 14px; }
.menu-btn { display: none; background: none; border: none; font-size: 22px; color: var(--ink); cursor: pointer; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 74px 0 64px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -280px; inset-inline-end: -180px;
  width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 26%, transparent), transparent 68%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; bottom: -320px; inset-inline-start: -200px;
  width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 68%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; text-align: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px;
  padding: 7px 15px; border-radius: 999px; font-size: 13px; font-weight: 800;
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
}
.hero h1 {
  font-size: clamp(30px, 6vw, 52px); font-weight: 900; line-height: 1.22;
  letter-spacing: -.02em; margin-bottom: 16px;
}
.hero h1 .hl {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p.lead {
  font-size: clamp(15px, 2.2vw, 18.5px); color: var(--ink-2);
  max-width: 620px; margin: 0 auto 30px;
}
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.trust { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; margin-top: 44px; }
.trust div { text-align: center; }
.trust b { display: block; font-size: 26px; font-weight: 900; color: var(--brand); }
.trust span { font-size: 13px; color: var(--ink-3); font-weight: 700; }

/* ---------- sections ---------- */
section { padding: 62px 0; }
.sec-head { text-align: center; margin-bottom: 42px; }
.sec-head h2 { font-size: clamp(23px, 4vw, 33px); font-weight: 900; letter-spacing: -.02em; }
.sec-head p { color: var(--ink-2); margin-top: 8px; font-size: 15.5px; }

.grid { display: grid; gap: 16px; }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px 22px; box-shadow: var(--sh);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); border-color: color-mix(in srgb, var(--brand) 26%, var(--line)); }
.card .ico {
  width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center;
  font-size: 23px; margin-bottom: 15px;
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}
.card h3 { font-size: 17.5px; font-weight: 800; margin-bottom: 7px; }
.card p { color: var(--ink-2); font-size: 14.5px; }

.steps { counter-reset: s; }
.step { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.step .n {
  counter-increment: s; flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 13px; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-weight: 900; font-size: 17px; box-shadow: var(--glow);
}
.step .n::before { content: counter(s); }
.step h3 { font-size: 17px; font-weight: 800; margin-bottom: 3px; }
.step p { color: var(--ink-2); font-size: 14.5px; }

.band {
  background: var(--grad); color: #fff; border-radius: calc(var(--r) * 1.4);
  padding: 46px 30px; text-align: center; box-shadow: var(--glow);
  position: relative; overflow: hidden;
}
.band::before {
  content: ""; position: absolute; top: -60%; inset-inline-end: -8%;
  width: 320px; height: 320px; border-radius: 50%; background: rgba(255,255,255,.12);
}
.band > * { position: relative; z-index: 1; }
.band h2 { font-size: clamp(22px, 4vw, 31px); font-weight: 900; margin-bottom: 10px; }
.band p { opacity: .92; margin-bottom: 24px; font-size: 16px; }
.band .btn { background: #fff; color: var(--brand); box-shadow: 0 8px 26px rgba(0,0,0,.2); }

/* ---------- legal pages ---------- */
.legal { padding: 48px 0 70px; }
.legal-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 36px 30px; box-shadow: var(--sh);
}
.legal h1 { font-size: clamp(25px, 4.5vw, 34px); font-weight: 900; margin-bottom: 6px; }
.legal .updated { color: var(--ink-3); font-size: 13.5px; margin-bottom: 26px; }
.legal h2 {
  font-size: 19px; font-weight: 800; margin: 30px 0 10px;
  padding-inline-start: 12px; border-inline-start: 4px solid var(--brand); line-height: 1.4;
}
.legal h3 { font-size: 16px; font-weight: 800; margin: 18px 0 6px; }
.legal p, .legal li { color: var(--ink-2); font-size: 15.5px; }
.legal ul, .legal ol { margin: 8px 26px 14px; }
.legal li { margin-bottom: 6px; }
.legal strong { color: var(--ink); font-weight: 800; }
.legal .box {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 13px; padding: 16px 18px; margin: 16px 0;
}
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.toc a {
  font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}
.toc a:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- footer ---------- */
.ftr { border-top: 1px solid var(--line); padding: 40px 0 30px; background: var(--surface); }
.ftr-grid { display: flex; justify-content: space-between; gap: 26px; flex-wrap: wrap; margin-bottom: 26px; }
.ftr-links { display: flex; gap: 22px; flex-wrap: wrap; }
.ftr-links a { color: var(--ink-2); font-size: 14.5px; font-weight: 600; }
.ftr-links a:hover { color: var(--brand); }
.ftr-btm {
  border-top: 1px solid var(--line); padding-top: 18px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--ink-3); font-size: 13.5px;
}

@media (max-width: 720px) {
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: 66px; inset-inline: 12px; padding: 10px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 14px; box-shadow: var(--sh-lg);
  }
  .menu-btn { display: block; margin-inline-start: auto; }
  .hero { padding: 48px 0 44px; }
  section { padding: 46px 0; }
  .legal-card { padding: 24px 18px; }
}
