/* ---------------------------------------------------------------
   دوره‌های خانم دکتر — استایل مینیمال، RTL، تم روز و شب
   توکن‌های رنگ در :root؛ مقدار تایل‌ها با ارقام متناسب (نه tabular)
   --------------------------------------------------------------- */
:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --surface: #ffffff;
  --surface-2: #f1f1ec;
  --ink: #1c1c1a;
  --ink-2: #62625d;
  --muted: #9b9b94;
  --border: #e6e6df;
  --accent: #0e8a7d;
  --accent-soft: rgba(14, 138, 125, 0.10);
  --danger: #c2410c;
  --danger-soft: rgba(194, 65, 12, 0.10);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 18, 0.04);
  --sk-base: color-mix(in srgb, var(--surface-2) 88%, var(--border));
  --sk-shine: color-mix(in srgb, var(--surface) 72%, var(--ink) 10%);
}
html[data-theme="dark"] {
  color-scheme: dark; /* اسکرول‌بار و کنترل‌های بومی هم تیره شوند */
  --bg: #111316;
  --surface: #191c20;
  --surface-2: #20242a;
  --ink: #ecebe8;
  --ink-2: #a3a8ad;
  --muted: #6e757c;
  --border: #272c33;
  --accent: #34c5b4;
  --accent-soft: rgba(52, 197, 180, 0.12);
  --danger: #ef8354;
  --danger-soft: rgba(239, 131, 84, 0.12);
  --shadow: none;
  --sk-base: color-mix(in srgb, var(--surface-2) 80%, var(--border));
  --sk-shine: color-mix(in srgb, var(--ink) 14%, var(--surface-2));
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; } /* بدون فلش آبی هنگام تاچ در موبایل */
button, a, input, select, textarea { touch-action: manipulation; } /* بدون تأخیر دبل‌تپ */
html { scroll-behavior: smooth; }
body {
  font-family: Vazirmatn, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  transition: background .25s, color .25s;
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* گذار نرم تم روی سطوح اصلی (المان‌هایی که transition اختصاصی دارند جداگانه تعریف شده‌اند) */
.topbar, .stat-tile, .modal-card, .icon-btn, #search, .gate, .badge {
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}

.hidden { display: none !important; }

#app { position: relative; }

/* ---------- نوار بالا ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px clamp(16px, 5vw, 48px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 17px; letter-spacing: -0.2px; }
.brand-sub { font-size: 11.5px; font-weight: 400; color: var(--ink-2); margin-inline-start: 8px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  font-size: 15px; display: grid; place-items: center;
  transition: border-color .15s, color .15s, background-color .15s;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn-danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

/* دکمه‌ی «درخواست دوره» — برجسته‌ترین دکمه‌ی نوار بالا */
.topbar-cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  color: #fff; background: var(--accent); border: 1px solid var(--accent);
  border-radius: 999px; padding: 7px 14px;
  transition: filter .15s, transform .1s, background-color .25s ease, border-color .25s ease, color .25s ease;
}
.topbar-cta svg { width: 15px; height: 15px; }
.topbar-cta:hover { filter: brightness(1.08); }
.topbar-cta:active { transform: scale(.97); }
.topbar-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html[data-theme="dark"] .topbar-cta { color: #08322d; } /* آکچنت در دارک روشن است؛ متن تیره بگیرد */
@media (max-width: 560px) { .topbar-cta span { display: none; } .topbar-cta { padding: 7px 10px; } }

/* ---------- تایل‌های آماری (قرارداد: لیبل بالا، مقدار نیمه‌ضخیم) ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  padding: 22px clamp(16px, 5vw, 48px) 6px;
}
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 2px;
}
.stat-label { font-size: 12px; color: var(--ink-2); }
.stat-value { font-size: 26px; font-weight: 600; letter-spacing: -0.5px; }
.stat-accent .stat-value { color: var(--accent); }
.stat-value svg { width: 26px; height: 26px; } /* آیکون کانفتی وقتی کنکور تمام شده */

/* ---------- فیلترها ---------- */
.filters { display: flex; flex-direction: column; gap: 10px; padding: 18px clamp(16px, 5vw, 48px) 0; }
.search-wrap { position: relative; display: block; width: min(480px, 100%); }
.search-icon {
  position: absolute; top: 50%; right: 14px; translate: 0 -50%;
  width: 18px; height: 18px; color: var(--muted); pointer-events: none;
  transition: color .2s;
}
.search-wrap:focus-within .search-icon { color: var(--accent); }
#search {
  width: 100%;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 16px; padding-inline-start: 44px; /* جا برای ذره‌بین سمت راست */
  font-family: inherit; font-size: 14px;
}
#search:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-row.scrollable { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; scroll-snap-type: x proximity; padding-bottom: 2px; }
.chip-row.scrollable::-webkit-scrollbar { display: none; }

.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 6px 15px; font-family: inherit; font-size: 13px;
  cursor: pointer; white-space: nowrap; scroll-snap-align: start;
  transition: border-color .15s, color .15s, background .15s;
}
.chip:hover:not(.chip-on):not([disabled]) { border-color: var(--ink-2); color: var(--ink); }
.chip-on { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; }
html[data-theme="dark"] .chip-on { background: var(--accent); border-color: var(--accent); color: #08322d; }
.chip[disabled] { opacity: .55; cursor: not-allowed; }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.list-meta { color: var(--muted); font-size: 12.5px; padding: 14px clamp(16px, 5vw, 48px) 4px; }

/* ---------- شبکه کارت‌ها ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
  padding: 8px clamp(16px, 5vw, 48px) 30px;
}
.card {
  text-align: start; font-family: inherit; color: var(--ink); /* دکمه است؛ بدون این، رنگ UA (سیاه) را می‌گیرد */
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; cursor: pointer; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 9px; width: 100%;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background-color .25s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 22px rgba(20, 22, 24, 0.08); }
.card:active { transform: translateY(0) scale(.99); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-in { animation: rise .45s cubic-bezier(.22, .8, .3, 1) both; }
.card-title { font-size: 15px; font-weight: 600; line-height: 1.65; }
.card-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  font-size: 11.5px; padding: 2px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid transparent;
}
.badge-type { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-count { margin-inline-start: auto; color: var(--muted); }
.card-desc { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty-state {
  grid-column: 1/-1; text-align: center; padding: 60px 20px;
  color: var(--muted); font-size: 14px;
}
.empty-icon { width: 36px; height: 36px; display: block; margin: 0 auto 10px; opacity: .5; }

.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 24px 16px 34px; }

/* ---------- پنجره جلسات ---------- */
/* flex + margin:auto نه‌فقط وسط‌چین می‌کند بلکه اگر کارت بلندتر از صفحه شد قابل اسکرول می‌ماند
   (گرید با عرضِ درصدی track را از صفحه بزرگ‌تر می‌کرد و کارت در موبایل از لبه بیرون می‌زد) */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(10, 13, 15, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  overflow-y: auto; overscroll-behavior: contain;
  animation: fade .18s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  margin: auto auto 0; /* موبایل: شیتِ پایین صفحه */
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  width: min(720px, 100%); max-height: 88vh; max-height: 88dvh; /* dvh: با نوار آدرس موبایل درست حساب شود */
  overflow-y: auto;
  overscroll-behavior: contain; /* اسکرولِ آخر لیست به صفحه‌ی پشت سرش نشیرد */
  padding: 0 0 calc(26px + env(safe-area-inset-bottom, 0px));
  animation: slide-up .22s ease-out;
  scrollbar-width: thin;
}
@keyframes slide-up { from { transform: translateY(30px); opacity: .4; } to { transform: translateY(0); opacity: 1; } }
@keyframes modal-pop { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
@media (min-width: 761px) {
  .modal-card { border-radius: 20px; animation: modal-pop .26s cubic-bezier(.22, .8, .3, 1); max-height: 84vh; margin: auto; }
}
/* هدر چسبان: توی لیست‌های بلند (مثل ۸۳ جلسه) عنوان و دکمه‌ی بستن همیشه جلوی چشم می‌مانند */
.modal-head {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 18px clamp(16px, 4vw, 28px) 13px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.modal-card.scrolled .modal-head { border-bottom-color: var(--border); }
.modal-head h2 { font-size: 17px; line-height: 1.6; }
.modal-meta { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.modal-actions { padding: 12px clamp(16px, 4vw, 28px) 2px; }
.ghost-btn {
  font-family: inherit; font-size: 13px; cursor: pointer;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid transparent; border-radius: 10px; padding: 7px 14px;
}
.ghost-btn:hover { filter: brightness(1.05); }
.ghost-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.session-list { list-style: none; margin-top: 4px; padding-inline: clamp(16px, 4vw, 28px); }
.session-item { border-bottom: 1px solid var(--border); }
.session-item:last-child { border-bottom: none; }
.session-head {
  width: 100%; background: none; border: none; font-family: inherit;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 10px; cursor: pointer; text-align: start; color: var(--ink);
  border-radius: 12px; transition: background .15s;
}
.session-head:hover { background: var(--surface-2); }
.session-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.session-num {
  width: 28px; height: 28px; flex: none; border-radius: 9px;
  background: var(--surface-2); color: var(--ink-2);
  font-size: 12px; font-weight: 600; display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.session-item.open .session-num { background: var(--accent-soft); color: var(--accent); }
.session-title { flex: 1; font-size: 14px; font-weight: 500; }
.session-item.open .session-title { color: var(--accent); }
.session-caret { color: var(--muted); font-size: 12px; transition: rotate .2s, color .15s; }
.session-item.open .session-caret { rotate: 180deg; color: var(--accent); }

/* آکاردئون نرم با تکنیک grid-template-rows (کشوشدن واقعی ارتفاع، نه پرش display) */
.zang-list {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .28s cubic-bezier(.22, .8, .3, 1);
  padding: 0 48px 0 30px; /* راستش زیر عنوان جلسه تراز است */
}
.session-item.open .zang-list { grid-template-rows: 1fr; }
.zang-inner { min-height: 0; overflow: hidden; padding: 2px 0 14px; opacity: 0; transition: opacity .2s ease; }
.session-item.open .zang-inner { opacity: 1; }
.zang-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 0;
}
.zang-name { font-size: 13px; color: var(--ink-2); }
.zang-btns { display: flex; gap: 6px; }
.zang-link {
  text-decoration: none; font-size: 12.5px; font-family: inherit; cursor: pointer;
  border: 1px solid var(--border); color: var(--ink-2); background: var(--surface);
  padding: 5px 13px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 4px;
}
.zang-link:hover { border-color: var(--accent); color: var(--accent); }
.zang-copy { min-width: 66px; }
.zang-copy:hover { color: var(--ink); border-color: var(--ink-2); }

/* ---------- اعلان کپی و دروازه ورود ---------- */
.toast {
  position: fixed; bottom: 22px; right: 50%; translate: 50% 0; z-index: 60;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--ink); color: var(--bg); /* حالت خنثی (info) */
  padding: 9px 18px; border-radius: 999px; font-size: 13px;
  box-shadow: 0 6px 24px rgba(15, 18, 20, 0.18);
  animation: toast-in .2s ease-out;
}
html[data-theme="dark"] .toast { background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); }
.toast svg { width: 16px; height: 16px; flex: none; }
.toast.ok { background: var(--accent); color: #fff; }
.toast.err { background: var(--danger); color: #fff; }
/* در دارک، سلکتور پایه‌ی تم قوی‌تر از .toast.ok است؛ پس‌زمینه و بوردر را همین‌جا تعیین می‌کنیم */
html[data-theme="dark"] .toast.ok { background: var(--accent); border-color: transparent; color: #08322d; }
html[data-theme="dark"] .toast.err { background: var(--danger); border-color: transparent; color: #2b150a; }
@keyframes toast-in { from { opacity: 0; translate: 50% 8px; } to { opacity: 1; translate: 50% 0; } }

/* ---------- مودال تایید (خروج) و فرم‌ها ---------- */
/* flex (نه gridِ ارثی) + margin:auto: کارت وسط می‌ماند و اگر از ارتفاع صفحه بلندتر شد
   (فرم درخواست در موبایل) از بالا بریده نمی‌شود و کلش با اسکرول در دسترس است */
.confirm-backdrop {
  z-index: 70; display: flex;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
.confirm-card {
  margin: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  width: min(340px, 100%); padding: 28px 24px 22px; text-align: center;
  animation: modal-pop .22s cubic-bezier(.22, .8, .3, 1);
}
.confirm-icon-wrap {
  width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 16px;
  display: grid; place-items: center; background: var(--danger-soft);
}
.confirm-icon { width: 26px; height: 26px; color: var(--danger); }
.confirm-card h2 { font-size: 17px; margin-bottom: 6px; }
.confirm-text { color: var(--ink-2); font-size: 13.5px; line-height: 1.7; }
.confirm-actions { display: flex; gap: 8px; margin-top: 20px; }
.confirm-actions button { flex: 1; justify-content: center; }
.confirm-actions .ghost-btn { padding: 10px 14px; }
.danger-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--danger); color: #fff; border: 1px solid transparent;
  border-radius: 10px; padding: 10px 14px;
  transition: filter .15s, transform .1s;
}
.danger-btn:hover { filter: brightness(1.08); }
.danger-btn:active { transform: scale(.98); }
.danger-btn:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; }

/* ---------- مودال فرم درخواست دوره ---------- */
.req-card { width: min(430px, 100%); text-align: start; padding: 24px 22px 20px; }
.req-icon-wrap { background: var(--accent-soft); }
.req-confirm-icon { color: var(--accent); }
.req-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.req-field { display: flex; flex-direction: column; gap: 6px; }
.req-label {
  display: flex; align-items: center; gap: 4px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.req-optional { font-weight: 400; opacity: .75; }
.req-field input, .req-field select, .req-field textarea {
  width: 100%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; font-family: inherit; font-size: 13.5px; line-height: 1.7;
  resize: vertical; transition: border-color .15s, box-shadow .15s;
}
.req-field :is(input, select, textarea):focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
/* ردیف‌های انتخابی فرم = چیپ‌های صفحه؛ کمی جمع‌وجورتر و با فاصله‌ی عمودی */
.req-form .chip { padding: 6px 13px; font-size: 12.5px; }
.req-form .chip-row { flex-wrap: wrap; row-gap: 8px; }
.req-form .chip-row.scrollable { flex-wrap: nowrap; padding-bottom: 4px; }
.req-form .chip-row.scrollable .chip { scroll-snap-align: start; }

/* iOS هنگام فوکوس روی input با فونت زیر ۱۶px خودش زوم می‌کند و صفحه می‌پرد؛ در موبایل فونت را ۱۶px بگیر */
@media (max-width: 640px) {
  #search, #key-input, .req-field input, .req-field textarea { font-size: 16px; }
}
.req-form .confirm-actions { margin-top: 4px; }
.primary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  color: #fff; background: var(--accent); border: 1px solid transparent;
  border-radius: 10px; padding: 10px 14px;
  transition: filter .15s, transform .1s;
}
html[data-theme="dark"] .primary-btn { color: #08322d; }
.primary-btn:hover { filter: brightness(1.08); }
.primary-btn:active { transform: scale(.98); }
.primary-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary-btn:disabled { opacity: .7; cursor: default; }

/* ---------- مودال تشکر از خانم دکتر ---------- */
.thanks-card { width: min(400px, 100%); text-align: start; padding: 26px 24px 20px; }
.thanks-icon-wrap { background: rgba(224, 82, 110, .12); } /* صورتی ملایم؛ مستقل از تم */
.thanks-heart { width: 26px; height: 26px; color: #e0526e; animation: heartbeat 1.6s ease-in-out infinite; }
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.14); }
  24% { transform: scale(1); }
  36% { transform: scale(1.1); }
  48% { transform: scale(1); }
}
.thanks-kicker { font-size: 11.5px; color: var(--muted); letter-spacing: .3px; }
.thanks-card h2 { margin-bottom: 10px; }
.thanks-text { font-size: 13.5px; color: var(--ink-2); line-height: 1.9; }
.thanks-text p + p { margin-top: 8px; }

/* دکمه‌ی قلب پایین فوتر */
.thanks-btn {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 12px;
  font-family: inherit; font-size: 12.5px; color: var(--ink-2); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 15px;
  transition: border-color .15s, color .15s, transform .1s, background-color .25s ease;
}
.thanks-btn svg { width: 14px; height: 14px; }
.thanks-btn:hover { border-color: #e0526e; color: #e0526e; }
.thanks-btn:active { transform: scale(.97); }
.thanks-btn:focus-visible { outline: 2px solid #e0526e; outline-offset: 2px; }

/* ---------- دکمه شناور برگشت به بالا ---------- */
.to-top {
  position: fixed; bottom: 18px; inset-inline-end: 18px; z-index: 60;
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(20, 20, 18, .12);
  animation: modal-pop .25s cubic-bezier(.22, .8, .3, 1);
  transition: border-color .15s, color .15s, background-color .25s ease;
}
.to-top svg { width: 19px; height: 19px; }
.to-top:hover { border-color: var(--accent); color: var(--accent); }
.to-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.gate {
  position: fixed; inset: 0; z-index: 80; overflow: hidden;
  background: var(--bg); display: grid; place-items: center; padding: 20px;
}
/* دو هاله‌ی نرم پشت کارت ورود، فقط برای عمق بصری */
.gate-glow {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(420px 320px at 18% 12%, var(--accent-soft), transparent 60%),
    radial-gradient(360px 300px at 84% 88%, var(--accent-soft), transparent 55%);
  opacity: .9;
}
.gate-card {
  position: relative; z-index: 1;
  text-align: center; max-width: 340px; width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 34px 26px 28px; box-shadow: 0 12px 40px rgba(20, 20, 18, 0.08);
  animation: gate-in .5s cubic-bezier(.22, .8, .3, 1) both;
}
@keyframes gate-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.gate-emoji {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 18px;
  display: grid; place-items: center; background: var(--accent-soft);
}
.gate-card h1 { font-size: 21px; margin-bottom: 4px; }
.gate-card p { color: var(--ink-2); font-size: 13.5px; }
#gate-form { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.field-wrap {
  position: relative; display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.field-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-icon { width: 17px; height: 17px; color: var(--muted); flex: none; margin-inline: 13px; }
.field-wrap:focus-within .field-icon { color: var(--accent); }
#key-input {
  flex: 1; min-width: 0; background: none; color: var(--ink); border: none;
  padding: 12px 14px 12px 4px; font-family: inherit; font-size: 14px;
}
#key-input:focus { outline: none; }
#gate-form button {
  background: var(--ink); color: var(--bg); border: none;
  border-radius: 12px; padding: 12px 20px; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: filter .15s, transform .1s;
}
#gate-form button:hover { filter: brightness(1.12); }
#gate-form button:active { transform: scale(.98); }
.btn-label { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-label .btn-icon { width: 16px; height: 16px; }
html[data-theme="dark"] #gate-form button { background: var(--accent); color: #08322d; }
#gate-form button:focus-visible, #key-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gate-error {
  color: var(--danger) !important; margin-top: 4px !important;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.gate-error svg { width: 15px; height: 15px; flex: none; }
.gate-hint {
  margin-top: 16px !important; padding-top: 14px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--muted) !important; font-size: 12px !important;
}
.gate-hint-icon { width: 14px; height: 14px; flex: none; }

/* اسپینر داخل دکمه‌ی ورود حین چک کردن کلید */
.spinner {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#gate-form button:disabled { opacity: .75; cursor: progress; }

/* تکون ظریف کارت ورود وقتی کلید غلط است */
.gate-card.shake { animation: shake .4s ease; }
@keyframes shake {
  20% { transform: translateX(6px); } 40% { transform: translateX(-5px); }
  60% { transform: translateX(3px); } 80% { transform: translateX(-2px); }
}

/* ---------- اسکلتون لودینگ (استخوان‌بندی واقعی + شimmer نرم RTL) ---------- */
.sk-page {
  animation: sk-enter .5s cubic-bezier(.22, .8, .3, 1) both;
}
.sk-page.sk-leave {
  position: absolute; inset-inline: 0; top: 0; width: 100%; z-index: 1;
  animation: sk-leave .42s cubic-bezier(.4, 0, .2, 1) both;
  pointer-events: none;
}
@keyframes sk-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes sk-leave {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-6px); }
}

.sk-bone {
  display: block;
  background-color: var(--sk-base);
  background-image: linear-gradient(
    90deg,
    var(--sk-base) 0%,
    var(--sk-shine) 46%,
    var(--sk-base) 100%
  );
  background-size: 220% 100%;
  background-repeat: no-repeat;
  border-radius: 8px;
  will-change: background-position;
  animation: sk-shimmer 1.85s cubic-bezier(.4, 0, .2, 1) infinite;
}
@keyframes sk-shimmer {
  0% { background-position: 120% 0; }
  70%, 100% { background-position: -120% 0; }
}

.sk-topbar { border-bottom-color: transparent; }
.sk-brand { width: min(220px, 58%); height: 18px; border-radius: 8px; }
.sk-icon { width: 38px; height: 38px; border-radius: 10px; flex: none; }

.sk-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
  animation: sk-rise .55s cubic-bezier(.22, .8, .3, 1) both;
}
.sk-value { width: 42%; height: 22px; border-radius: 8px; margin-top: 2px; }

.sk-search { height: 41px; width: min(480px, 100%); border-radius: 12px; }
.sk-chip {
  display: inline-block; height: 30px; width: 72px; border-radius: 999px;
  animation:
    sk-rise .5s cubic-bezier(.22, .8, .3, 1) both,
    sk-shimmer 1.85s cubic-bezier(.4, 0, .2, 1) infinite;
}
.sk-meta { width: 140px; height: 12px; border-radius: 6px; }

.sk-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 9px;
  animation: sk-rise .6s cubic-bezier(.22, .8, .3, 1) both;
}
.sk-badges { display: flex; gap: 6px; margin-top: 2px; }
.sk-line { height: 13px; }

.w-32 { width: 32%; } .w-38 { width: 38%; } .w-40 { width: 40%; } .w-42 { width: 42%; }
.w-44 { width: 44%; } .w-46 { width: 46%; } .w-48 { width: 48%; } .w-50 { width: 50%; }
.w-52 { width: 52%; } .w-55 { width: 55%; } .w-56 { width: 56%; } .w-58 { width: 58%; }
.w-60 { width: 60%; } .w-62 { width: 62%; } .w-64 { width: 64%; } .w-66 { width: 66%; }
.w-70 { width: 70%; } .w-74 { width: 74%; } .w-78 { width: 78%; } .w-80 { width: 80%; }
.w-82 { width: 82%; } .w-86 { width: 86%; } .w-88 { width: 88%; } .w-90 { width: 90%; }
.w-92 { width: 92%; }
.w-chip { width: 64px; } .w-chip-md { width: 88px; } .w-chip-lg { width: 118px; }

@keyframes sk-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ورود پلکانی تا موج طبیعی از بالا به پایین بیاید */
.sk-page .stats .sk-tile:nth-child(1) { animation-delay: .04s; }
.sk-page .stats .sk-tile:nth-child(2) { animation-delay: .09s; }
.sk-page .stats .sk-tile:nth-child(3) { animation-delay: .14s; }
.sk-page .stats .sk-tile:nth-child(4) { animation-delay: .19s; }
.sk-page .filters .sk-search {
  animation:
    sk-rise .55s cubic-bezier(.22, .8, .3, 1) .22s both,
    sk-shimmer 1.85s cubic-bezier(.4, 0, .2, 1) infinite;
}
.sk-page .filters .chip-row:nth-child(2) .sk-chip { animation-delay: .26s; }
.sk-page .filters .chip-row:nth-child(3) .sk-chip { animation-delay: .32s; }
.sk-page .filters .chip-row:nth-child(4) .sk-chip { animation-delay: .38s; }
.sk-page .list-meta .sk-meta {
  animation:
    sk-rise .5s cubic-bezier(.22, .8, .3, 1) .4s both,
    sk-shimmer 1.85s cubic-bezier(.4, 0, .2, 1) infinite;
}
.sk-page .grid .sk-card:nth-child(1) { animation-delay: .28s; }
.sk-page .grid .sk-card:nth-child(2) { animation-delay: .34s; }
.sk-page .grid .sk-card:nth-child(3) { animation-delay: .4s; }
.sk-page .grid .sk-card:nth-child(4) { animation-delay: .46s; }
.sk-page .grid .sk-card:nth-child(5) { animation-delay: .52s; }
.sk-page .grid .sk-card:nth-child(6) { animation-delay: .58s; }
.sk-page .grid .sk-card:nth-child(7) { animation-delay: .64s; }
.sk-page .grid .sk-card:nth-child(8) { animation-delay: .7s; }

/* شimmer هم کمی آفست داشته باشد تا همه هم‌زمان ندرخشند */
.sk-page .sk-tile:nth-child(2) .sk-bone { animation-delay: .12s; }
.sk-page .sk-tile:nth-child(3) .sk-bone { animation-delay: .24s; }
.sk-page .sk-tile:nth-child(4) .sk-bone { animation-delay: .36s; }
.sk-page .grid .sk-card:nth-child(odd) .sk-bone { animation-delay: .15s; }
.sk-page .grid .sk-card:nth-child(3n) .sk-bone { animation-delay: .28s; }

/* ---------- انیمیشن ورود صفحه و کارت‌ها ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.app-enter { animation: app-in .45s cubic-bezier(.22, .8, .3, 1) both; }
@keyframes app-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.app-enter .stat-tile { animation: rise .5s cubic-bezier(.22, .8, .3, 1) both; }
.app-enter .stat-tile:nth-child(1) { animation-delay: .05s; }
.app-enter .stat-tile:nth-child(2) { animation-delay: .1s; }
.app-enter .stat-tile:nth-child(3) { animation-delay: .15s; }
.app-enter .stat-tile:nth-child(4) { animation-delay: .2s; }

/* ---------- آیکون‌های DuoIcons (duotone؛ رنگ از currentColor ارث می‌رسد) ---------- */
/* کلاس‌های روی <i data-duoicon> بعد از تزریق به خود svg منتقل می‌شوند */
.gate-icon { width: 30px; height: 30px; color: var(--accent); }
.gate-emoji svg { display: block; margin-inline: auto; }

.brand-icon { width: 19px; height: 19px; color: var(--accent); vertical-align: -4px; margin-inline-end: 3px; }

.chip-icon, .btn-icon { width: 14px; height: 14px; vertical-align: -2px; }
.chip .chip-icon { margin-inline-end: 4px; }
.zang-link .btn-icon, .ghost-btn .btn-icon { margin-inline-end: 3px; }

/* سوییچ تم با دو آیکون (بدون دست زدن به DOM از سمت JS) */
#theme-toggle svg { width: 19px; height: 19px; display: block; }
#theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] #theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] #theme-toggle .icon-sun { display: block; }