/* دانلودر آنلاین — design system (modern card UI, RTL) */

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

:root {
  --bg: #f4f5fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --g1: #6366f1;
  --g2: #a855f7;
  --grad: linear-gradient(135deg, var(--g1), var(--g2));
  --ok: #15803d;
  --shadow: 0 12px 34px rgba(15, 23, 42, .10);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(168, 85, 247, .14), transparent 60%),
    radial-gradient(900px 420px at 10% -10%, rgba(99, 102, 241, .16), transparent 60%),
    var(--bg);
  color: var(--ink);
  margin: 0;
  padding: 16px;
  line-height: 1.95;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 940px; margin: 0 auto; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 10px; z-index: 50;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px 14px;
  margin: 0 0 22px;
  box-shadow: 0 6px 22px rgba(15, 23, 42, .06);
}
.logo { font-weight: 800; font-size: 1.02rem; margin-inline-end: auto;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: .86rem;
  padding: 6px 14px; border-radius: 99px; transition: all .15s;
}
.nav a:hover { color: var(--ink); background: #eef0ff; }
.nav a.cur { color: #fff; background: var(--grad); font-weight: 600; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 26px 10px 8px; }
.hero h1 { font-size: 1.75rem; font-weight: 800; margin: 0 0 6px; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { color: var(--muted); font-size: .95rem; margin: 0 0 14px; }
.chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.chip {
  background: #fff; border: 1px solid var(--line); border-radius: 99px;
  padding: 4px 16px; font-size: .82rem; color: #475569;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
}

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 18px 0;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 1.05rem; margin: 0 0 12px; }

/* ---------- inputs & buttons ---------- */
label { display: block; margin: 10px 0 4px; font-size: .85rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url] {
  width: 100%;
  direction: ltr; text-align: left;
  background: #f8fafc;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  padding: 12px 14px;
  font-size: 16px; /* prevents iOS zoom */
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus { outline: none; border-color: var(--g1); box-shadow: 0 0 0 4px rgba(99, 102, 241, .14); }

button, .btn-grad {
  display: inline-block;
  background: var(--grad); color: #fff;
  border: 0; border-radius: 12px;
  padding: 11px 26px; cursor: pointer;
  font-family: inherit; font-size: .95rem; font-weight: 600;
  transition: transform .12s, box-shadow .12s, opacity .12s;
  text-decoration: none; margin-top: 10px;
}
button:hover, .btn-grad:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(99, 102, 241, .35); }
button:disabled { opacity: .6; cursor: wait; transform: none; }
button.gray, a.gray { background: #eef0f6; color: #475569; }
button.green { background: linear-gradient(135deg, #22c55e, #16a34a); }
button.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.btn-grad { padding: 9px 20px; font-size: .88rem; margin-top: 0; }

/* ---------- downloader card ---------- */
.dl-card { padding: 26px 28px; }
.dl-row { display: flex; gap: 10px; }
.dl-row input { flex: 1; }
.dl-row button { margin-top: 0; white-space: nowrap; }
.usage-line { font-size: .82rem; color: var(--muted); margin-top: 10px; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
  vertical-align: -3px; margin-inline-end: 6px;
}

/* ---------- results ---------- */
.res-item {
  display: flex; align-items: center; gap: 12px;
  background: #f8fafc; border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 16px; margin: 10px 0;
}
.icon-badge {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.25rem;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  border: 1px solid #e0e7ff;
}
.res-info { flex: 1; min-width: 0; }
.res-info b { display: block; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-info small { color: var(--muted); }

/* ---------- misc blocks ---------- */
.err { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 12px; padding: 10px 14px; margin: 12px 0; font-size: .88rem; }
.note { background: #eef2ff; border: 1px solid #dbe2ff; color: #3f4c8c; border-radius: 12px; padding: 10px 14px; margin: 12px 0; font-size: .84rem; }
.good { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; border-radius: 12px; padding: 10px 14px; margin: 12px 0; font-size: .85rem; }

.b { font-size: .72rem; font-weight: bold; border-radius: 6px; padding: 2px 8px; display: inline-block; }
.ok { background: #dcfce7; color: #15803d; }
.warn { background: #fef9c3; color: #a16207; }
.fail { background: #fee2e2; color: #b91c1c; }
.info { background: #dbeafe; color: #1d4ed8; }

small { color: var(--muted); font-size: .78rem; display: block; word-break: break-all; }
code { background: #f1f5f9; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .8rem; direction: ltr; unicode-bidi: embed; display: inline-block; }
a { color: var(--g1); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- tables (panel/admin) ---------- */
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
td.dir { direction: ltr; text-align: left; word-break: break-all; max-width: 320px; }

.item {
  display: flex; align-items: center; gap: 12px;
  background: #f8fafc; border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 14px; margin: 8px 0; font-size: .88rem;
}
.item a { white-space: nowrap; }

/* ---------- sponsors ---------- */
.sponsor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.sponsor {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #fefce8, #fdf4ff);
  border: 1px solid #f0e6ff; border-radius: 14px;
  padding: 12px 16px; color: #6d28d9; font-weight: 600; font-size: .9rem;
  text-decoration: none; transition: transform .12s, box-shadow .12s;
}
.sponsor:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(168, 85, 247, .18); }

/* ---------- FAQ ---------- */
.faq details { border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; margin: 10px 0; background: #f8fafc; }
.faq summary { cursor: pointer; font-weight: 600; padding: 10px 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; left: 4px; top: 8px; font-size: 1.2rem; color: var(--g1); }
.faq details[open] summary::after { content: '−'; }
.faq details p { margin: 0 0 12px; color: #475569; font-size: .9rem; }

/* ---------- footer ---------- */
.foot { text-align: center; color: #94a3b8; font-size: .8rem; padding: 18px 0 6px; }
.foot a { color: #94a3b8; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  body { padding: 12px; font-size: 14px; }
  .hero h1 { font-size: 1.28rem; }
  .hero .sub { font-size: .86rem; }
  .card { padding: 16px; }
  .dl-card { padding: 18px; }
  .dl-row { flex-direction: column; }
  .dl-row button { width: 100%; }
  .res-item { flex-wrap: wrap; }
  .res-item .btn-grad { width: 100%; text-align: center; }
  .nav { gap: 4px; padding: 8px 10px; }
  .nav a { padding: 5px 10px; font-size: .8rem; }
  th, td { padding: 6px 6px; }
}

/* ---------- dashboard / panels v2 ---------- */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.45rem; font-weight: 800; }
.stat span { color: var(--muted); font-size: .78rem; }

.bar { height: 10px; background: #eef0f6; border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.bar > div { height: 100%; background: var(--grad); border-radius: 99px; transition: width .3s; }
.bar > div.full { background: linear-gradient(135deg, #22c55e, #16a34a); }

.plan-card { position: relative; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.plan-card.cur { border-color: var(--g1); box-shadow: 0 0 0 3px rgba(99, 102, 241, .22); }
.plan-card .pname { font-weight: 800; font-size: 1rem; }
.plan-card .price { font-size: 1.25rem; font-weight: 800; color: var(--g1); }
.plan-card .per { color: var(--muted); font-size: .76rem; }
.plan-card .curbadge { position: absolute; top: 10px; left: 10px; }
.plan-card form { margin-top: auto; }
.plan-card .btn-grad, .plan-card button { width: 100%; margin-top: 12px; }
.plan-card .feat { font-size: .8rem; color: #475569; margin: 2px 0; }

.pay-card { background: #f8fafc; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 10px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pay-card code { font-size: 1rem; letter-spacing: 2px; }
.copybtn { border: 0; background: var(--g1); color: #fff; border-radius: 8px; padding: 6px 14px; cursor: pointer; font-family: inherit; font-size: .78rem; margin: 0; }
.copybtn:hover { background: #1d4ed8; }

.amount { font-size: 1.35rem; font-weight: 800; color: var(--g2); }

.statusline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.inline-form { display: inline-block; }

@media (max-width: 640px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
