/* ==========================================================================
   Falancer UI — سیستم طراحی مشترک
   --------------------------------------------------------------------------
   این فایل پایه‌ی بصری *همه‌ی* صفحات وب است: صفحه‌ی معرفی (index.html)،
   پنل کاربری (base.html و همه‌ی صفحات داخلش) و صفحات مستقل (ورود، قوانین،
   پرداخت). رنگ‌ها هیچ‌جا هاردکد نیستن؛ همه از ۱۰ متغیر تم (--bg, --card,
   --border, --container, --buttons, --accent, --accent2, --text1..3) ساخته
   می‌شن که سمت سرور از پالت انتخابی کاربر (context_processors.theme_context)
   تزریق می‌شن - پس هر پالت روشن و حالت تیره خودکار روی کل سایت اعمال می‌شه
   و ورود از صفحه‌ی معرفی به پنل حس «یک سایت دیگه» نمی‌ده.
   ========================================================================== */

:root {
  /* مقادیر پیش‌فرض (پالت «بنفش نئونی»)؛ base.html/index.html بازنویسی‌شون می‌کنن */
  --bg: #F7F7FC;
  --card: #FFFFFF;
  --border: #E1E0EE;
  --container: #F0EEFA;
  --buttons: #6D4AFF;
  --accent: #FF0000;
  --accent2: #00A6A6;
  --text1: #19172A;
  --text2: #65627A;
  --text3: #9894AA;

  /* رنگ‌های مشتق‌شده از تم */
  --brand: var(--buttons);
  --brand-2: var(--accent2);
  --brand-soft: color-mix(in srgb, var(--buttons) 11%, transparent);
  --brand-softer: color-mix(in srgb, var(--buttons) 6%, transparent);
  --brand-ring: color-mix(in srgb, var(--buttons) 26%, transparent);
  --brand-strong: color-mix(in srgb, var(--buttons) 82%, #000);
  --surface: var(--card);
  --surface-2: var(--container);
  --glass: color-mix(in srgb, var(--card) 72%, transparent);
  --glass-strong: color-mix(in srgb, var(--card) 88%, transparent);
  --hairline: color-mix(in srgb, var(--border) 85%, transparent);

  --grad: linear-gradient(135deg, var(--buttons) 0%, color-mix(in srgb, var(--buttons) 55%, var(--accent2)) 58%, var(--accent2) 100%);
  --grad-soft: linear-gradient(135deg, color-mix(in srgb, var(--buttons) 14%, var(--card)), color-mix(in srgb, var(--accent2) 12%, var(--card)));
  --grad-warm: linear-gradient(120deg, var(--accent) -10%, color-mix(in srgb, var(--accent) 45%, var(--buttons)) 45%, var(--buttons) 100%);
  --grad-text: linear-gradient(110deg, var(--buttons) 10%, var(--accent2) 90%);

  /* رنگ‌های معنایی ثابت */
  --danger: #E5484D;
  --danger-bg: color-mix(in srgb, #E5484D 12%, transparent);
  --success: #16A34A;
  --success-bg: color-mix(in srgb, #16A34A 12%, transparent);
  --warning: #E59A0B;
  --warning-bg: color-mix(in srgb, #F5A524 15%, transparent);
  --info: #3B82F6;
  --info-bg: color-mix(in srgb, #3B82F6 13%, transparent);
  --star: #F5A623;

  /* سایه‌ها - رنگشون عمداً از تم گرفته نمی‌شه تا در حالت تیره هم سایه بمونن */
  --shadow-xs: 0 1px 2px rgba(17, 12, 46, .05);
  --shadow-sm: 0 2px 6px -1px rgba(17, 12, 46, .06), 0 1px 2px rgba(17, 12, 46, .04);
  --shadow-md: 0 12px 28px -12px rgba(17, 12, 46, .18), 0 2px 6px -2px rgba(17, 12, 46, .06);
  --shadow-lg: 0 28px 60px -22px rgba(17, 12, 46, .32), 0 8px 18px -10px rgba(17, 12, 46, .12);
  --shadow-glow: 0 14px 34px -12px color-mix(in srgb, var(--buttons) 65%, transparent);

  --radius-xs: 10px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: 'Vazirmatn', Tahoma, sans-serif;
}

/* ---------------------------------------------------------- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text1);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  max-width: 100%;
}
a { color: inherit; }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; }
::selection { background: color-mix(in srgb, var(--buttons) 25%, transparent); }
:focus-visible { outline: 2px solid var(--buttons); outline-offset: 2px; border-radius: 6px; }

/* اسکرول‌بار ظریف */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text3) 45%, transparent) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text3) 40%, transparent); border-radius: 20px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

.text-gradient {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------------------------------------------------------- buttons ---- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  min-height: 46px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.4;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .2s, border-color .2s, color .2s, filter .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn i { font-size: .95em; }

.btn-primary {
  background: var(--grad);
  background-size: 140% 140%;
  background-position: 0 50%;
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { background-position: 100% 50%; box-shadow: 0 18px 40px -12px color-mix(in srgb, var(--buttons) 75%, transparent); }
/* برق براق رد شونده روی دکمه‌ی اصلی */
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  transform: translateX(120%);
  transition: transform .7s var(--ease);
}
.btn-primary:hover::after { transform: translateX(-120%); }

.btn-outline {
  background: var(--card);
  border-color: var(--border);
  color: var(--text1);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover { border-color: var(--brand-ring); color: var(--buttons); background: var(--brand-softer); }
.btn-soft { background: var(--brand-soft); color: var(--buttons); }
.btn-soft:hover { background: color-mix(in srgb, var(--buttons) 17%, transparent); }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover { background: var(--container); color: var(--text1); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--danger) 70%, transparent); }
.btn-danger:hover { filter: brightness(1.06); }
.btn-danger-outline { background: transparent; border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.btn-danger-outline:hover { background: var(--danger-bg); }
.btn-white { background: #fff; color: var(--brand-strong); box-shadow: var(--shadow-md); }
.btn-glass { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .28); backdrop-filter: blur(10px); }
.btn-glass:hover { background: rgba(255, 255, 255, .26); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; min-height: 36px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 15px 28px; min-height: 54px; font-size: 14.5px; border-radius: var(--radius-lg); }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: 15px;
  flex-shrink: 0;
  text-decoration: none;
  transition: background .2s, color .2s, transform .2s var(--ease), border-color .2s;
}
.icon-btn:hover { background: var(--container); color: var(--buttons); }
.icon-btn:active { transform: scale(.94); }

/* لودینگ سه‌نقطه‌ای مشترک - app.js روی دکمه‌ی submit فرم‌های js-loading-form */
.btn-loading-dots { display: inline-flex; align-items: center; gap: 5px; }
.btn-loading-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  animation: btn-dot-bounce 1.4s infinite ease-in-out both;
}
.btn-loading-dots span:nth-child(1) { animation-delay: -.32s; }
.btn-loading-dots span:nth-child(2) { animation-delay: -.16s; }
@keyframes btn-dot-bounce {
  0%, 80%, 100% { transform: scale(0); opacity: .5; }
  40% { transform: scale(1); opacity: 1; }
}

/* ریپل کلیک (ui.js) */
.ui-ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: currentColor;
  opacity: .22;
  transform: scale(0);
  animation: ui-ripple .6s var(--ease) forwards;
}
@keyframes ui-ripple { to { transform: scale(2.6); opacity: 0; } }

/* ---------------------------------------------------------- surfaces ---- */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-hover { transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--brand-ring); }
.card-flush { padding: 0; overflow: hidden; }
.card-tight { padding: 14px; }
.card-glass {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
.card + .card { margin-top: 0; }

/* کارت/بنر گرادیانی متحرک با لکه‌های نور - هدر داشبورد و ... */
.hero-gradient {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--grad);
  background-size: 180% 180%;
  animation: ui-gradient-shift 14s ease-in-out infinite;
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-glow);
}
.hero-gradient::before,
.hero-gradient::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(6px);
  pointer-events: none;
}
.hero-gradient::before {
  width: 260px; height: 260px;
  top: -130px; left: -70px;
  background: radial-gradient(circle, rgba(255, 255, 255, .28), transparent 65%);
  animation: ui-float 9s ease-in-out infinite;
}
.hero-gradient::after {
  width: 220px; height: 220px;
  bottom: -120px; right: 10%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), transparent 70%);
  opacity: .55;
  animation: ui-float 11s ease-in-out infinite reverse;
}
@keyframes ui-gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes ui-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(18px, -14px) scale(1.08); }
}

/* ---------------------------------------------------------- forms ---- */
.field { margin-bottom: 16px; }
.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 8px;
}
.text-input {
  width: 100%;
  min-height: 50px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--container);
  font-size: 14.5px;
  color: var(--text1);
  text-align: center;
  transition: border-color .2s, background .2s, box-shadow .25s var(--ease);
}
.text-input::placeholder { color: var(--text3); }
.text-input:hover { border-color: color-mix(in srgb, var(--buttons) 30%, var(--border)); }
.text-input:focus {
  outline: none;
  border-color: var(--buttons);
  background: var(--card);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
textarea.text-input { text-align: right; resize: vertical; min-height: 120px; line-height: 1.9; }
select.text-input { text-align: right; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text3) 50%), linear-gradient(135deg, var(--text3) 50%, transparent 50%);
  background-position: 18px 52%, 13px 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-left: 34px;
}
.text-input.ltr, input[dir="ltr"].text-input { direction: ltr; }
.text-input.text-right { text-align: right; }
.otp-input { letter-spacing: 12px; font-weight: 700; font-size: 22px; }
.field-error { color: var(--danger); font-size: 11.5px; margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.field-hint { color: var(--text3); font-size: 11px; margin-top: 6px; }
.help-text { color: var(--text3); font-size: 11.5px; line-height: 1.9; }

input[type="checkbox"], input[type="radio"] { accent-color: var(--buttons); }

/* سوییچ (چک‌باکس استایل‌شده) */
.switch { position: relative; display: inline-flex; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-track {
  position: absolute; inset: 0; border-radius: 30px; cursor: pointer;
  background: var(--border); transition: background .25s;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm); transition: transform .3s var(--ease-spring);
}
.switch input:checked + .switch-track { background: var(--buttons); }
.switch input:checked + .switch-track::after { transform: translateX(-20px); }

/* ---------------------------------------------------------- alerts ---- */
.alert {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 16px;
  border: 1px solid transparent;
  animation: ui-slide-down .5s var(--ease) both;
}
.alert > i { font-size: 16px; flex-shrink: 0; }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.alert-success { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 22%, transparent); }
.alert-info { background: var(--grad-soft); color: var(--text1); border-color: var(--brand-ring); }
.alert-info > i { color: var(--buttons); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert-close {
  margin-inline-start: auto; background: none; border: none; color: inherit; opacity: .55;
  cursor: pointer; width: 26px; height: 26px; border-radius: 8px; font-size: 12px; flex-shrink: 0;
}
.alert-close:hover { opacity: 1; background: color-mix(in srgb, currentColor 10%, transparent); }
@keyframes ui-slide-down { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------- chips / badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700; line-height: 1.6;
  background: var(--container); color: var(--text2);
  white-space: nowrap;
}
.badge-brand { background: var(--brand-soft); color: var(--buttons); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-solid { background: var(--grad); color: #fff; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600;
  background: var(--card); color: var(--text2);
  border: 1px solid var(--border);
  text-decoration: none; white-space: nowrap;
  transition: all .2s var(--ease);
}
.chip:hover { border-color: var(--brand-ring); color: var(--buttons); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--shadow-glow); }

/* ---------------------------------------------------------- avatar ---- */
.avatar {
  --size: 44px;
  width: var(--size); height: var(--size);
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad-soft);
  color: var(--buttons);
  font-size: calc(var(--size) * .38);
  font-weight: 800;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { --size: 22px; }
.avatar-sm { --size: 32px; }
.avatar-lg { --size: 64px; }
.avatar-xl { --size: 92px; }
.avatar-ring { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--buttons); }

/* ---------------------------------------------------------- layout helpers ---- */
.row { display: flex; align-items: center; gap: 10px; }
.row-top { align-items: flex-start; }
.row-wrap { flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { gap: 8px; }
.stack-lg { gap: 22px; }
.grow { flex: 1; min-width: 0; }
.push { margin-inline-start: auto; }
.center { text-align: center; }
.w-100 { width: 100%; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 26px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; } .mb-4 { margin-bottom: 26px; }
.gap-1 { gap: 6px; } .gap-2 { gap: 12px; } .gap-3 { gap: 18px; }
.text-muted { color: var(--text3); }
.text-soft { color: var(--text2); }
.text-brand { color: var(--buttons); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-xs { font-size: 11px; } .text-sm { font-size: 12.5px; } .text-md { font-size: 14px; } .text-lg { font-size: 17px; } .text-xl { font-size: 22px; }
.fw-6 { font-weight: 600; } .fw-7 { font-weight: 700; } .fw-8 { font-weight: 800; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ltr { direction: ltr; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--border); border: none; margin: 16px 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* عدد/آمار کوچک داخل کاشی */
.stat-tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 14px 10px;
  border-radius: var(--radius-md);
  background: var(--container);
  text-align: center;
  overflow: hidden;
  transition: transform .3s var(--ease), background .3s;
}
.stat-tile:hover { transform: translateY(-3px); background: var(--brand-soft); }
.stat-tile-icon {
  width: 36px; height: 36px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--card); color: var(--buttons); font-size: 15px; box-shadow: var(--shadow-xs); margin-bottom: 4px;
}
.stat-tile-label { font-size: 11px; color: var(--text3); }
.stat-tile-value { font-size: 14px; font-weight: 800; color: var(--text1); }

/* عنوان بخش داخل صفحه */
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 800; color: var(--text1);
  margin: 26px 0 14px;
}
.section-title .section-title-icon {
  width: 32px; height: 32px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--buttons); font-size: 13px;
}
.section-title .section-title-action { margin-inline-start: auto; font-size: 12px; font-weight: 700; color: var(--buttons); text-decoration: none; }

/* حالت خالی */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text3);
  font-size: 13px;
}
.empty-state > i, .empty-state .empty-state-icon {
  width: 76px; height: 76px; margin: 0 auto 16px;
  border-radius: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  background: var(--grad-soft);
  color: var(--buttons);
  animation: ui-bob 4s ease-in-out infinite;
}
.empty-state-title { font-size: 15px; font-weight: 800; color: var(--text1); margin-bottom: 4px; }
@keyframes ui-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------------------------------------------------------- modal ---- */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 190;
  background: color-mix(in srgb, #0B0920 55%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; animation: ui-fade .25s ease both; }
.modal-box {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.modal-overlay.show .modal-box { animation: ui-pop .4s var(--ease-spring) both; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 18px;
  font-size: 15px; font-weight: 800;
}
.modal-header > span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
@keyframes ui-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ui-pop { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------- stars ---- */
.star-picker { display: flex; flex-direction: row-reverse; justify-content: center; gap: 10px; margin: 6px 0 4px; }
.star-picker input { display: none; }
.star-picker label { font-size: 34px; color: var(--border); cursor: pointer; transition: color .15s, transform .25s var(--ease-spring); line-height: 1; }
.star-picker label:hover,
.star-picker label:hover ~ label,
.star-picker input:checked ~ label { color: var(--star); transform: scale(1.12); }
.star-display { display: inline-flex; gap: 2px; direction: ltr; }
.star-display i { font-size: 13px; color: var(--border); }
.star-display i.filled { color: var(--star); }

/* ---------------------------------------------------------- motion ---- */
/* ورود صفحه: بلوک‌های مستقیم محتوای اصلی با تأخیر پلکانی بالا میان */
@keyframes ui-fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes ui-scale-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes ui-spin { to { transform: rotate(360deg); } }
@keyframes ui-shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes ui-pulse-ring {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--buttons) 45%, transparent); }
  100% { box-shadow: 0 0 0 14px transparent; }
}

/* اسکرول-ریویل (ui.js کلاس reveal-ready رو به <html> اضافه می‌کنه؛ بدون JS همه‌چیز نمایانه) */
@media (prefers-reduced-motion: no-preference) {
  html.reveal-ready .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .8s var(--ease); }
  html.reveal-ready .reveal.is-visible { opacity: 1; transform: none; }
  html.reveal-ready .reveal.is-visible { transition-delay: calc(var(--reveal-index, 0) * 60ms); }
}

/* کارت‌هایی که هاور نورانی (spotlight) دارن - ui.js مختصات موس رو ست می‌کنه */
.spotlight { --mx: 50%; --my: 50%; }
.spotlight::before {
  content: "";
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--buttons) 9%, transparent), transparent 45%);
  opacity: 0; transition: opacity .35s;
}
.spotlight:hover::before { opacity: 1; }
.spotlight > * { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------- theme switch ---- */
.theme-switch { display: inline-flex; align-items: center; cursor: pointer; flex-shrink: 0; }
.theme-switch input { display: none; }
.theme-switch-track {
  width: 58px; height: 32px;
  background: var(--container);
  border: 1px solid var(--border);
  border-radius: 30px;
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px;
  transition: background .3s;
}
.theme-switch-track i { font-size: 12px; color: var(--text3); z-index: 1; transition: color .3s; }
.theme-switch-track .knob {
  position: absolute; top: 3px; right: 3px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--grad);
  transition: transform .45s var(--ease-spring);
  box-shadow: 0 4px 10px -2px color-mix(in srgb, var(--buttons) 60%, transparent);
}
.theme-switch input:not(:checked) ~ .theme-switch-track .fa-sun { color: #fff; }
.theme-switch input:checked ~ .theme-switch-track .fa-moon { color: #fff; }
.theme-switch input:checked ~ .theme-switch-track .knob { transform: translateX(-26px); }
