/* =========================================
   TESTS / QUIZ / DIAGNOSTIC — Chiroyli sahifa
   ========================================= */

.ts-page {
  position: relative;
  min-height: 100vh;
  padding: 40px 0 80px;
  background: linear-gradient(135deg, #fafbff 0%, #f4f3ff 100%);
  overflow: hidden;
}
.ts-page--diagnostic {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.ts-page__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(124, 58, 237, 0.08) 0%, transparent 40%),
    radial-gradient(ellipse at 100% 100%, rgba(59, 130, 246, 0.08) 0%, transparent 40%);
  z-index: 0;
  pointer-events: none;
}
.ts-page--diagnostic .ts-page__bg {
  background:
    radial-gradient(ellipse at 0% 0%, rgba(34, 197, 94, 0.1) 0%, transparent 40%),
    radial-gradient(ellipse at 100% 100%, rgba(22, 163, 74, 0.1) 0%, transparent 40%);
}

.ts-page__shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  z-index: 0;
  pointer-events: none;
}
.ts-page__shape--1 {
  top: -100px;
  right: -50px;
  width: 400px;
  height: 400px;
  background: rgba(124, 58, 237, 0.12);
}
.ts-page__shape--2 {
  bottom: 100px;
  left: -100px;
  width: 300px;
  height: 300px;
  background: rgba(59, 130, 246, 0.12);
}
.ts-page--diagnostic .ts-page__shape--1 { background: rgba(34, 197, 94, 0.12); }
.ts-page--diagnostic .ts-page__shape--2 { background: rgba(22, 163, 74, 0.12); }

.ts-page .container {
  position: relative;
  z-index: 1;
}

.ts-wrap {
  max-width: 760px;
  margin: 30px auto 0;
}

/* ===== INTRO ===== */
.ts-intro {
  text-align: center;
  background: #fff;
  border-radius: 24px;
  padding: 56px 48px;
  box-shadow: 0 20px 50px rgba(2, 6, 23, 0.06), 0 4px 16px rgba(2, 6, 23, 0.04);
  border: 1px solid rgba(2, 6, 23, 0.05);
  animation: tsFadeUp 0.5s ease;
}

.ts-intro__eyebrow {
  display: inline-block;
  padding: 6px 16px;
  background: linear-gradient(135deg, #7c3aed15, #3b82f615);
  color: #7c3aed;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.ts-page--diagnostic .ts-intro__eyebrow {
  background: linear-gradient(135deg, #16a34a15, #22c55e15);
  color: #16a34a;
}

.ts-intro__title {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #0f172a;
  margin: 0 0 14px;
}

.ts-intro__sub {
  font-size: 18px;
  color: #475569;
  margin: 0 0 24px;
  line-height: 1.5;
}

.ts-intro__text {
  font-size: 15px;
  color: #64748b;
  margin: 0 0 32px;
  line-height: 1.6;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.ts-intro__meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 auto 36px;
  max-width: 520px;
  padding: 10px;
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

.ts-intro__meta-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  text-align: left;
  transition: background-color .2s ease;
}
.ts-intro__meta-item + .ts-intro__meta-item {
  position: relative;
}
.ts-intro__meta-item + .ts-intro__meta-item::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 18%;
  bottom: 18%;
  width: 1px;
  background: rgba(15, 23, 42, 0.06);
}

.ts-intro__meta-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #ede9fe, #e0e7ff);
  color: #7c3aed;
}
.ts-intro__meta-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}
.ts-page--diagnostic .ts-intro__meta-icon {
  background: linear-gradient(135deg, #dcfce7, #d1fae5);
  color: #16a34a;
}
.ts-intro__meta-item:nth-child(2) .ts-intro__meta-icon {
  background: linear-gradient(135deg, #dbeafe, #e0f2fe);
  color: #2563eb;
}
.ts-intro__meta-item:nth-child(3) .ts-intro__meta-icon {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #d97706;
}

.ts-intro__meta-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.ts-intro__meta-item strong {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.ts-intro__meta-item small {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  margin-top: 2px;
}

.ts-intro__btn {
  padding: 16px 40px;
  font-size: 16px;
}

/* ===== QUIZ / QUESTIONS ===== */
.ts-quiz {
  background: #fff;
  border-radius: 24px;
  padding: 44px 48px;
  box-shadow: 0 20px 50px rgba(2, 6, 23, 0.06), 0 4px 16px rgba(2, 6, 23, 0.04);
  border: 1px solid rgba(2, 6, 23, 0.05);
  animation: tsFadeUp 0.4s ease;
}

.ts-quiz__header {
  margin-bottom: 32px;
}

.ts-quiz__progress {
  height: 6px;
  background: #e2e8f0;
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 10px;
}
.ts-quiz__progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #3b82f6);
  border-radius: 100px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.ts-page--diagnostic .ts-quiz__progress-bar {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.ts-quiz__step {
  font-size: 13px;
  color: #64748b;
  text-align: right;
  margin: 0;
  font-weight: 600;
}

.ts-question {
  animation: tsFadeIn 0.3s ease;
}

.ts-question__title {
  font-size: 26px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.ts-question__hint {
  font-size: 14px;
  color: #64748b;
  margin: 0 0 24px;
}

.ts-question__options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ts-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: #0f172a;
  transition: all 0.2s ease;
  position: relative;
}

.ts-option:hover {
  border-color: #7c3aed;
  background: #faf5ff;
  transform: translateX(4px);
}
.ts-page--diagnostic .ts-option:hover {
  border-color: #16a34a;
  background: #f0fdf4;
}

.ts-option__icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.ts-option__text {
  flex: 1;
}

.ts-option__check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  font-size: 14px;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.ts-option--selected {
  border-color: #7c3aed;
  background: linear-gradient(135deg, #faf5ff, #eef2ff);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}
.ts-option--selected .ts-option__check {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}
.ts-page--diagnostic .ts-option--selected {
  border-color: #16a34a;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}
.ts-page--diagnostic .ts-option--selected .ts-option__check {
  background: #16a34a;
  border-color: #16a34a;
}

.ts-quiz__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  gap: 12px;
}

.ts-quiz__nav .btn--primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== RESULT ===== */
.ts-result {
  animation: tsFadeUp 0.5s ease;
}

.ts-result__card {
  background: #fff;
  border-radius: 24px;
  padding: 56px 48px;
  box-shadow: 0 20px 50px rgba(2, 6, 23, 0.08), 0 4px 16px rgba(2, 6, 23, 0.04);
  border: 1px solid rgba(2, 6, 23, 0.05);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.ts-result__card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, #7c3aed, #3b82f6);
}
.ts-result__card--success::before { background: linear-gradient(90deg, #16a34a, #22c55e); }
.ts-result__card--warning::before { background: linear-gradient(90deg, #f59e0b, #f97316); }
.ts-result__card--info::before    { background: linear-gradient(90deg, #0ea5e9, #3b82f6); }
.ts-result__card--brand::before   { background: linear-gradient(90deg, #a21539, #ef4444); }

.ts-result__icon {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 18px;
  animation: tsBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ts-result__title {
  font-size: 30px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.ts-result__description {
  font-size: 16px;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 28px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.ts-result__score {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: 100px;
  margin-bottom: 28px;
  font-weight: 700;
}
.ts-result__score strong {
  font-size: 32px;
  color: #b45309;
}
.ts-result__score span {
  font-size: 14px;
  color: #92400e;
}

.ts-result__buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.ts-result__note {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  margin: 18px auto 18px;
  max-width: 480px;
  font-style: italic;
}

.ts-result__retry {
  background: transparent;
  border: none;
  color: #7c3aed;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  transition: background 0.2s;
  font-family: inherit;
}
.ts-result__retry:hover {
  background: #f4f3ff;
}
.ts-page--diagnostic .ts-result__retry {
  color: #16a34a;
}
.ts-page--diagnostic .ts-result__retry:hover {
  background: #f0fdf4;
}

/* ===== ANIMATIONS ===== */
@keyframes tsFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes tsFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes tsBounce {
  0%   { transform: scale(0); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ===== MOBILE ===== */
@media (max-width: 720px) {
  .ts-intro,
  .ts-quiz,
  .ts-result__card {
    padding: 32px 24px;
    border-radius: 18px;
  }
  .ts-intro__title { font-size: 28px; }
  .ts-intro__sub   { font-size: 15px; }
  .ts-question__title { font-size: 20px; }
  .ts-intro__meta { grid-template-columns: 1fr; gap: 4px; padding: 8px; }
  .ts-intro__meta-item { padding: 10px 12px; }
  .ts-intro__meta-item + .ts-intro__meta-item::before {
    left: 12px;
    right: 12px;
    top: -2px;
    bottom: auto;
    width: auto;
    height: 1px;
  }
  .ts-intro__meta-item strong { font-size: 16px; }
  .ts-option { padding: 14px 16px; font-size: 14px; }
  .ts-result__icon { font-size: 56px; }
  .ts-result__title { font-size: 24px; }
  .ts-quiz__nav { flex-direction: column-reverse; }
  .ts-quiz__nav .btn { width: 100%; }
}
