@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800;900&display=swap');

:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --paper: #ffffff;
  --ink: #14182b;
  --text: #252a40;
  --muted: #6d7488;
  --line: rgba(20, 24, 43, 0.09);
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #e8effd;
  --green: #0e9f6e;
  --green-soft: #e3f7ef;
  --amber: #d97706;
  --amber-soft: #fdf1df;
  --red: #dc2626;
  --red-soft: #fdecec;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(20, 24, 43, 0.07);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }

.loader { min-height: 40vh; display: grid; place-items: center; color: var(--muted); font-size: 14px; }

.mini-shell { width: min(100% - 24px, 560px); margin: 0 auto; padding: 16px 0 96px; }

/* hero */
.hero {
  position: relative; overflow: hidden; padding: 22px;
  border-radius: 22px; background: var(--paper);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero:before {
  content: ''; position: absolute; inset-inline-start: -60px; top: -70px;
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, var(--brand-soft), transparent 70%);
}
.brand { display: flex; align-items: center; gap: 12px; position: relative; }
.brand__logo {
  width: 48px; height: 48px; flex: none; display: grid; place-items: center;
  border-radius: 15px; background: linear-gradient(140deg, var(--brand), #38bdf8);
  color: #fff; font-size: 23px; font-weight: 900;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
}
.brand h1 { margin: 0; font-size: 20px; color: var(--ink); font-weight: 800; }
.brand p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.hero__copy { position: relative; margin: 16px 0 0; font-size: 13.5px; line-height: 2.1; color: var(--text); }
.hero__badges { position: relative; display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--brand-dark);
  background: var(--brand-soft); border-radius: 999px; padding: 5px 11px;
}

/* sections */
.section-title { display: flex; justify-content: space-between; align-items: end; margin: 22px 4px 10px; }
.section-title h2 { margin: 0; font-size: 16px; color: var(--ink); font-weight: 800; }
.section-title span { color: var(--muted); font-size: 11.5px; }

.locs { display: flex; flex-wrap: wrap; gap: 8px; }
.loc {
  flex: 1 1 calc(50% - 8px); min-width: 130px; padding: 12px 10px; text-align: center;
  border: 1.5px solid var(--line); border-radius: 13px; background: var(--paper);
  color: var(--text); font-weight: 700; font-size: 13px;
  transition: border-color .15s ease, background .15s ease;
}
.loc--on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }

.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plan {
  text-align: right; padding: 16px 14px; border-radius: var(--radius);
  border: 1.5px solid var(--line); background: var(--paper); color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.plan:active { transform: scale(.98); }
.plan--on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 6px 18px rgba(37, 99, 235, .14); }
.plan b { display: block; font-size: 17px; color: var(--ink); font-weight: 800; }
.plan span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.plan--on span { color: var(--brand-dark); }

.card {
  margin-top: 12px; padding: 18px; border: 1px solid var(--line);
  border-radius: 20px; background: var(--paper); box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 12px; font-size: 15px; color: var(--ink); font-weight: 800; }
.summary-row {
  display: flex; justify-content: space-between; gap: 16px; padding: 10px 0;
  color: var(--muted); font-size: 13px; border-bottom: 1px dashed var(--line);
}
.summary-row:last-of-type { border-bottom: 0; }
.summary-row b { color: var(--ink); font-weight: 700; }

.field { display: grid; gap: 7px; margin-top: 12px; }
.field label { color: var(--muted); font-size: 12px; font-weight: 600; }
.field input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 13px;
  padding: 12px 14px; color: var(--ink); background: var(--bg); outline: none;
}
.field input:focus { border-color: var(--brand); background: #fff; }

.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.btn {
  min-height: 46px; border: 0; border-radius: 13px; padding: 11px 18px;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .24);
  transition: background .15s ease, transform .1s ease;
}
.btn:active { transform: scale(.98); }
.btn:hover { background: var(--brand-dark); }
.btn--wide { width: 100%; }
.btn--line { border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); box-shadow: none; }
.btn--line:hover { background: var(--bg); border-color: var(--brand); }
.btn--danger { background: var(--red-soft); color: var(--red); border: 1px solid rgba(220, 38, 38, .2); box-shadow: none; }

.payment-amount {
  padding: 18px; text-align: center; border-radius: 16px;
  background: var(--brand-soft); border: 1px solid rgba(37, 99, 235, .18);
}
.payment-amount small { display: block; color: var(--brand-dark); font-size: 11.5px; font-weight: 600; }
.payment-amount strong { display: block; margin-top: 5px; font-size: 26px; color: var(--ink); font-weight: 900; }

.copybox {
  display: flex; gap: 8px; align-items: center; justify-content: space-between;
  margin-top: 10px; padding: 12px; border: 1px solid var(--line);
  border-radius: 13px; direction: ltr; background: var(--bg);
  font-size: 13px;
}
.copybox code { overflow-wrap: anywhere; color: var(--ink); }
.copybox button {
  flex: 0 0 auto; border: 0; border-radius: 9px; padding: 7px 11px;
  background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; font-size: 12px;
}

.state { text-align: center; padding: 28px 14px; }
.state__icon {
  width: 68px; height: 68px; display: grid; place-items: center;
  margin: 0 auto 14px; border-radius: 22px;
  background: var(--green-soft); color: var(--green); font-size: 32px; font-weight: 900;
}
.state__icon--warn { background: var(--amber-soft); color: var(--amber); }
.state h2 { margin: 0 0 8px; color: var(--ink); font-size: 18px; }
.state p { color: var(--muted); line-height: 2; font-size: 13.5px; }

.notice {
  margin-top: 12px; padding: 12px 14px; border-radius: 13px;
  background: var(--amber-soft); color: var(--amber);
  border: 1px solid rgba(217, 119, 6, .18); font-size: 12.5px; line-height: 1.9;
}
.error { background: var(--red-soft); color: var(--red); border-color: rgba(220, 38, 38, .18); }

/* service card */
.service {
  margin-top: 10px; padding: 15px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow);
}
.service__head { display: flex; justify-content: space-between; align-items: center; }
.service__head b { color: var(--ink); font-size: 14px; }
.service__head span { font-size: 11px; color: var(--green); background: var(--green-soft); border-radius: 999px; padding: 4px 10px; font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; font-size: 13px; }

/* flash sale banner */
.sale {
  position: relative; overflow: hidden; margin-top: 12px; padding: 16px 18px;
  border-radius: 20px; border: 1px solid rgba(220, 38, 38, .18);
  background: linear-gradient(135deg, #fff5f5, #fff);
  box-shadow: 0 8px 26px rgba(220, 38, 38, .10);
}
.sale__glow {
  position: absolute; inset-inline-end: -50px; top: -60px; width: 170px; height: 170px;
  border-radius: 50%; background: radial-gradient(circle, rgba(251, 146, 60, .30), transparent 70%);
}
.sale__head { position: relative; display: flex; align-items: center; gap: 8px; }
.sale__head b { font-size: 15.5px; color: var(--ink); font-weight: 900; }
.sale__fire { font-size: 19px; animation: saleFlicker 1.8s ease-in-out infinite; }
@keyframes saleFlicker { 0%,100% { transform: scale(1) rotate(-4deg); } 50% { transform: scale(1.16) rotate(4deg); } }
.sale__desc { position: relative; margin: 8px 0 0; font-size: 12.5px; color: var(--muted); line-height: 2; }
.sale__timer { position: relative; margin-top: 13px; }
.sale__label { display: block; font-size: 11px; color: var(--red); font-weight: 700; margin-bottom: 7px; }
.sale__clock { display: flex; gap: 7px; }
.sale__clock i {
  flex: 1; display: grid; place-items: center; gap: 2px; padding: 8px 4px;
  border-radius: 12px; background: #fff; border: 1px solid rgba(220, 38, 38, .15);
  font-style: normal;
}
.sale__clock b { font-size: 17px; font-weight: 900; color: var(--red); font-variant-numeric: tabular-nums; }
.sale__clock small { font-size: 9.5px; color: var(--muted); font-weight: 600; }
.sale--urgent .sale__clock b { animation: salePulse 1s ease-in-out infinite; }
@keyframes salePulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

.plan { position: relative; }
.plan--sale { border-color: rgba(220, 38, 38, .35); }
.plan__badge {
  position: absolute; inset-block-start: -8px; inset-inline-start: 8px;
  font-style: normal; font-size: 10.5px; font-weight: 800; color: #fff;
  background: var(--red); border-radius: 999px; padding: 3px 8px;
  box-shadow: 0 3px 8px rgba(220, 38, 38, .3);
}
.plan del, .summary-row del { color: var(--muted); opacity: .75; }
.sale-text { color: var(--red) !important; }

/* renew shortcut on home */
.renew-cta {
  width: 100%; margin-top: 12px; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 18px; text-align: right;
  border: 1.5px solid var(--line); background: var(--paper); box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .1s ease;
}
.renew-cta:active { transform: scale(.99); }
.renew-cta:hover { border-color: var(--brand); }
.renew-cta__ico {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  border-radius: 13px; background: var(--brand-soft); font-size: 20px;
}
.renew-cta__txt { flex: 1; }
.renew-cta__txt b { display: block; font-size: 14px; color: var(--ink); }
.renew-cta__txt small { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.renew-cta__arrow { color: var(--muted); font-size: 22px; line-height: 1; }

/* traffic usage bar */
.usage {
  height: 10px; border-radius: 999px; background: var(--bg);
  border: 1px solid var(--line); overflow: hidden; margin-top: 12px;
}
.usage i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #38bdf8);
  transition: width .6s cubic-bezier(.22, 1, .36, 1);
}

/* referral */
.ref-hero:before { background: radial-gradient(circle, rgba(56, 189, 248, .28), transparent 70%); }
.ref-ring-card { text-align: center; }
.ref-ring { position: relative; width: 200px; height: 200px; margin: 4px auto 18px; }
.ref-ring__svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ref-ring__track { fill: none; stroke: var(--bg); stroke-width: 16; }
.ref-ring__value {
  fill: none; stroke: url(#refGrad); stroke-width: 16; stroke-linecap: round;
  transition: stroke-dashoffset 1.1s cubic-bezier(.22, 1, .36, 1);
  filter: drop-shadow(0 4px 10px rgba(37, 99, 235, .28));
}
.ref-ring__center {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 3px; text-align: center;
}
.ref-ring__center small { color: var(--muted); font-size: 11px; font-weight: 600; }
.ref-ring__center b { font-size: 26px; color: var(--ink); font-weight: 900; letter-spacing: -.5px; }
.ref-ring__center span { font-size: 11.5px; color: var(--brand-dark); font-weight: 700; }
.ref-claim {
  background: linear-gradient(135deg, var(--brand), #38bdf8);
  animation: refPulse 2.2s ease-in-out infinite;
}
@keyframes refPulse {
  0%, 100% { box-shadow: 0 6px 16px rgba(37, 99, 235, .24); }
  50% { box-shadow: 0 8px 26px rgba(56, 189, 248, .45); }
}
.ref-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 12px; }
.ref-stat {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 8px; text-align: center; box-shadow: var(--shadow);
}
.ref-stat b { display: block; font-size: 16px; color: var(--ink); font-weight: 800; }
.ref-stat span { display: block; margin-top: 4px; font-size: 10.5px; color: var(--muted); font-weight: 600; }
.ref-track { display: grid; gap: 4px; }
.ref-step {
  display: flex; align-items: center; gap: 11px; padding: 11px 4px;
  border-bottom: 1px dashed var(--line); opacity: .55; transition: opacity .3s ease;
}
.ref-step:last-child { border-bottom: 0; }
.ref-step.on { opacity: 1; }
.ref-step i {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  border-radius: 50%; background: var(--bg); color: var(--muted);
  font-style: normal; font-weight: 800; font-size: 13px;
}
.ref-step.on i { background: var(--green-soft); color: var(--green); }
.ref-step b { display: block; font-size: 13px; color: var(--ink); }
.ref-step span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ref-success .state__icon { animation: refPop .5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes refPop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .ref-ring__value { transition: none; }
  .ref-claim, .ref-success .state__icon { animation: none; }
}

/* bottom tab bar */
.tabbar {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 10;
  display: flex; justify-content: center; gap: 6px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
}
.tabbar button {
  flex: 1; max-width: 130px; display: grid; place-items: center; gap: 2px;
  border: 0; background: none; border-radius: 12px; padding: 7px 2px;
  font-size: 10.5px; font-weight: 700; color: var(--muted); line-height: 1.3;
}
.tabbar button.on { color: var(--brand-dark); background: var(--brand-soft); }
.tabbar .ico { font-size: 18px; line-height: 1; }

.toast {
  position: fixed; inset-inline: 0; bottom: 76px; margin: 0 auto; width: fit-content;
  max-width: min(90vw, 360px); padding: 11px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 13px; z-index: 30;
  box-shadow: 0 10px 30px rgba(20, 24, 43, .25); text-align: center;
}
.code { direction: ltr; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
