/* ============================================================
   ARIO — 01 BASE
   Reset · Tokens · Base · Container · Buttons · Flash · Nav Icons
   Coming Soon Modal · Centered White Toasts with Sticker Icons
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ---------- Design Tokens ---------- */
:root {
  --blue-50:  #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a8a;

  --yellow-300: #FDE68A;
  --yellow-400: #FBBF24;
  --yellow-500: #F59E0B;
  --yellow-600: #D97706;

  --ink-900: #0a0f1e;
  --ink-800: #111827;
  --ink-700: #1f2937;
  --ink-600: #374151;
  --ink-500: #6b7280;
  --ink-400: #9ca3af;
  --ink-300: #d1d5db;
  --ink-200: #e5e7eb;
  --ink-100: #f3f4f6;
  --ink-50:  #f9fafb;

  --bg:        #fbfcfe;
  --surface:   #ffffff;
  --border:    #e8ecf3;
  --text:      #0b1220;
  --text-soft: #4b5a72;

  --success: #10b981;
  --danger:  #ef4444;
  --warning: #f59e0b;

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow:    0 4px 16px rgba(15, 23, 42, .07);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, .08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .12);
  --shadow-xl: 0 40px 100px rgba(15, 23, 42, .16);
  --shadow-brand: 0 12px 32px rgba(59, 130, 246, .28);
  --shadow-yellow: 0 12px 32px rgba(245, 158, 11, .28);

  --font-fa: 'Vazirmatn', system-ui, sans-serif;
  --font-en: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --container: 1200px;
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--font-fa);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.85;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 60% at 15% 5%,  rgba(244, 114, 182, .08), transparent 60%),
    radial-gradient(ellipse 70% 50% at 85% 15%, rgba(96, 165, 250, .08), transparent 60%),
    radial-gradient(ellipse 90% 60% at 50% 55%, rgba(168, 85, 247, .06), transparent 65%),
    radial-gradient(ellipse 70% 50% at 20% 95%, rgba(34, 211, 238, .07), transparent 60%),
    radial-gradient(ellipse 80% 50% at 85% 100%, rgba(245, 158, 11, .07), transparent 60%),
    #fbfcfe;
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: clip;
  position: relative;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }

.container {
  width: min(var(--container), 92%);
  margin-inline: auto;
  position: relative;
  z-index: 2;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .85rem 1.7rem;
  border-radius: 14px;
  border: none;
  font-family: var(--font-fa);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .2s cubic-bezier(.4,0,.2,1), box-shadow .25s,
              background .25s, color .25s, border-color .25s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.4) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .6s;
}
.btn:hover::before { transform: translateX(100%); }

.btn-primary {
  background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
  background-size: 200% 200%;
  color: #fff;
  box-shadow: var(--shadow-brand);
  animation: gradientShift 5s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--blue-600), var(--yellow-500));
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(59, 130, 246, .4);
}

.btn-ghost {
  background: rgba(255,255,255,.9);
  color: var(--blue-700);
  border: 1.5px solid var(--border);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  border-color: var(--blue-400);
  color: var(--blue-700);
  background: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-sm { padding: .55rem 1.15rem; font-size: .86rem; border-radius: 11px; }
.btn-lg { padding: 1.05rem 2.2rem; font-size: 1rem; border-radius: 16px; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }

/* ---------- Flash (legacy inline) ---------- */
.flash {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .9rem 1.1rem;
  border-radius: var(--radius);
  font-size: .92rem;
  font-weight: 500;
  margin: 1.2rem 0;
  border: 1px solid transparent;
  animation: slideDown .4s ease;
}
.flash-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: .75rem;
  flex-shrink: 0;
}
.flash-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.flash-success .flash-icon { background: var(--success); color: #fff; }
.flash-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.flash-error .flash-icon { background: var(--danger); color: #fff; }
.flash-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.flash-warning .flash-icon { background: var(--warning); color: #fff; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Nav Icons ---------- */
.nav-link .nav-icon,
.btn-register .nav-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  color: var(--icon-color, var(--text-soft));
  filter: none;
  animation: none;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), color .2s ease;
  will-change: transform;
}

.nav-icon-home,
.nav-icon-courses,
.nav-icon-bonus,
.nav-icon-learn,
.nav-icon-contest,
.nav-icon-support,
.nav-icon-login,
.nav-icon-dashboard,
.nav-icon-logout,
.nav-icon-shield { --icon-color: var(--text-soft); }

.nav-icon-register { --icon-color: #ffffff; }

.nav-link:hover .nav-icon {
  color: var(--blue-700);
  transform: scale(1.1);
}
.btn-register:hover .nav-icon {
  color: #ffffff;
  transform: scale(1.08);
}

@media (max-width: 980px) {
  .nav-link .nav-icon,
  .btn-register .nav-icon { width: 15px; height: 15px; }
}

.nav-icon-bonus {
  transform-origin: 70% 75%;
  animation: iconWiggle 3.2s ease-in-out infinite;
}
.nav-icon-learn { animation: iconFloat 2.6s ease-in-out infinite; }
.nav-icon-contest {
  transform-origin: center;
  animation: iconPulseRing 2.2s ease-in-out infinite;
}

@keyframes iconWiggle {
  0%, 100% { transform: rotate(0deg); }
  6%       { transform: rotate(-12deg); }
  12%      { transform: rotate(10deg); }
  18%      { transform: rotate(-6deg); }
  24%      { transform: rotate(0deg); }
}
@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
@keyframes iconPulseRing {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 0 currentColor); opacity: 1; }
  50%      { transform: scale(1.14); filter: drop-shadow(0 0 4px currentColor); opacity: .85; }
}

/* ============================================================
   COMING SOON MODAL
   ============================================================ */
.coming-soon-modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 4, 15, .72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 1rem;
  animation: fadeIn .25s ease;
}
.coming-soon-modal.active { display: flex; }

.coming-soon-card {
  position: relative;
  background: linear-gradient(160deg, #ffffff 0%, #f8fbff 100%);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem 2rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 40px 100px rgba(0, 0, 0, .35), 0 0 0 1.5px rgba(59, 130, 246, .22);
  animation: modalIn .4s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.coming-soon-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #7c3aed, #ec4899, #f59e0b, #3b82f6);
  background-size: 300% 100%;
  animation: borderShine 5s linear infinite;
}
.coming-soon-close {
  position: absolute;
  top: .9rem; right: .9rem;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, .07);
  color: #475569;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s, transform .2s;
}
.coming-soon-close:hover {
  background: rgba(239, 68, 68, .16);
  color: #dc2626;
  transform: rotate(90deg);
}
.coming-soon-icon {
  font-size: 3.5rem;
  margin-bottom: .6rem;
  display: inline-block;
  animation: statIconFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 8px 20px rgba(59, 130, 246, .35));
}
.coming-soon-title {
  font-family: var(--font-fa);
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: .7rem;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed 55%, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.coming-soon-text {
  font-family: var(--font-fa);
  font-size: .95rem;
  line-height: 2;
  color: #475569;
  font-weight: 500;
  margin-bottom: 1.8rem;
}
.coming-soon-text b { color: #1d4ed8; font-weight: 800; }

/* ============================================================
   ✅ FLASH TOASTS — Centered · Simple white card + sticker icon
   ============================================================ */
.flash-stack {
  position: fixed;
  top: 118px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99998;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  width: min(100% - 2rem, 520px);
  max-width: 520px;
  pointer-events: none;
  direction: rtl;
}

@media (max-width: 768px) {
  .flash-stack {
    top: 96px;
    width: calc(100% - 1.5rem);
    max-width: none;
  }
}

/* ✅ کارت سفیدِ ساده — بدون گرادیان، بدون نوار بالا، بدون آکسنت کناری */
.flash-toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem 1.1rem;
  border-radius: 16px;

  background: #ffffff;
  color: var(--ink-800);

  border: 1.5px solid var(--border);
  box-shadow:
    0 12px 32px rgba(15, 23, 42, .1),
    0 2px 6px rgba(15, 23, 42, .05);

  overflow: hidden;
  isolation: isolate;
  pointer-events: auto;
  animation: flashToastIn .5s cubic-bezier(.34, 1.4, .5, 1) both;
  transform-origin: top center;
  will-change: transform, opacity;
}

.flash-toast.is-leaving {
  animation: flashToastOut .35s cubic-bezier(.4, 0, .2, 1) both;
}

/* ✅ استیکر — هم‌سبک با .acad-why-sticker */
.flash-toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  color: currentColor;
  transition: transform .4s cubic-bezier(.34, 1.3, .5, 1);
}
.flash-toast-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  stroke: currentColor;
}

/* ✅ متن ساده */
.flash-toast-text {
  flex: 1;
  min-width: 0;
  font-family: var(--font-fa);
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.75;
  color: var(--ink-800);
  word-break: break-word;
}
.flash-toast-text b {
  font-weight: 900;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed 55%, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ✅ دکمه بستن ساده */
.flash-toast-close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, .05);
  color: #94a3b8;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background .2s, color .25s, transform .25s;
  -webkit-tap-highlight-color: transparent;
}
.flash-toast-close svg { width: 11px; height: 11px; }
.flash-toast-close:hover {
  background: rgba(239, 68, 68, .12);
  color: #dc2626;
  transform: rotate(90deg);
}

/* ✅ تایم‌لاین ساده — یک خط نازک در پایین کارت */
.flash-toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform-origin: right center;
  animation: flashToastProgress linear forwards;
  animation-duration: var(--flash-duration, 4200ms);
  z-index: 2;
  pointer-events: none;
  opacity: .85;
}

/* ✅ پاپ از مرکز */
@keyframes flashToastIn {
  0%   { opacity: 0; transform: scale(.85); filter: blur(4px); }
  55%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes flashToastOut {
  0%   { opacity: 1; transform: scale(1); max-height: 140px; margin-bottom: 0; }
  100% { opacity: 0; transform: scale(.85); max-height: 0; margin-bottom: -.65rem;
         padding-top: 0; padding-bottom: 0; }
}

@keyframes flashToastProgress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ============================================================
   ✅ STICKER VARIANTS — هم‌سبک با .acad-why-icon-* / .acad-why-sticker
   ============================================================ */

/* Success — سبز · heartbeat */
.flash-toast-success .flash-toast-icon {
  color: #10b981;
  filter:
    drop-shadow(0 0 6px rgba(16, 185, 129, .55))
    drop-shadow(0 0 14px rgba(16, 185, 129, .3));
  animation: flashStickerHeartbeat 2.6s ease-in-out infinite;
}
.flash-toast-success .flash-toast-progress {
  background: linear-gradient(90deg, #10b981, #34d399);
}

/* Error — قرمز · pulse */
.flash-toast-error .flash-toast-icon {
  color: #ef4444;
  filter:
    drop-shadow(0 0 6px rgba(239, 68, 68, .55))
    drop-shadow(0 0 14px rgba(239, 68, 68, .3));
  animation: flashStickerPulse 2.4s ease-in-out infinite;
}
.flash-toast-error .flash-toast-progress {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Warning — کهربایی · wave */
.flash-toast-warning .flash-toast-icon {
  color: #f59e0b;
  filter:
    drop-shadow(0 0 6px rgba(245, 158, 11, .55))
    drop-shadow(0 0 14px rgba(245, 158, 11, .3));
  animation: flashStickerWave 3.2s ease-in-out infinite;
  transform-origin: 50% 80%;
}
.flash-toast-warning .flash-toast-progress {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* Info + Welcome — بنفش/آبی · float */
.flash-toast-info .flash-toast-icon,
.flash-toast-welcome .flash-toast-icon {
  color: #7c3aed;
  filter:
    drop-shadow(0 0 6px rgba(124, 58, 237, .55))
    drop-shadow(0 0 14px rgba(124, 58, 237, .3));
  animation: flashStickerFloat 3.2s ease-in-out infinite;
}
.flash-toast-info .flash-toast-progress,
.flash-toast-welcome .flash-toast-progress {
  background: linear-gradient(90deg, #7c3aed, #3b82f6);
}

/* ✅ انیمیشن‌های استیکر — مطابق acad-why */
@keyframes flashStickerHeartbeat {
  0%, 100% { transform: scale(1); }
  20%      { transform: scale(1.10); }
  40%      { transform: scale(.98); }
  60%      { transform: scale(1.06); }
  80%      { transform: scale(.99); }
}
@keyframes flashStickerPulse {
  0%, 100% { transform: scale(1);    opacity: 1;   }
  50%      { transform: scale(1.10); opacity: .92; }
}
@keyframes flashStickerWave {
  0%, 100%      { transform: rotate(0deg); }
  15%, 45%, 75% { transform: rotate(12deg); }
  30%, 60%, 90% { transform: rotate(-8deg); }
}
@keyframes flashStickerFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-4px) rotate(2deg); }
}

@media (max-width: 480px) {
  .flash-toast {
    padding: .9rem 1rem 1rem;
    gap: .8rem;
    border-radius: 14px;
  }
  .flash-toast-icon { width: 34px; height: 34px; }
  .flash-toast-text { font-size: .82rem; line-height: 1.7; }
  .flash-toast-close { width: 22px; height: 22px; }
}

/* ---------- Shared keyframes ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: scale(.9) translateY(24px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes borderShine {
  0%   { background-position:   0% 50%; }
  100% { background-position: 300% 50%; }
}
@keyframes statIconFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-5px) scale(1.05); }
}