/* ════════════════════════════════════════════════════════════════
   آی‌ریپورت — سیستم طراحی پنل (RTL فارسی)
   مدرن، سبک (~۱۴KB)، حالت روشن/تیره، فونت Vazirmatn خودمیزبان.
   ════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700; font-display: swap;
}

:root {
  --bg: #f6f7fb;
  --bg-tint: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --border: #e6e9f0;
  --border-strong: #d3d8e3;
  --text: #141824;
  --text-2: #47506a;
  --muted: #7c869c;
  --brand: #4f46e5;
  --brand-2: #7c6cf6;
  --brand-ink: #ffffff;
  --accent: #0fb894;
  --accent-soft: #e7f8f2;
  --ok: #0f9d58;
  --warn: #e08a1e;
  --danger: #e23b4e;
  --radius: 14px;
  --radius-sm: 10px;
  --ring: rgba(79, 70, 229, .35);
  --shadow-sm: 0 1px 2px rgba(20, 24, 40, .04), 0 1px 3px rgba(20, 24, 40, .06);
  --shadow: 0 4px 12px rgba(20, 24, 40, .06), 0 2px 4px rgba(20, 24, 40, .04);
  --shadow-lg: 0 18px 40px -12px rgba(30, 30, 80, .22);
  --grad: linear-gradient(135deg, #4f46e5 0%, #7c6cf6 55%, #0fb894 140%);
  --grad-soft: linear-gradient(135deg, #eef0ff 0%, #eafaf5 100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1016;
    --bg-tint: #12161f;
    --surface: #161b25;
    --surface-2: #1b212d;
    --border: #262d3b;
    --border-strong: #333c4d;
    --text: #eef1f7;
    --text-2: #b7c0d4;
    --muted: #8a94ab;
    --brand: #8b83ff;
    --brand-2: #a99cff;
    --accent: #2fd3ac;
    --accent-soft: #12312a;
    --ring: rgba(139, 131, 255, .4);
    --shadow-sm: none;
    --shadow: 0 6px 18px rgba(0, 0, 0, .35);
    --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, .6);
    --grad-soft: linear-gradient(135deg, #1a1f3a 0%, #12312a 100%);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 100% -10%, var(--bg-tint), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', Vazir, 'Segoe UI', Tahoma, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.8;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-2); }
h1, h2, h3 { line-height: 1.35; letter-spacing: -.01em; }
::selection { background: var(--brand); color: #fff; }

/* ── چیدمان ── */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 480px; margin-inline: auto; }
main { padding: 34px 0 72px; }

/* ── هدر شیشه‌ای ── */
header.top {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
header.top .wrap { display: flex; align-items: center; gap: 22px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--text); }
.logo:hover { color: var(--text); }
.logo::before {
  content: "📊"; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad); box-shadow: 0 4px 12px -2px var(--ring); font-size: 17px;
}
nav.main { display: flex; gap: 6px; margin-inline-start: auto; align-items: center; }
nav.main a { color: var(--text-2); font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 9px; transition: background .15s, color .15s; }
nav.main a:hover { background: var(--surface-2); color: var(--text); }
nav.main a.active { background: var(--bg-tint); color: var(--brand); }

/* ── کارت ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 24px; margin-bottom: 20px;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card h2 { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.card h2 + p.sub { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }

.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ── فرم ── */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--text-2); }
input[type=text], input[type=tel], input[type=email], input[type=number], select, textarea {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 15px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); background: var(--surface); }
.field { margin-bottom: 18px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
input.ltr { direction: ltr; text-align: left; font-family: ui-monospace, monospace; }
input.otp { letter-spacing: .55em; text-align: center; font-size: 24px; font-weight: 700; padding-inline-start: .55em; }

/* ── دکمه ── */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 22px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--grad); background-size: 140% 140%; color: var(--brand-ink);
  font: inherit; font-weight: 600; font-size: 14.5px; cursor: pointer;
  box-shadow: 0 6px 16px -6px var(--ring);
  transition: transform .12s, box-shadow .2s, background-position .3s;
}
button:hover, .btn:hover { transform: translateY(-1px); background-position: 100% 0; box-shadow: 0 10px 22px -8px var(--ring); color: #fff; }
button:active, .btn:active { transform: translateY(0); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.block { display: flex; width: 100%; }
.btn.sm { padding: 8px 15px; font-size: 13px; }

/* ── پیام ── */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; border: 1px solid; font-size: 14px; }
.alert.err  { background: #fdecee; border-color: #f6c4ca; color: #a01526; }
.alert.ok   { background: var(--accent-soft); border-color: #b6e6d6; color: #0a6b4c; }
.alert.warn { background: #fdf3e3; border-color: #f2d9ab; color: #8a5410; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .alert.err  { background: #3a1b20; border-color: #6e2c36; color: #f4b6bf; }
  :root:not([data-theme="light"]) .alert.ok   { background: #12312a; border-color: #2c5c4b; color: #86e4c4; }
  :root:not([data-theme="light"]) .alert.warn { background: #33260f; border-color: #6b501c; color: #f0cd8c; }
}

/* ── آمار ── */
.stat { text-align: center; padding: 20px 12px; }
.stat .n { font-size: 30px; font-weight: 800; line-height: 1.25; letter-spacing: -.02em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat .l { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.meter { height: 9px; border-radius: 999px; background: var(--bg-tint); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--grad); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.meter.warn > i { background: linear-gradient(90deg, #e0a11e, #e08a1e); }
.meter.over > i { background: linear-gradient(90deg, #e23b4e, #f0616f); }

/* ── جدول ── */
.table-scroll { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--border); }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.num { direction: ltr; text-align: left; font-variant-numeric: tabular-nums; }

/* ── نشان ── */
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ok    { background: var(--accent-soft); color: #0a6b4c; }
.badge.warn  { background: #fdf3e3; color: #8a5410; }
.badge.err   { background: #fdecee; color: #a01526; }
.badge.muted { background: var(--bg-tint); color: var(--muted); }

/* ── پلن‌ها ── */
.plan { position: relative; display: flex; flex-direction: column; }
.plan.featured {
  box-shadow: var(--shadow-lg);
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box;
  border: 2px solid transparent;
}
.plan .price { font-size: 30px; font-weight: 800; margin: 12px 0 2px; letter-spacing: -.02em; }
.plan .per { font-size: 13px; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 18px 0; flex: 1; font-size: 14px; }
.plan li { padding-inline-start: 26px; position: relative; margin-bottom: 10px; color: var(--text-2); }
.plan li::before {
  content: "✓"; position: absolute; inset-inline-start: 0; top: 2px;
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700;
}
.ribbon {
  position: absolute; top: -12px; inset-inline-start: 22px;
  background: var(--grad); color: #fff; font-size: 11px; font-weight: 700;
  padding: 4px 13px; border-radius: 999px; box-shadow: 0 6px 14px -4px var(--ring);
}

/* ── قطعه کد ── */
pre.code {
  direction: ltr; text-align: left; background: #0e1220; color: #d7def0;
  padding: 18px; border-radius: var(--radius-sm); overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.7;
  border: 1px solid #1c2438;
}

/* ── تبلیغ ── */
.ad { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 18px; background: var(--surface-2); }
.ad .tag { font-size: 10px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.ad h3 { margin: 0 0 4px; font-size: 15px; }
.ad p { margin: 0 0 12px; font-size: 13px; color: var(--muted); }

/* ── فوتر ── */
footer.bottom { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: 13px; margin-top: 20px; }
footer.bottom .wrap { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
footer.bottom a { color: var(--muted); }
footer.bottom a:hover { color: var(--brand); }

/* ── صفحه فرود ── */
.hero {
  position: relative; padding: 72px 24px 52px; text-align: center; overflow: hidden;
  border-radius: 24px; margin: 8px 0 34px; background: var(--grad-soft); border: 1px solid var(--border);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; opacity: .55;
  background:
    radial-gradient(420px 220px at 15% 0%, rgba(79,70,229,.18), transparent 70%),
    radial-gradient(420px 220px at 85% 100%, rgba(15,184,148,.16), transparent 70%);
}
.hero > * { position: relative; z-index: 1; }
.hero .pill {
  display: inline-block; margin-bottom: 18px; padding: 6px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600; color: var(--brand);
}
.hero h1 { font-size: 40px; margin: 0 0 14px; font-weight: 800; letter-spacing: -.03em; }
.hero h1 .g { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 17.5px; color: var(--text-2); max-width: 640px; margin: 0 auto 28px; line-height: 1.85; }

details { border-top: 1px solid var(--border); padding: 14px 2px; }
details summary { cursor: pointer; font-weight: 600; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "＋ "; color: var(--brand); font-weight: 700; }
details[open] summary::before { content: "－ "; }

code { background: var(--bg-tint); padding: 1px 6px; border-radius: 6px; font-size: 13px; font-family: ui-monospace, monospace; direction: ltr; display: inline-block; }

/* ── واکنش‌گرا ── */
@media (max-width: 720px) {
  .hero { padding: 52px 18px 40px; border-radius: 18px; }
  .hero h1 { font-size: 29px; }
  .hero p { font-size: 16px; }
  header.top .wrap { gap: 10px; height: 58px; }
  nav.main { gap: 2px; }
  nav.main a { padding: 7px 9px; font-size: 13px; }
  .logo { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
