@font-face {
  font-family: "Vazirmatn";
  src: url("fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --fg: #e8ebe7;
  --dim: rgba(232, 235, 231, .64);
  --faint: rgba(232, 235, 231, .4);
  --line: rgba(232, 235, 231, .3);
  --line-hi: rgba(232, 235, 231, .78);
  --glass: rgba(9, 12, 11, .38);
  --bg: #0b0e0d;
  --ok: #b9d8c2;
  --err: #f0b4a8;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- جنگل مه‌آلود ---------- */
.scene { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(70% 45% at 50% 16%, rgba(176, 190, 184, .30), transparent 70%),
    radial-gradient(120% 80% at 50% 24%, #3a4441 0%, #222a28 40%, #121615 70%, #080a0a 100%);
}
.trees {
  position: absolute; left: 0; right: 0; bottom: 0;
  background-repeat: repeat-x;
  background-position: bottom center;
  background-size: auto 100%;
}
.trees.haze { height: 64vh; background-image: url("forest-haze.svg"); opacity: .32; filter: blur(3px); background-position: 12% 100%; }
.trees.far  { height: 68vh; background-image: url("forest-far.svg");  opacity: .55; filter: blur(1.8px); }
.trees.mid  { height: 60vh; background-image: url("forest-mid.svg");  opacity: .92; filter: blur(.6px); background-position: 37% 100%; }
.trees.near { height: 62vh; background-image: url("forest-near.svg"); background-position: 50% 100%; }
.ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 38vh;
  background: linear-gradient(to top, rgba(120, 133, 129, .30), rgba(120, 133, 129, .12) 40%, transparent);
}
.fog {
  position: absolute; left: -50%; width: 200%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(205, 216, 211, .17), transparent 72%);
  animation: drift 70s ease-in-out infinite alternate;
}
.fog.f1 { bottom: 34vh; height: 34vh; }
.fog.f2 { bottom: 14vh; height: 30vh; animation-duration: 90s; animation-direction: alternate-reverse; opacity: .9; }
.fog.f3 {
  bottom: -8vh; height: 34vh; animation-duration: 110s;
  background: radial-gradient(55% 50% at 50% 60%, rgba(205, 216, 211, .13), transparent 75%);
}
.scene::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(8, 10, 10, .15), rgba(8, 10, 10, 0) 30%, rgba(8, 10, 10, .55) 100%),
              radial-gradient(130% 100% at 50% 40%, transparent 55%, rgba(4, 5, 5, .75) 100%);
}
.grain {
  position: absolute; inset: -50%; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes drift { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
@media (prefers-reduced-motion: reduce) { .fog { animation: none; } }

/* ---------- قاب ---------- */
.wrap {
  position: relative; z-index: 1;
  width: min(360px, 100% - 40px);
  min-height: 100vh; min-height: 100svh;
  margin: 0 auto;
  padding: max(9vh, 48px) 0 28px;
  display: flex; flex-direction: column; align-items: stretch;
}
.wrap.wide { width: min(520px, 100% - 32px); }

.brand { text-align: center; margin-bottom: 7vh; animation: rise .9s ease-out both; }
.brand a { display: inline-block; color: var(--fg); }
.mark { width: 46px; height: 40px; display: block; margin: 0 auto 18px; }
.word {
  margin: 0; direction: ltr;
  font-weight: 200; font-size: clamp(28px, 7.5vw, 36px);
  letter-spacing: .58em; padding-left: .58em; line-height: 1.2;
}
.tag { margin: 10px 0 0; color: var(--dim); font-size: 13px; font-weight: 300; letter-spacing: .04em; }
.brand.small { margin-bottom: 5vh; }
.brand.small .mark { width: 34px; height: 30px; margin-bottom: 12px; }
.brand.small .word { font-size: 24px; }
.brand.small .tag { display: none; }

.step { animation: rise .7s .15s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- دکمه‌ها ---------- */
.list { display: flex; flex-direction: column; gap: 12px; }
.btn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 54px; padding: 12px 20px;
  border: 1px solid var(--line); border-radius: 2px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  color: var(--fg); font: inherit; font-size: 15px; font-weight: 400; letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  transition: border-color .25s, background .25s, transform .25s;
}
.btn:hover { border-color: var(--line-hi); background: rgba(232, 235, 231, .07); }
.btn:active { transform: scale(.99); }
.btn:focus-visible, .field:focus-visible, .link:focus-visible, .plan:focus-visible, .x:focus-visible {
  outline: 1px solid var(--fg); outline-offset: 3px;
}
.btn .price { color: var(--dim); font-size: 13px; font-weight: 300; white-space: nowrap; }
.btn.solid {
  justify-content: center; background: rgba(232, 235, 231, .9); color: #0d1110;
  border-color: transparent; font-weight: 500;
}
.btn.solid:hover { background: #fff; }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn.copy { justify-content: center; min-height: 44px; font-size: 14px; }
a.btn { justify-content: center; margin-top: 18px; }

.link { background: none; border: 0; padding: 0; color: var(--dim); font: inherit; font-size: 13px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--faint); }
.link:hover { color: var(--fg); }

/* ---------- فرم ---------- */
.lbl { display: block; color: var(--dim); font-size: 13px; margin-bottom: 10px; text-align: center; }
.field {
  width: 100%; height: 54px; padding: 0 16px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: 2px;
  background: var(--glass); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  color: var(--fg); font: inherit; font-size: 18px; letter-spacing: .12em; text-align: center;
  transition: border-color .25s;
}
.field::placeholder { color: var(--faint); letter-spacing: .08em; }
.field:focus { border-color: var(--line-hi); outline: none; }
.field.code { letter-spacing: .5em; padding-left: calc(16px + .5em); }
.note { color: var(--dim); font-size: 12.5px; text-align: center; margin: 14px 0 0; font-weight: 300; }
.note.small { font-size: 11.5px; color: var(--faint); }
.err { color: var(--err); font-size: 13px; text-align: center; margin: 10px 0 0; min-height: 1em; }
.err:empty { margin: 0; min-height: 0; }
.ok { color: var(--ok); }
.who { text-align: center; color: var(--faint); font-size: 12.5px; margin: 18px 0 0; direction: rtl; }
#login .link { display: block; margin: 14px auto 0; }

/* ---------- پایین صفحه ---------- */
.foot {
  margin-top: auto; padding-top: 48px;
  display: flex; justify-content: center; gap: 12px;
  font-size: 12.5px; color: var(--faint);
}
.foot a { color: var(--dim); text-decoration: none; }
.foot a:hover { color: var(--fg); }
.foot i { font-style: normal; }

/* ---------- انتخاب یکجا / قسطی ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(4, 6, 6, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .25s;
}
.sheet.on { opacity: 1; }
.panel {
  position: relative; width: min(420px, 100%);
  padding: 34px 26px 22px;
  background: rgba(16, 20, 19, .94); border: 1px solid var(--line); border-radius: 3px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  transform: translateY(14px); transition: transform .3s ease-out;
}
.sheet.on .panel { transform: none; }
.panel h2 { margin: 0 0 20px; font-size: 17px; font-weight: 500; text-align: center; line-height: 1.6; }
.x { position: absolute; top: 8px; left: 10px; width: 36px; height: 36px; border: 0; background: none;
  color: var(--dim); font-size: 24px; line-height: 1; cursor: pointer; }
.x:hover { color: var(--fg); }
.plans { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.plan {
  display: block; width: 100%; text-align: right; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 2px; background: transparent;
  color: var(--fg); font: inherit; cursor: pointer; transition: border-color .2s, background .2s;
}
.plan:hover { border-color: var(--line-hi); }
.plan.on { border-color: var(--fg); background: rgba(232, 235, 231, .07); }
.plan .head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.plan .head b { font-weight: 500; }
.plan .head span { font-size: 14px; }
.plan .sub { display: block; margin-top: 4px; color: var(--dim); font-size: 12.5px; font-weight: 300; }
.plan .head b::before {
  content: ""; display: inline-block; width: 9px; height: 9px; margin-left: 10px;
  border: 1px solid var(--dim); border-radius: 50%; vertical-align: 1px;
}
.plan.on .head b::before { background: var(--fg); border-color: var(--fg); }
.panel .btn.solid { margin-top: 16px; }

/* ---------- سفارش و لایسنس ---------- */
.card {
  position: relative; z-index: 1; margin-bottom: 14px; padding: 24px 22px;
  background: rgba(12, 15, 14, .7); border: 1px solid var(--line); border-radius: 3px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: rise .6s ease-out both;
}
.card h2 { margin: 0 0 4px; font-size: 17px; font-weight: 500; line-height: 1.6; }
.card h2 a { text-decoration: none; }
.card .meta { margin: 0 0 14px; color: var(--faint); font-size: 12.5px; direction: ltr; text-align: right; }
.card .state { color: var(--dim); font-size: 14px; margin: 10px 0; }
.card .ok, .card .err { text-align: right; font-size: 14px; }
.lic { margin: 16px 0 6px; }
.lic .lbl { text-align: right; margin-bottom: 6px; }
.lic code {
  display: block; padding: 12px 14px; margin-bottom: 10px;
  background: rgba(0, 0, 0, .35); border: 1px dashed var(--line); border-radius: 2px;
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 1.6;
  direction: ltr; text-align: left; word-break: break-all; user-select: all;
}
.how { color: var(--dim); font-size: 13px; margin-top: 16px; }
.how p { margin: 0 0 10px; }
.dl { display: flex; flex-wrap: wrap; gap: 8px; }
.dl a { flex: 1 1 auto; text-align: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 2px;
  text-decoration: none; color: var(--fg); font-size: 13px; }
.dl a:hover { border-color: var(--line-hi); }
.next { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(232, 235, 231, .12); }
.next p { margin: 0 0 12px; font-size: 14px; }
.next b { font-weight: 500; }
.wrap > .who { margin: -2vh 0 18px; }

@media (max-width: 420px) {
  body { font-size: 14.5px; }
  .brand { margin-bottom: 6vh; }
  .sheet { align-items: flex-end; padding: 0; }
  .panel { width: 100%; border-radius: 10px 10px 0 0; border-bottom: 0; padding-bottom: max(22px, env(safe-area-inset-bottom)); }
}

.list a.btn { margin-top: 0; }
