/* ════════════════════════════════════════════════
   AriaGet — استایل (دارک / مدرن / RTL)
   ════════════════════════════════════════════════ */

:root {
  --bg: #05070d;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-hi: rgba(255, 255, 255, 0.16);
  --text: #e8ebf4;
  --muted: #8b93a9;
  --indigo: #6366f1;
  --violet: #a855f7;
  --cyan: #22d3ee;
  --green: #34d399;
  --red: #f87171;
  --grad: linear-gradient(120deg, #6366f1, #a855f7 55%, #22d3ee);
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: dark; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.8;
  overflow-x: hidden;
}

/* ── پس‌زمینهٔ زنده ── */
.bg-blob {
  position: fixed; z-index: -2; border-radius: 50%;
  filter: blur(130px); opacity: .22; pointer-events: none;
}
.blob-a { width: 560px; height: 560px; background: #6d28d9; top: -180px; inset-inline-end: -140px; animation: float 16s ease-in-out infinite; }
.blob-b { width: 480px; height: 480px; background: #0e7490; bottom: -160px; inset-inline-start: -120px; animation: float 20s ease-in-out infinite reverse; }

.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 35px) scale(1.12); }
}

/* ── کارت پایه ── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  padding: 26px;
}

/* ── لوگو ── */
.logo-row { display: flex; align-items: center; gap: 14px; }
.logo-svg { filter: drop-shadow(0 4px 18px rgba(139, 92, 246, .5)); flex: none; }
.brand { font-size: 24px; font-weight: 800; letter-spacing: .5px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; direction: ltr; }
.brand-sub { color: var(--muted); font-size: 13px; margin-top: -4px; }

/* ═══════════ صفحهٔ ورود ═══════════ */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; animation: rise .5s ease both; }
.login-lead { color: var(--muted); margin: 18px 0 4px; font-size: 14px; }
.foot-note { color: var(--muted); font-size: 12px; margin-top: 18px; opacity: .8; }

/* ── فیلدها ── */
.field { display: block; margin: 14px 0; }
.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.input-group { display: flex; gap: 10px; align-items: stretch; }

input[type="url"], input[type="text"], input[type="password"] {
  flex: 1; width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  padding: 12px 16px;
  transition: border-color .2s, box-shadow .2s;
}
input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, .65);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, .13);
}
input.input-error { border-color: rgba(248, 113, 113, .6); }
input::placeholder { color: #59617a; }

.login-card .input-group { position: relative; }
.login-card input { padding-inline-end: 48px; }
.eye-btn {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 8px; border-radius: 10px; display: grid; place-items: center;
}
.eye-btn:hover { color: var(--text); background: var(--panel-strong); }

/* ── دکمه‌ها ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: inherit; font-size: 14.5px; font-weight: 600;
  border-radius: 12px; border: 1px solid transparent;
  padding: 12px 22px; cursor: pointer;
  transition: transform .15s, box-shadow .25s, background .25s, border-color .2s;
  text-decoration: none; color: var(--text);
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--grad);
  background-size: 160% 160%;
  color: #fff;
  box-shadow: 0 8px 28px rgba(99, 102, 241, .35);
}
.btn-primary:hover { box-shadow: 0 10px 38px rgba(139, 92, 246, .55); background-position: 100% 50%; }

.btn-outline { background: transparent; border-color: var(--border-hi); }
.btn-outline:hover { background: var(--panel-strong); border-color: rgba(139,92,246,.5); }

.btn-ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--panel-strong); }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 15px 30px; font-size: 16px; }
.btn-block { width: 100%; margin-top: 6px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ── اسپینر ── */
.spinner {
  width: 17px; height: 17px; flex: none;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── هشدارها ── */
.alert { border-radius: 12px; padding: 11px 15px; font-size: 13.5px; margin-top: 12px; }
.alert-error { background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .35); color: #fca5a5; }

.hint { color: var(--muted); font-size: 12.5px; margin-top: 12px; }
.hint code { background: var(--panel-strong); padding: 2px 7px; border-radius: 6px; font-size: 12px; direction: ltr; display: inline-block; }

/* ═══════════ پنل اصلی ═══════════ */
.topbar {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  background: rgba(5, 7, 13, .7);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 860px; margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar .brand { font-size: 20px; }
.topbar .brand-sub { font-size: 11.5px; }

.app-wrap { max-width: 860px; margin: 0 auto; padding: 34px 22px 60px; display: flex; flex-direction: column; gap: 22px; }

.hero { text-align: center; padding: 12px 0 4px; }
.hero h2 {
  font-size: clamp(21px, 3.4vw, 30px); font-weight: 800; line-height: 1.6;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); max-width: 560px; margin: 10px auto 0; font-size: 14.5px; }
.hero b { color: var(--text); }

/* ── چیپ‌های سرویس ── */
.chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--border);
  padding: 7px 16px; border-radius: 100px; font-size: 13px; color: var(--muted);
  backdrop-filter: blur(10px);
}
.chip svg { flex: none; }

/* ── کارت ورودی ── */
.input-card .input-group { flex-wrap: wrap; }
.input-card input[type="url"] { min-width: 240px; }

/* ── کارت نتیجه ── */
.result-card { border-color: rgba(139, 92, 246, .3); animation: rise .45s ease both; position: relative; overflow: hidden; }
.result-card::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 3px;
  background: var(--grad); border-radius: 3px;
}
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }

.service-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; padding: 5px 14px; border-radius: 100px;
  background: rgba(99, 102, 241, .13); border: 1px solid rgba(99, 102, 241, .4); color: #b9bffc;
}
.file-type { color: var(--muted); font-size: 12px; direction: ltr; }

.meta-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0 4px; }
.meta-item {
  background: rgba(0, 0, 0, .3); border: 1px solid var(--border);
  border-radius: 13px; padding: 13px 17px;
}
.meta-label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.meta-value { font-size: 16px; font-weight: 700; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.actions .btn-primary { flex: 1; min-width: 200px; }

.copy-hint { margin-top: 14px; }

/* ── ویژگی‌ها ── */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.feat {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 16px; font-size: 13px; color: var(--muted);
  backdrop-filter: blur(10px); transition: border-color .2s, transform .2s;
}
.feat:hover { border-color: var(--border-hi); transform: translateY(-2px); color: var(--text); }
.feat svg { flex: none; }

/* ── دانلودهای اخیر ── */
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.recent-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.recent-item {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--border);
  border-radius: 13px; padding: 11px 15px; font-size: 13.5px;
}
.recent-name { font-weight: 600; flex: 1; min-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-meta { color: var(--muted); font-size: 12px; display: flex; gap: 10px; align-items: center; }
.recent-dl {
  color: #b9bffc; text-decoration: none; font-size: 12.5px; font-weight: 700;
  background: rgba(99, 102, 241, .13); border: 1px solid rgba(99, 102, 241, .4);
  padding: 5px 13px; border-radius: 9px; cursor: pointer; font-family: inherit;
}
.recent-dl:hover { background: rgba(99, 102, 241, .28); }
.recent-empty { color: var(--muted); font-size: 13px; }

/* ── فوتر ── */
.app-footer { text-align: center; color: var(--muted); font-size: 12.5px; opacity: .85; padding-top: 6px; }

/* ── توست ── */
.toast-stack {
  position: fixed; bottom: 22px; inset-inline-start: 50%; transform: translateX(50%);
  display: flex; flex-direction: column; gap: 10px; z-index: 100; width: min(92vw, 420px);
}
.toast {
  background: rgba(18, 22, 34, .92);
  border: 1px solid var(--border-hi);
  border-radius: 13px; padding: 13px 18px; font-size: 13.5px;
  backdrop-filter: blur(14px); box-shadow: var(--shadow);
  animation: toast-in .3s ease both; text-align: center;
}
.toast-error { border-color: rgba(248, 113, 113, .45); color: #fca5a5; }
.toast-success { border-color: rgba(52, 211, 153, .45); color: #6ee7b7; }
.toast.hide { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* ── انیمیشن ورود ── */
.reveal { animation: rise .55s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

@media (max-width: 560px) {
  .card { padding: 20px; }
  .actions { flex-direction: column; }
  .actions .btn-primary { min-width: 0; }
  .topbar-inner { padding: 12px 16px; }
  .app-wrap { padding: 24px 14px 50px; }
}

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