/* ══════════════════════════════════════════════
   تست‌یاب — Plugin CSS v2.1
   سازگار با قالب موج‌دار
   ══════════════════════════════════════════════ */

#pt-app *, #pt-app *::before, #pt-app *::after {
  box-sizing: border-box;
  font-family: Tahoma, Arial, sans-serif;
  direction: rtl;
}

#pt-app {
  max-width: 860px;
  margin: 0 auto;
  padding: 0;
}

/* ── Pages ── */
.pt-page { display: none; }
.pt-page.pt-active { display: block; animation: ptFade .35s ease; }
@keyframes ptFade { from { opacity:0; transform:translateY(14px) } to { opacity:1; transform:none } }

/* ══════════════════════════════
   صفحه اصلی — Hero
   ══════════════════════════════ */
.pt-hero {
  text-align: center;
  padding: 44px 20px 32px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-radius: 20px;
  margin-bottom: 28px;
  color: #fff;
  box-shadow: 0 8px 32px rgba(79,70,229,.3);
}
.pt-hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: .83rem;
  margin-bottom: 14px;
}
.pt-hero-title { font-size: 2.2rem; font-weight: 700; margin: 0 0 8px; line-height: 1.3; }
.pt-hero-sub   { font-size: 1rem; opacity: .9; margin: 0; }

/* ══════════════════════════════
   کارت‌های تست
   ══════════════════════════════ */
.pt-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.pt-card {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(200,210,240,.6);
  border-radius: 18px;
  padding: 24px 20px;
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  box-shadow: 0 2px 14px rgba(79,70,229,.07);
}
.pt-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 36px rgba(79,70,229,.18);
  border-color: #818cf8;
}
.pt-card-icon  { font-size: 2.4rem; margin-bottom: 12px; }
.pt-card-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 7px; color: #1e1b4b; }
.pt-card-desc  { font-size: .87rem; color: #64748b; line-height: 1.7; margin: 0 0 12px; }
.pt-card-meta  { font-size: .8rem; color: #94a3b8; margin-bottom: 14px; }
.pt-card-btn   { width: 100%; }

/* ══════════════════════════════
   ثبت‌نام
   ══════════════════════════════ */
.pt-register-wrap {
  max-width: 480px;
  margin: 0 auto;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(200,210,240,.6);
  border-radius: 22px;
  padding: 36px 30px;
  box-shadow: 0 8px 32px rgba(79,70,229,.1);
}
.pt-register-icon  { font-size: 2.8rem; text-align: center; margin-bottom: 10px; }
.pt-register-title { font-size: 1.5rem; font-weight: 700; text-align: center; margin: 0 0 5px; color: #1e1b4b; }
.pt-register-sub   { text-align: center; color: #64748b; font-size: .88rem; margin: 0 0 24px; }

.pt-form { display: flex; flex-direction: column; gap: 16px; }
.pt-field { display: flex; flex-direction: column; gap: 5px; }
.pt-field label { font-size: .88rem; font-weight: 600; color: #374151; }
.pt-field input {
  padding: 11px 13px;
  border: 2px solid #e2e8f0;
  border-radius: 11px;
  font-size: .97rem;
  font-family: Tahoma, Arial, sans-serif;
  direction: rtl;
  background: rgba(255,255,255,.9);
  transition: border-color .18s;
  outline: none;
}
.pt-field input:focus { border-color: #6366f1; }
.pt-err { font-size: .8rem; color: #ef4444; min-height: 15px; }

/* ══════════════════════════════
   دکمه‌ها
   ══════════════════════════════ */
.pt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 11px;
  font-size: .93rem;
  font-weight: 700;
  font-family: Tahoma, Arial, sans-serif;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all .2s ease;
}
.pt-btn-primary {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
}
.pt-btn-primary:hover { opacity: .88; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(79,70,229,.38); }
.pt-btn-outline {
  background: rgba(255,255,255,.85);
  color: #4f46e5;
  border-color: #818cf8;
}
.pt-btn-outline:hover { background: #eef2ff; }
.pt-btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}
.pt-btn-full { width: 100%; }
.pt-btn:disabled { opacity: .4; cursor: default; transform: none !important; }

/* ══════════════════════════════
   صفحه تست
   ══════════════════════════════ */
.pt-test-wrap {
  max-width: 700px;
  margin: 0 auto;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(200,210,240,.6);
  border-radius: 22px;
  padding: 30px 26px;
  box-shadow: 0 8px 32px rgba(79,70,229,.1);
}
.pt-test-header { margin-bottom: 22px; }
.pt-test-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}
.pt-test-title-row h2 { font-size: 1.15rem; font-weight: 700; margin: 0; flex: 1; color: #1e1b4b; }
.pt-counter {
  background: #eef2ff;
  color: #4f46e5;
  border-radius: 20px;
  padding: 3px 12px;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
}
.pt-progress-bar {
  height: 7px;
  background: #e2e8f0;
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 7px;
}
.pt-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  border-radius: 7px;
  transition: width .4s ease;
}
.pt-progress-label { font-size: .79rem; color: #94a3b8; }

.pt-question-box {
  background: linear-gradient(135deg, #f5f7ff, #ede9fe);
  border: 1px solid #c7d2fe;
  border-radius: 15px;
  padding: 22px 18px;
  margin-bottom: 18px;
}
.pt-question-num  { font-size: .8rem; color: #6366f1; font-weight: 700; margin-bottom: 8px; }
.pt-question-text { font-size: 1.08rem; font-weight: 600; line-height: 1.7; margin-bottom: 18px; color: #1e293b; }

.pt-options { display: flex; flex-direction: column; gap: 9px; }
.pt-option {
  text-align: right;
  padding: 12px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 11px;
  background: rgba(255,255,255,.9);
  font-size: .93rem;
  font-family: Tahoma, Arial, sans-serif;
  cursor: pointer;
  transition: all .18s;
  color: #374151;
}
.pt-option:hover { border-color: #a5b4fc; background: #f5f3ff; }
.pt-option-selected { border-color: #4f46e5; background: #eef2ff; color: #3730a3; font-weight: 700; }
.pt-option-selected::before { content: '✓ '; color: #4f46e5; }

.pt-test-nav { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.pt-test-nav .pt-btn { flex: 1; }

/* ══════════════════════════════
   صفحه نتیجه
   ══════════════════════════════ */
.pt-result-wrap {
  max-width: 760px;
  margin: 0 auto;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(200,210,240,.6);
  border-radius: 22px;
  padding: 34px 30px;
  box-shadow: 0 8px 32px rgba(79,70,229,.1);
}
.pt-result-header { text-align: center; margin-bottom: 28px; }
.pt-result-trophy { font-size: 3.2rem; margin-bottom: 8px; }
.pt-result-title  { font-size: 1.7rem; font-weight: 700; margin: 0 0 5px; color: #1e1b4b; }
.pt-result-testname { color: #64748b; font-size: .88rem; }

.pt-result-hero { text-align: center; margin-bottom: 26px; }
.pt-result-type-badge {
  display: inline-block;
  font-size: 2rem;
  font-weight: 700;
  color: #3730a3;
  background: #eef2ff;
  border: 2px solid #c7d2fe;
  border-radius: 14px;
  padding: 9px 26px;
  margin-bottom: 8px;
}
.pt-result-type-name { font-size: 1.3rem; font-weight: 700; color: #1e1b4b; margin-bottom: 7px; }
.pt-result-type-desc { color: #64748b; max-width: 480px; margin: 0 auto; line-height: 1.7; font-size: .95rem; }

/* Score Ring */
.pt-result-score-ring {
  width: 116px; height: 116px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  background: conic-gradient(#4f46e5 calc(var(--pct) * 1%), #e2e8f0 0);
}
.pt-ring-text {
  background: rgba(255,255,255,.95);
  border-radius: 50%;
  width: 82px; height: 82px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.pt-ring-num { font-size: 1.5rem; font-weight: 700; color: #3730a3; line-height: 1; }
.pt-ring-lbl { font-size: .72rem; color: #94a3b8; }
.pt-result-level { font-size: 1.15rem; font-weight: 700; color: #3730a3; }

/* Dim Bars */
.pt-dim-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.pt-dim-label { min-width: 150px; font-size: .85rem; color: #374151; }
.pt-dim-bar   { flex: 1; min-width: 90px; height: 9px; background: #e2e8f0; border-radius: 9px; overflow: hidden; }
.pt-dim-fill  { height: 100%; background: linear-gradient(90deg, #4f46e5, #7c3aed); border-radius: 9px; transition: width .6s ease; }
.pt-dim-stress { background: linear-gradient(90deg, #f59e0b, #ef4444) !important; }
.pt-dim-text  { font-size: .8rem; color: #4f46e5; font-weight: 700; white-space: nowrap; }

/* Result Blocks */
.pt-result-dims  { margin-bottom: 22px; }
.pt-result-block {
  background: linear-gradient(135deg, #f8faff, #f0f4ff);
  border: 1px solid #c7d2fe;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}
.pt-result-block h4 { font-size: .97rem; font-weight: 700; color: #1e1b4b; border-bottom: 2px solid #4f46e5; padding-bottom: 7px; margin: 0 0 12px; }

.pt-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.pt-tag  { border-radius: 20px; padding: 3px 12px; font-size: .82rem; font-weight: 600; }
.pt-tag-green  { background: #dcfce7; color: #166534; }
.pt-tag-orange { background: #fef3c7; color: #92400e; }
.pt-tag-blue   { background: #dbeafe; color: #1e40af; }

.pt-advice-list { margin: 0; padding-right: 18px; }
.pt-advice-list li { color: #475569; line-height: 1.9; font-size: .93rem; margin-bottom: 5px; }

.pt-result-advice {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}
.pt-result-advice h4 { font-size: .97rem; font-weight: 700; color: #166534; margin: 0 0 8px; }
.pt-result-advice p  { color: #166534; line-height: 1.7; margin: 0; font-size: .93rem; }

.pt-alert-severe {
  background: #fef2f2;
  border: 2px solid #fca5a5;
  border-radius: 11px;
  padding: 12px 16px;
  color: #991b1b;
  font-weight: 700;
  margin-bottom: 18px;
  font-size: .92rem;
}

/* Hafez */
.pt-hafez-wrap  { text-align: center; }
.pt-hafez-scroll { font-size: 2.8rem; margin-bottom: 10px; }
.pt-hafez-title  { font-size: .87rem; color: #94a3b8; margin-bottom: 14px; }
.pt-hafez-couplet {
  font-size: 1.2rem; font-weight: 700; line-height: 2;
  color: #1e1b4b;
  background: linear-gradient(135deg, #fdf4ff, #f5f0ff);
  border: 2px solid #e9d5ff;
  border-radius: 14px; padding: 22px; margin-bottom: 18px;
}
.pt-hafez-section { background: rgba(248,250,255,.9); border: 1px solid #c7d2fe; border-radius: 12px; padding: 16px; margin-bottom: 12px; text-align: right; }
.pt-hafez-section h4 { font-size: .92rem; font-weight: 700; color: #3730a3; margin: 0 0 7px; }
.pt-hafez-section p  { color: #475569; line-height: 1.8; margin: 0; font-size: .92rem; }
.pt-hafez-footer { color: #94a3b8; font-size: .8rem; margin-top: 14px; }

/* Tarot */
.pt-tarot-wrap { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 18px; }
.pt-tarot-card { background: linear-gradient(135deg,#1e1b4b,#312e81); border-radius: 14px; padding: 18px 12px; text-align: center; color: #fff; }
.pt-tarot-role    { font-size: .76rem; opacity: .7; margin-bottom: 7px; }
.pt-tarot-emoji   { font-size: 2.2rem; margin-bottom: 7px; }
.pt-tarot-name    { font-size: .97rem; font-weight: 700; margin-bottom: 5px; }
.pt-tarot-meaning { font-size: .76rem; opacity: .75; margin-bottom: 8px; line-height: 1.5; }
.pt-tarot-message { font-size: .8rem; opacity: .9; line-height: 1.6; }

/* Result Actions */
.pt-result-actions { display: flex; gap: 10px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }

/* Loading */
.pt-loading {
  position: fixed; top:0; left:0; right:0; bottom:0;
  background: rgba(255,255,255,.9);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 9999;
}
.pt-spinner {
  width: 50px; height: 50px;
  border: 5px solid #e2e8f0;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: ptSpin .8s linear infinite;
  margin-bottom: 12px;
}
@keyframes ptSpin { to { transform: rotate(360deg) } }
.pt-loading p { color: #4f46e5; font-weight: 700; }

/* Utils */
.pt-hidden { display: none !important; }

/* Print */
@media print {
  body { background: #fff !important; }
  .pt-result-actions, .pt-test-nav, #pt-home, #pt-register, #pt-test { display: none !important; }
  #pt-result { display: block !important; }
  .pt-result-wrap { box-shadow: none; border: none; backdrop-filter: none; }
}

/* Responsive */
@media (max-width: 640px) {
  .pt-hero-title { font-size: 1.65rem; }
  .pt-register-wrap, .pt-test-wrap, .pt-result-wrap { padding: 20px 14px; }
  .pt-tarot-wrap { grid-template-columns: 1fr; }
  .pt-dim-label  { min-width: 110px; font-size: .78rem; }
  .pt-result-actions { flex-direction: column; }
  .pt-result-actions .pt-btn { width: 100%; }
  .pt-cards-grid { grid-template-columns: 1fr; }
}
