/* =====================================================================
   WebStudio — base design system (shared by all sites & demos)
   No build step, no framework. Colors are driven by CSS variables so
   every demo template can re-skin itself (--c1 / --c2).
   ===================================================================== */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn.woff2") format("woff2-variations"), url("../fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --c1: #4f46e5;
  --c2: #06b6d4;
  --c1-soft: color-mix(in srgb, var(--c1) 10%, #fff);
  --c1-ink: color-mix(in srgb, var(--c1) 70%, #000);
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e7eaf0;
  --line-2: #f1f3f7;
  --bg: #ffffff;
  --bg-2: #f7f8fb;
  --ok: #059669;
  --warn: #d97706;
  --err: #dc2626;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 22px;
  --r-xl: 30px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 1px rgba(15, 23, 42, .03);
  --sh-2: 0 10px 30px -12px rgba(15, 23, 42, .18), 0 4px 10px -6px rgba(15, 23, 42, .08);
  --sh-3: 0 30px 60px -20px rgba(15, 23, 42, .28);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --container: 1240px;
  --font: "Vazirmatn", Tahoma, "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.85; color: var(--ink);
  background: var(--bg); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, h5 { margin: 0 0 .5em; line-height: 1.45; font-weight: 800; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
::selection { background: color-mix(in srgb, var(--c1) 25%, transparent); }
:focus-visible { outline: 2px solid var(--c1); outline-offset: 2px; border-radius: 6px; }
.i { width: 20px; height: 20px; flex-shrink: 0; }
.ltr { direction: ltr; unicode-bidi: embed; }
.hp { position: absolute !important; right: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.cur { font-size: .78em; font-weight: 500; opacity: .75; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.container.narrow { max-width: 860px; }
.section { padding-block: 72px; }
.section.sm { padding-block: 48px; }
.grid { display: grid; gap: 22px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.flex { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 8px } .mt-2 { margin-top: 16px } .mt-3 { margin-top: 24px } .mt-4 { margin-top: 40px }
.mb-0 { margin-bottom: 0 } .mb-2 { margin-bottom: 16px } .mb-3 { margin-bottom: 24px }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.small { font-size: 13px; }
.bold { font-weight: 700; }
.nowrap { white-space: nowrap; }
.hide-mobile {}
@media (min-width: 721px) { .show-mobile { display: none !important; } }

/* ---------- section heading ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700;
  color: var(--c1); background: var(--c1-soft); padding: 5px 12px; border-radius: 99px; margin-bottom: 14px;
}
.eyebrow .i { width: 16px; height: 16px; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.sec-head h2 { font-size: clamp(22px, 3vw, 32px); margin: 0; }
.sec-head p { color: var(--muted); margin: 8px 0 0; max-width: 620px; }
.sec-head.center { flex-direction: column; align-items: center; text-align: center; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--c1); white-space: nowrap; }
.link-arrow .i { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.link-arrow:hover .i { transform: translateX(-4px); }

/* ---------- buttons ---------- */
.btn {
  --b-bg: var(--ink); --b-fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px;
  border-radius: 12px; font-weight: 700; font-size: 15px; background: var(--b-bg); color: var(--b-fg);
  border: 1px solid transparent; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s, color .2s, border-color .2s;
  white-space: nowrap; line-height: 1; position: relative; isolation: isolate;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--b-bg) 70%, transparent); }
.btn:active { transform: translateY(0); }
.btn .i { width: 19px; height: 19px; }
.btn-primary { --b-bg: var(--c1); }
.btn-accent { --b-bg: var(--c2); }
.btn-light { --b-bg: #fff; --b-fg: var(--ink); border-color: var(--line); }
.btn-light:hover { border-color: color-mix(in srgb, var(--c1) 40%, var(--line)); color: var(--c1); }
.btn-ghost { --b-bg: transparent; --b-fg: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-2); box-shadow: none; }
.btn-soft { --b-bg: var(--c1-soft); --b-fg: var(--c1); }
.btn-danger { --b-bg: var(--err); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { height: 56px; padding: 0 30px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn.is-loading::after {
  content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms ---------- */
.field { margin-bottom: 18px; }
.field > label, .label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 8px; color: var(--ink-2); }
.field .req { color: var(--err); }
.input, .select, .textarea {
  width: 100%; height: 50px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; transition: border-color .2s, box-shadow .2s; font-size: 15px; outline: none;
}
.textarea { height: auto; min-height: 130px; padding: 14px 16px; resize: vertical; line-height: 1.8; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 14px center; padding-left: 42px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--c1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c1) 14%, transparent); }
.input::placeholder, .textarea::placeholder { color: #a0aabb; }
.has-error .input, .has-error .select, .has-error .textarea, .input.is-invalid { border-color: var(--err); }
.field-error { color: var(--err); font-size: 13px; margin: 6px 0 0; }
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--c1); }
.input-group { position: relative; }
.input-group .i { position: absolute; top: 50%; right: 15px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-group .input { padding-right: 46px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- cards / surfaces ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.card.hover { transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; }
.card.hover:hover { transform: translateY(-4px); box-shadow: var(--sh-2); border-color: transparent; }
.card-title { font-size: 18px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.surface { background: var(--bg-2); border-radius: var(--r-lg); padding: 24px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 99px;
  font-size: 12px; font-weight: 700; background: var(--line-2); color: var(--ink-2); white-space: nowrap;
}
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.err { background: #fee2e2; color: #991b1b; }
.badge.info { background: #e0f2fe; color: #075985; }
.badge.brand { background: var(--c1-soft); color: var(--c1); }
.badge.dark { background: var(--ink); color: #fff; }

.icon-box {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: var(--c1-soft); color: var(--c1); flex-shrink: 0;
}
.icon-box .i { width: 24px; height: 24px; }

/* ---------- alerts & toasts ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; margin-bottom: 20px; font-size: 14.5px; border: 1px solid; }
.alert .i { margin-top: 3px; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

.toasts { position: fixed; z-index: 9999; bottom: 90px; left: 50%; transform: translateX(-50%); display: grid; gap: 10px; width: min(92vw, 420px); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: #0f172a; color: #fff; border-radius: 14px;
  box-shadow: var(--sh-3); font-size: 14.5px; animation: toastIn .35s var(--ease); pointer-events: auto;
}
.toast .i { color: #4ade80; }
.toast.err .i { color: #f87171; }
.toast a { color: #a5b4fc; font-weight: 700; margin-inline-start: auto; white-space: nowrap; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ---------- breadcrumb ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.breadcrumb a:hover { color: var(--c1); }
.breadcrumb .i { width: 14px; height: 14px; opacity: .6; }

/* ---------- pagination ---------- */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.pg-btn {
  min-width: 42px; height: 42px; padding: 0 10px; display: grid; place-items: center; border-radius: 12px;
  border: 1px solid var(--line); font-weight: 700; background: #fff; transition: all .2s;
}
.pg-btn:hover { border-color: var(--c1); color: var(--c1); }
.pg-btn.is-current { background: var(--c1); border-color: var(--c1); color: #fff; }
.pg-gap { align-self: center; color: var(--muted); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 13px 16px; text-align: right; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table th { background: var(--bg-2); font-weight: 700; color: var(--ink-2); white-space: nowrap; font-size: 13px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfd; }

/* ---------- misc ---------- */
.stars { color: #e5e7eb; letter-spacing: 1px; font-size: 14px; }
.stars .on { color: #f59e0b; }
.divider { height: 1px; background: var(--line); margin-block: 20px; border: 0; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .icon-box { margin: 0 auto 16px; width: 72px; height: 72px; border-radius: 22px; }
.empty .icon-box .i { width: 32px; height: 32px; }
.empty h3 { color: var(--ink); }
.ratio { position: relative; overflow: hidden; }
.ratio > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.r-1 { aspect-ratio: 1 / 1; } .r-43 { aspect-ratio: 4 / 3; } .r-169 { aspect-ratio: 16 / 9; } .r-32 { aspect-ratio: 3 / 2; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--line); background: #fff; font-size: 14px; font-weight: 600; transition: all .2s; white-space: nowrap;
}
.chip:hover { border-color: var(--c1); color: var(--c1); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.prose { font-size: 16.5px; line-height: 2.1; color: var(--ink-2); }
.prose h2 { font-size: 23px; margin: 1.6em 0 .6em; color: var(--ink); }
.prose h3 { font-size: 19px; margin: 1.4em 0 .5em; color: var(--ink); }
.prose ul, .prose ol { padding-right: 22px; margin-bottom: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1.5em 0; padding: 18px 22px; border-right: 4px solid var(--c1); background: var(--bg-2); border-radius: 12px; color: var(--ink); font-weight: 600; }
.prose img { border-radius: var(--r); margin: 1.5em 0; }
.prose a { color: var(--c1); text-decoration: underline; text-underline-offset: 4px; }
.prose code { background: var(--line-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; direction: ltr; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s } .reveal.d2 { transition-delay: .16s } .reveal.d3 { transition-delay: .24s } .reveal.d4 { transition-delay: .32s }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- drawer (mobile menus, filters) ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(3px); z-index: 900; opacity: 0; visibility: hidden; transition: all .3s; }
.drawer { position: fixed; top: 0; bottom: 0; right: 0; width: min(88vw, 360px); background: #fff; z-index: 901; transform: translateX(105%); transition: transform .35s var(--ease); overflow-y: auto; display: flex; flex-direction: column; }
.drawer.left { right: auto; left: 0; transform: translateX(-105%); }
.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }
.drawer.is-open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.drawer-body { padding: 16px 20px 30px; flex: 1; }
.drawer-nav a { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line-2); font-weight: 600; }
.drawer-nav a .i { color: var(--muted); }
body.drawer-open { overflow: hidden; }

/* =====================================================================
   Demo bar — shown on every demo: "you're viewing a demo · build it for me"
   ===================================================================== */
.demo-bar {
  position: fixed; z-index: 800; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 8px; width: max-content; max-width: calc(100vw - 24px);
  background: rgba(15, 23, 42, .92); backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
  color: #fff; border-radius: 18px; box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .08);
  font-family: var(--font); animation: barIn .6s var(--ease) .4s both;
}
@keyframes barIn { from { opacity: 0; transform: translate(-50%, 30px); } }
.demo-bar .db-back { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 12px; font-size: 13px; color: #cbd5e1; transition: background .2s; }
.demo-bar .db-back:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.demo-bar .db-back .i { width: 17px; height: 17px; }
.demo-bar .db-info { display: flex; flex-direction: column; line-height: 1.4; padding-inline: 6px; border-inline-start: 1px solid rgba(255, 255, 255, .12); }
.demo-bar .db-info small { font-size: 11px; color: #94a3b8; }
.demo-bar .db-info strong { font-size: 13.5px; }
.demo-bar .db-cta {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 13px; font-weight: 800; font-size: 14px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6 55%, #ec4899); color: #fff; box-shadow: 0 8px 22px -6px rgba(139, 92, 246, .7);
  transition: transform .2s var(--ease), box-shadow .2s; white-space: nowrap; position: relative; overflow: hidden;
}
.demo-bar .db-cta::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-100%); animation: shine 3.5s ease-in-out infinite 2s; }
@keyframes shine { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.demo-bar .db-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -8px rgba(139, 92, 246, .8); }
.demo-bar .db-cta .i { width: 18px; height: 18px; }
.demo-bar .db-close { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #94a3b8; }
.demo-bar .db-close:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.demo-bar.is-min .db-info, .demo-bar.is-min .db-back { display: none; }
.demo-spacer { height: 90px; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .g-3 { grid-template-columns: repeat(2, 1fr); }
  .section { padding-block: 56px; }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .container { padding-inline: 16px; }
  .g-2, .g-3 { grid-template-columns: 1fr; }
  .g-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .section { padding-block: 44px; }
  .sec-head { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 24px; }
  .sec-head.center { align-items: center; }
  .form-grid { grid-template-columns: 1fr; }
  .hide-mobile { display: none !important; }
  .card { padding: 18px; border-radius: 18px; }
  .demo-bar { bottom: 10px; gap: 6px; padding: 6px; }
  .demo-bar .db-info { display: none; }
  .demo-bar .db-back span { display: none; }
  .demo-bar .db-cta { height: 42px; padding: 0 14px; font-size: 13px; }
  .toasts { bottom: 80px; }
}
