/* assets/exam.css — IranUni Exam design system
   نسخه‌ی «خفن»‌شده (۲۰۲۶-۰۹-۰۳): همون خانواده‌ی رنگیِ iranuni-panel («Nocturne» — زمینه‌ی
   تیره‌ی سرمه‌ای، لهجه‌ی بنفش‌آبی)، ولی با بلوب‌هایِ محیطیِ متحرک، کارتِ شیشه‌ای
   (glassmorphism)، دکمه‌های گرادیانیِ درخشان، و گزینه‌های آزمون با نشانِ حرفِ گزینه —
   طبقِ راهنمایِ اسکیلِ ui-ux-pro-max (سبکِ Modern Dark + Glassmorphism). */
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/vazirmatn.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

.iexam-app {
  --iexam-bg: #12131f;
  --iexam-bg-2: #181a2a;
  --iexam-surface: rgba(35, 37, 50, .62);
  --iexam-surface-2: rgba(255, 255, 255, .05);
  --iexam-fg: #f1f1f5;
  --iexam-muted-fg: rgba(233, 233, 237, .58);
  --iexam-border: rgba(233, 233, 237, .12);
  --iexam-border-strong: rgba(233, 233, 237, .22);

  --iexam-accent: #8b7cf0;
  --iexam-accent-2: #5b8cff;
  --iexam-accent-hover: #9d8ff5;
  --iexam-accent-dim: rgba(139, 124, 240, .16);
  --iexam-accent-fg: #ffffff;
  --iexam-accent-glow: rgba(139, 124, 240, .35);

  --iexam-success: #4ade80;
  --iexam-destructive: #fb7185;
  --iexam-destructive-dim: rgba(251, 113, 133, .14);

  --iexam-radius: 20px;
  --iexam-radius-sm: 12px;
  --iexam-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 45px rgba(0, 0, 0, .45);

  position: relative;
  font-family: 'Vazirmatn', 'Inter', Tahoma, sans-serif;
  color: var(--iexam-fg);
  background: radial-gradient(120% 100% at 15% -10%, #23264a 0%, var(--iexam-bg) 45%), var(--iexam-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.7;
  direction: rtl;
  overflow-x: hidden;
}

.iexam-app * { box-sizing: border-box; }
.iexam-app a, .iexam-app button { cursor: pointer; }

/* ---- بلوب‌هایِ محیطیِ متحرک (پس‌زمینه) ---- */
.iexam-app::before,
.iexam-app::after {
  content: '';
  position: fixed;
  z-index: 0;
  width: 42vw;
  height: 42vw;
  max-width: 560px;
  max-height: 560px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .28;
  pointer-events: none;
  animation: iexam-blob-drift 18s ease-in-out infinite alternate;
}
.iexam-app::before {
  top: -10%;
  right: -8%;
  background: radial-gradient(circle, var(--iexam-accent) 0%, transparent 70%);
}
.iexam-app::after {
  bottom: -14%;
  left: -10%;
  background: radial-gradient(circle, var(--iexam-accent-2) 0%, transparent 70%);
  animation-delay: -9s;
}
@keyframes iexam-blob-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-4%, 5%) scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .iexam-app::before, .iexam-app::after { animation: none; }
}

.iexam-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--iexam-border);
  background: rgba(18, 19, 31, .55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  flex-wrap: wrap;
}
.iexam-logo { display: flex; align-items: center; gap: .6rem; color: var(--iexam-fg); text-decoration: none; font-weight: 700; }
.iexam-logo-mark {
  width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--iexam-accent), var(--iexam-accent-2));
  color: var(--iexam-accent-fg); font-weight: 800;
  box-shadow: 0 4px 14px var(--iexam-accent-glow);
}

.iexam-main { position: relative; z-index: 1; flex: 1; padding: 2.5rem 1.5rem; }
.iexam-page { max-width: 960px; margin: 0 auto; }

.iexam-card {
  background: var(--iexam-surface);
  border: 1px solid var(--iexam-border);
  border-radius: var(--iexam-radius);
  box-shadow: var(--iexam-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 2.2rem;
  animation: iexam-rise .5s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes iexam-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .iexam-card { animation: none; }
}

.iexam-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--iexam-border-strong); border-radius: var(--iexam-radius-sm);
  padding: .9rem 1.4rem; font-size: .95rem; font-weight: 700;
  background: var(--iexam-surface-2); color: var(--iexam-fg);
  text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease, filter .15s ease;
}
.iexam-btn:hover { transform: translateY(-1px); }
.iexam-btn:active { transform: translateY(0) scale(.98); }
.iexam-btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--iexam-accent), var(--iexam-accent-2));
  color: var(--iexam-accent-fg);
  box-shadow: 0 8px 24px var(--iexam-accent-glow);
}
.iexam-btn--primary:hover { filter: brightness(1.08); box-shadow: 0 10px 30px var(--iexam-accent-glow); }
.iexam-btn--block { width: 100%; }
.iexam-btn--lg { padding: 1.05rem 1.6rem; font-size: 1.05rem; }
.iexam-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.iexam-group { margin-bottom: 1.15rem; }
.iexam-group label { display: block; margin-bottom: .5rem; font-weight: 600; font-size: .9rem; color: var(--iexam-fg); }
.iexam-field {
  width: 100%; padding: .85rem 1.05rem; border-radius: var(--iexam-radius-sm);
  border: 1px solid var(--iexam-border-strong); background: rgba(255, 255, 255, .04);
  color: var(--iexam-fg); font-family: inherit; font-size: .95rem;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.iexam-field:focus { outline: none; border-color: var(--iexam-accent); background: rgba(255, 255, 255, .06); box-shadow: 0 0 0 4px var(--iexam-accent-dim); }
.iexam-field::placeholder { color: var(--iexam-muted-fg); }

.iexam-alert {
  padding: .9rem 1.05rem; border-radius: var(--iexam-radius-sm); font-size: .9rem; font-weight: 600;
  margin-bottom: 1rem; display: none;
  border: 1px solid transparent;
}
.iexam-alert--error { background: var(--iexam-destructive-dim); color: var(--iexam-destructive); border-color: rgba(251, 113, 133, .3); }

/* ---- Landing: 3-card grid ---- */
.iexam-landing-title {
  font-size: clamp(1.5rem, 1.15rem + 1.4vw, 2.1rem);
  font-weight: 800; text-align: center; margin: 0 0 .6rem;
  background: linear-gradient(90deg, var(--iexam-fg), var(--iexam-accent-hover));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.iexam-landing-sub { color: var(--iexam-muted-fg); text-align: center; margin: 0 0 2.4rem; font-size: 1.02rem; }
.iexam-landing-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem;
}
@media (max-width: 720px) {
  .iexam-landing-grid { grid-template-columns: 1fr; }
}
.iexam-option-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: .95rem; padding: 2.3rem 1.5rem; text-decoration: none;
  background: var(--iexam-surface);
  border: 1px solid var(--iexam-border); border-radius: var(--iexam-radius);
  box-shadow: var(--iexam-shadow);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  transition: transform .25s cubic-bezier(.16, 1, .3, 1), border-color .25s ease, box-shadow .25s ease;
}
.iexam-option-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--iexam-accent-dim), transparent 60%);
  opacity: 0; transition: opacity .25s ease;
}
.iexam-option-card:hover {
  border-color: var(--iexam-accent);
  transform: translateY(-6px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, .5), 0 0 0 1px var(--iexam-accent-glow);
}
.iexam-option-card:hover::before { opacity: 1; }
.iexam-option-icon {
  position: relative; z-index: 1;
  width: 64px; height: 64px; display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem; border-radius: 18px;
  background: linear-gradient(135deg, var(--iexam-accent-dim), rgba(91, 140, 255, .12));
  border: 1px solid var(--iexam-border);
  transition: transform .25s cubic-bezier(.16, 1, .3, 1);
}
.iexam-option-card:hover .iexam-option-icon { transform: scale(1.08) rotate(-4deg); }
.iexam-option-title { position: relative; z-index: 1; font-size: 1.12rem; font-weight: 800; color: var(--iexam-fg); }
.iexam-option-desc { position: relative; z-index: 1; font-size: .87rem; color: var(--iexam-muted-fg); }

/* ---- Quiz steps: question/options/timer (shared by placement/vak/final) ---- */
.iexam-q-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.iexam-q-counter { font-size: .85rem; font-weight: 700; color: var(--iexam-muted-fg); background: var(--iexam-surface-2); padding: .4rem .9rem; border-radius: 20px; border: 1px solid var(--iexam-border); }
.iexam-timer-badge { font-size: .9rem; font-weight: 800; color: var(--iexam-destructive); background: var(--iexam-destructive-dim); padding: .4rem .9rem; border-radius: 20px; font-variant-numeric: tabular-nums; }
.iexam-timer-track { width: 100%; height: 6px; background: var(--iexam-surface-2); border-radius: 10px; margin-bottom: 1.7rem; overflow: hidden; }
.iexam-timer-bar { height: 100%; width: 100%; background: linear-gradient(90deg, var(--iexam-destructive), var(--iexam-accent)); transition: width .1s linear; border-radius: 10px; }
.iexam-q-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 1.5rem; direction: ltr; text-align: left; line-height: 1.55; }

.iexam-opt-box {
  position: relative;
  display: flex; align-items: center; gap: .9rem;
  background: rgba(255, 255, 255, .035); border: 2px solid var(--iexam-border);
  padding: 1rem 1.1rem; border-radius: var(--iexam-radius-sm); margin-bottom: .8rem; cursor: pointer;
  direction: ltr; text-align: left; font-size: 1rem;
  transition: border-color .18s ease, background .18s ease, transform .12s ease, box-shadow .18s ease;
}
.iexam-opt-box:hover { border-color: var(--iexam-border-strong); background: rgba(255, 255, 255, .06); transform: translateY(-1px); }
.iexam-opt-box.is-selected {
  border-color: var(--iexam-accent);
  background: var(--iexam-accent-dim);
  box-shadow: 0 0 0 3px var(--iexam-accent-dim);
}
.iexam-opt-box input { display: none; }
.iexam-opt-letter {
  flex: none;
  width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 800;
  background: var(--iexam-surface-2); color: var(--iexam-muted-fg);
  border: 1px solid var(--iexam-border);
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.iexam-opt-box.is-selected .iexam-opt-letter {
  background: linear-gradient(135deg, var(--iexam-accent), var(--iexam-accent-2));
  color: var(--iexam-accent-fg);
  border-color: transparent;
}
.iexam-opt-text { flex: 1; }

.iexam-final-result { text-align: center; padding: 2rem 0; }
.iexam-final-result::before {
  content: '✓';
  display: flex; align-items: center; justify-content: center;
  width: 68px; height: 68px; margin: 0 auto 1.2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--iexam-accent), var(--iexam-accent-2));
  color: #fff; font-size: 1.9rem; font-weight: 800;
  box-shadow: 0 10px 30px var(--iexam-accent-glow);
  animation: iexam-pop .45s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes iexam-pop {
  from { opacity: 0; transform: scale(.6); }
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .iexam-final-result::before { animation: none; }
}
