/* ─────────────────────────────────────────────
   Psychometric Tests Pro — Complete Frontend CSS
─────���─────────────────────────────────────── */

:root {
  --pt-primary:  #3498db;
  --pt-success:  #2ecc71;
  --pt-danger:   #e74c3c;
  --pt-warning:  #f39c12;
  --pt-dark:     #2c3e50;
  --pt-light:    #f8f9fa;
  --pt-border:   #dce1e7;
  --pt-radius:   10px;
  --pt-shadow:   0 4px 16px rgba(0,0,0,.08);
}

/* ── Base ─────────────────────────────────── */
.pt-container {
  max-width: 820px;
  margin: 40px auto;
  padding: 0 16px;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #333;
}

/* ── Page Header ──────────────────────────── */
.pt-page-header { margin-bottom: 28px; }
.pt-page-header h2 { font-size: 26px; color: var(--pt-dark); margin: 0 0 8px; }
.pt-page-header p  { color: #666; font-size: 15px; margin: 0; }

/* ── Messages ─────────────────────────────── */
.pt-message { padding: 12px 16px; border-radius: var(--pt-radius); margin-bottom: 16px; font-size: 14px; }
.pt-success { background: #d5f5e3; color: #1e8449; border-left: 4px solid var(--pt-success); }
.pt-error   { background: #fde8e8; color: #c0392b; border-left: 4px solid var(--pt-danger); }
.pt-info    { background: #eaf4fd; color: #1a5276; border-left: 4px solid var(--pt-primary); }

/* ── Buttons ──────────────────────────────── */
.pt-btn {
  display: inline-block;
  padding: 11px 24px;
  background: var(--pt-primary);
  color: #fff !important;
  border: 2px solid var(--pt-primary);
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  text-align: center;
}
.pt-btn:hover { background: #2980b9; border-color: #2980b9; transform: translateY(-1px); }
.pt-btn-outline { background: transparent; color: var(--pt-primary) !important; }
.pt-btn-outline:hover { background: var(--pt-primary); color: #fff !important; }
.pt-btn-large { padding: 14px 36px; font-size: 17px; border-radius: 8px; }
.pt-btn-sm    { padding: 7px 14px; font-size: 13px; }

/* ── Badge / Tag ──────────────────────────── */
.pt-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  background: #eaf4fd;
  color: var(--pt-primary);
  font-weight: 600;
  margin-bottom: 8px;
}

/* ── Empty State ──────────────────────────── */
.pt-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #999;
}
.pt-empty-state p { font-size: 16px; margin: 12px 0 20px; }

/* ── Auth Forms ───────────────────────────── */
.pt-form-box {
  background: #fff;
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius);
  padding: 40px;
  box-shadow: var(--pt-shadow);
  max-width: 460px;
  margin: 0 auto;
}
.pt-form-box h2 { text-align: center; color: var(--pt-dark); margin: 0 0 24px; font-size: 24px; }
.pt-form-group { margin-bottom: 18px; }
.pt-form-group label { display: block; font-weight: 600; margin-bottom: 6px; color: #555; font-size: 14px; }
.pt-form-group input {
  width: 100%; padding: 11px 14px;
  border: 1px solid #ccc; border-radius: 6px;
  font-size: 15px; box-sizing: border-box;
  transition: border .2s, box-shadow .2s;
}
.pt-form-group input:focus {
  border-color: var(--pt-primary);
  box-shadow: 0 0 0 3px rgba(52,152,219,.12);
  outline: none;
}
.pt-form-link { text-align: center; margin-top: 18px; font-size: 14px; color: #666; }
.pt-form-link a { color: var(--pt-primary); font-weight: 600; }

/* ── Test Grid ────────────────────────────── */
.pt-test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
  gap: 22px;
  margin-top: 20px;
}
.pt-test-card {
  background: #fff;
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius);
  padding: 22px;
  box-shadow: var(--pt-shadow);
  transition: transform .2s, box-shadow .2s;
}
.pt-test-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(52,152,219,.15); }
.pt-test-card.pt-completed { border-color: var(--pt-success); }
.pt-test-card h3 { color: var(--pt-dark); margin: 6px 0 10px; font-size: 17px; }
.pt-test-card p  { color: #666; font-size: 14px; line-height: 1.5; }
.pt-test-meta    { display: flex; gap: 14px; font-size: 13px; color: #888; margin-top: 10px; }

/* ── Test Taking ──────────────────────────── */
.pt-test-header {
  background: linear-gradient(135deg,#eaf4fd,#fff);
  border: 1px solid #b3d4f0;
  border-radius: var(--pt-radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.pt-test-header-top { display: flex; justify-content: space-between; align-items: flex-start; }

.pt-timer-wrapper  { text-align: center; }
.pt-timer-icon     { font-size: 20px; }
#pt-timer {
  font-size: 26px; font-weight: 700; color: var(--pt-dark);
  font-variant-numeric: tabular-nums;
  transition: color .3s;
}
#pt-timer.pt-warning { color: var(--pt-warning); }
#pt-timer.pt-danger  { color: var(--pt-danger); animation: pt-pulse .8s infinite; }

@keyframes pt-pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

.pt-progress-wrapper { margin-bottom: 24px; }
.pt-progress-bar   { background: #ecf0f1; border-radius: 5px; height: 8px; margin-bottom: 6px; }
.pt-progress-fill  { background: var(--pt-primary); height: 8px; border-radius: 5px; transition: width .4s ease; }

.pt-question-block {
  background: #fff;
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius);
  padding: 24px;
  margin-bottom: 18px;
  transition: border-color .2s;
}
.pt-question-block.pt-answered { border-color: var(--pt-success); }
.pt-question-number { font-size: 12px; color: #999; font-weight: 600; text-transform: uppercase; margin-bottom: 8px; }
.pt-question-text   { font-size: 17px; font-weight: 600; color: var(--pt-dark); margin: 0 0 12px; line-height: 1.5; }
.pt-trait-tag {
  display: inline-block; font-size: 12px; background: #f4ecfd;
  color: #8e44ad; padding: 2px 10px; border-radius: 20px; margin-bottom: 12px;
}

.pt-options { display: flex; flex-direction: column; gap: 8px; }
.pt-option-label {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  border: 1.5px solid var(--pt-border);
  border-radius: 7px;
  cursor: pointer;
  font-size: 15px;
  transition: all .18s;
  user-select: none;
}
.pt-option-label:hover { border-color: var(--pt-primary); background: #f0f8ff; }
.pt-option-label.pt-selected { border-color: var(--pt-primary); background: #eaf4fd; font-weight: 600; }
.pt-option-label input[type="radio"] { display: none; }
.pt-option-custom {
  width: 18px; height: 18px; min-width: 18px;
  border: 2px solid #bbb; border-radius: 50%;
  transition: all .18s;
}
.pt-option-label.pt-selected .pt-option-custom {
  border-color: var(--pt-primary);
  background: var(--pt-primary);
  box-shadow: inset 0 0 0 3px #fff;
}

.pt-submit-area     { text-align: center; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--pt-border); }
.pt-unanswered-note { color: var(--pt-warning); font-size: 14px; margin-bottom: 12px; }

/* ── Single Result Hero ───────────────────── */
.pt-result-hero {
  background: linear-gradient(135deg,#eaf4fd 0%,#fff 100%);
  border: 1px solid #b3d4f0;
  border-radius: var(--pt-radius);
  padding: 36px 30px;
  text-align: center;
  margin-bottom: 28px;
}
.pt-result-badge       { font-size: 44px; margin-bottom: 8px; }
.pt-result-test-name   { font-size: 22px; color: var(--pt-dark); margin: 0 0 6px; }
.pt-result-username    { color: #666; font-size: 14px; margin: 0 0 20px; }
.pt-result-label       { font-size: 22px; font-weight: 700; color: var(--pt-dark); margin: 16px 0 8px; }
.pt-result-desc        { color: #666; font-size: 15px; max-width: 500px; margin: 0 auto; line-height: 1.6; }

/* SVG Score Ring */
.pt-score-ring         { position: relative; display: inline-block; width: 120px; height: 120px; margin: 8px auto; }
.pt-score-ring svg     { width: 120px; height: 120px; }
.pt-score-text {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: 28px; font-weight: 700; color: var(--pt-primary);
}

/* ── Traits Section ───────────────────────── */
.pt-traits-section { background: #fff; border: 1px solid var(--pt-border); border-radius: var(--pt-radius); padding: 24px; margin-bottom: 24px; }
.pt-traits-section h3 { margin: 0 0 18px; color: var(--pt-dark); }
.pt-traits-grid    { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 18px; }
.pt-trait-item     { padding: 14px; background: var(--pt-light); border-radius: 8px; }
.pt-trait-header   { display: flex; justify-content: space-between; margin-bottom: 8px; }
.pt-trait-name     { font-weight: 600; color: var(--pt-dark); font-size: 14px; }
.pt-trait-score    { font-weight: 700; color: var(--pt-primary); }
.pt-trait-track    { background: #ddd; border-radius: 4px; height: 8px; }
.pt-trait-fill     { height: 8px; border-radius: 4px; transition: width .6s ease; }
.pt-trait-pct      { font-size: 12px; color: #888; text-align: right; margin-top: 4px; }

/* ── Result Actions ───────────────────────── */
.pt-result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 24px 0; }

/* ── Results List ─────────────────────────── */
.pt-results-list   { display: flex; flex-direction: column; gap: 14px; }
.pt-result-row {
  background: #fff; border: 1px solid var(--pt-border); border-radius: var(--pt-radius);
  padding: 18px 20px; display: flex; align-items: center; gap: 18px;
  box-shadow: var(--pt-shadow); transition: transform .18s;
}
.pt-result-row:hover { transform: translateX(4px); }
.pt-result-row-score {
  width: 56px; height: 56px; min-width: 56px;
  color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
}
.pt-result-row-info     { flex: 1; }
.pt-result-row-info h4  { margin: 0 0 6px; color: var(--pt-dark); font-size: 16px; }
.pt-result-row-date     { font-size: 13px; color: #888; margin-top: 6px; }
.pt-result-label-badge  { display: inline-block; font-size: 12px; background: #eaf4fd; color: var(--pt-primary); padding: 2px 10px; border-radius: 20px; margin-right: 6px; }
.pt-trait-mini          { display: inline-block; font-size: 11px; background: #f4ecfd; color: #8e44ad; padding: 2px 8px; border-radius: 12px; margin: 2px; }
.pt-result-row-actions  { display: flex; gap: 8px; flex-direction: column; }

/* ── Leaderboard ──────────────────────────── */
.pt-podium {
  display: flex; justify-content: center; align-items: flex-end; gap: 16px;
  margin: 28px 0 36px;
}
.pt-podium-place   { text-align: center; flex: 1; max-width: 180px; }
.pt-podium-name    { font-weight: 700; font-size: 14px; color: var(--pt-dark); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-podium-score   { font-size: 22px; font-weight: 700; color: var(--pt-primary); }
.pt-podium-block {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-radius: 8px 8px 0 0;
  font-weight: 700; color: #fff;
  margin-top: 8px; padding: 10px 0;
}
.pt-leaderboard-table {
  width: 100%; border-collapse: collapse;
  background: #fff; border-radius: var(--pt-radius);
  overflow: hidden; box-shadow: var(--pt-shadow);
}
.pt-leaderboard-table thead tr { background: var(--pt-primary); color: #fff; }
.pt-leaderboard-table th,
.pt-leaderboard-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--pt-border); font-size: 14px; }
.pt-leaderboard-table tbody tr:hover { background: #f0f8ff; }
.pt-leaderboard-me  { background: #fffde7 !important; font-weight: 600; }
.pt-you-badge {
  display: inline-block; font-size: 11px; background: var(--pt-warning);
  color: #fff; padding: 1px 8px; border-radius: 10px; margin-left: 6px;
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 600px) {
  .pt-test-grid        { grid-template-columns: 1fr; }
  .pt-traits-grid      { grid-template-columns: 1fr; }
  .pt-podium           { gap: 8px; }
  .pt-result-row       { flex-direction: column; align-items: flex-start; }
  .pt-result-actions   { flex-direction: column; }
  .pt-test-header-top  { flex-direction: column; gap: 12px; }
  .pt-form-box         { padding: 24px; }
}