/* ============================================================
   Psychology lab «آزمایشگاه روان‌شناختی» — public pages, take form, result, panel list.
   Plain CSS (no Tailwind). Dark tokens of the site, RTL (logical properties), mobile-first.
   ============================================================ */

.pl {
    --pl-canvas: #0A0A0F;
    --pl-surface: #141418;
    --pl-elevated: #1C1C22;
    --pl-border: rgba(255, 255, 255, .08);
    --pl-border-strong: rgba(255, 255, 255, .16);
    --pl-text: #F0F0F2;
    --pl-muted: #A0A0AB;
    --pl-faint: #62626D;
    --pl-accent: #6E56CF;
    --pl-accent-2: #9B8DE8;
    --pl-accent-soft: rgba(110, 86, 207, .16);
    --pl-green: #30A46C;
    --pl-yellow: #FFC53D;
    --pl-orange: #F76B15;
    --pl-red: #E5484D;
    --pl-blue: #0090FF;

    color: var(--pl-text);
    max-width: 1160px;
    margin-inline: auto;
    padding: 28px 16px 72px;
    box-sizing: border-box;
    line-height: 1.9;
}

.pl *, .pl *::before, .pl *::after { box-sizing: border-box; }
.pl a { color: inherit; text-decoration: none; }
.pl h1, .pl h2, .pl h3, .pl h4 { color: var(--pl-text); margin: 0; line-height: 1.5; }
.pl p { margin: 0; }
.pl-muted { color: var(--pl-muted); }
.pl-ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- buttons ---------- */
.pl-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
    font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s; font-family: inherit;
}
.pl-btn--primary { background: var(--pl-accent); color: #fff !important; }
.pl-btn--primary:hover { background: #7C66DC; }
.pl-btn--ghost { background: transparent; color: var(--pl-text) !important; border-color: var(--pl-border-strong); }
.pl-btn--ghost:hover { border-color: var(--pl-accent-2); color: var(--pl-accent-2) !important; }
.pl-btn--success { background: var(--pl-green); color: #fff !important; }
.pl-btn--success:hover { background: #2B9562; }
.pl-btn--block { width: 100%; }
.pl-btn--sm { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.pl-btn:focus-visible { outline: 2px solid var(--pl-accent-2); outline-offset: 2px; }
.pl-btn[disabled] { opacity: .6; cursor: not-allowed; }

/* ---------- hero ---------- */
.pl-hero {
    position: relative; overflow: hidden; border-radius: 20px; padding: 28px 20px;
    background: radial-gradient(120% 140% at 100% 0%, rgba(110, 86, 207, .35) 0%, rgba(20, 20, 24, 0) 60%), var(--pl-surface);
    border: 1px solid var(--pl-border); margin-bottom: 28px;
}
.pl-eyebrow {
    display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--pl-accent-2);
    background: var(--pl-accent-soft); padding: 4px 12px; border-radius: 999px; margin-bottom: 12px;
}
.pl-hero h1 { font-size: 26px; font-weight: 800; margin-bottom: 10px; }
.pl-hero p { color: var(--pl-muted); font-size: 15px; max-width: 760px; }
.pl-hero__stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.pl-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: rgba(255, 255, 255, .05); border: 1px solid var(--pl-border); color: var(--pl-muted);
}
.pl-chip--accent { color: var(--pl-accent-2); border-color: rgba(155, 141, 232, .35); background: var(--pl-accent-soft); }
.pl-chip--green { color: #4CC38A; border-color: rgba(48, 164, 108, .35); background: rgba(48, 164, 108, .12); }

.pl-breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--pl-muted); margin-bottom: 16px; }
.pl-breadcrumb a:hover { color: var(--pl-accent-2); }

/* ---------- collections ---------- */
.pl-collections { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 36px; }
.pl-collection {
    display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px;
    background: var(--pl-surface); border: 1px solid var(--pl-border); transition: border-color .15s, transform .15s;
}
.pl-collection:hover { border-color: rgba(155, 141, 232, .5); transform: translateY(-2px); }
.pl-collection.is-active { border-color: var(--pl-accent); background: linear-gradient(180deg, rgba(110, 86, 207, .14), var(--pl-surface)); }
.pl-collection__icon {
    flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
    background: var(--pl-accent-soft); color: var(--pl-accent-2);
}
.pl-collection__title { font-size: 14px; font-weight: 700; line-height: 1.7; }
.pl-collection__count { font-size: 12px; color: var(--pl-muted); }

/* ---------- section head ---------- */
.pl-section { margin-bottom: 40px; }
.pl-section__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.pl-section__title { font-size: 19px; font-weight: 800; }
.pl-section__line { flex: 1; height: 1px; background: var(--pl-border); }
.pl-section__more { font-size: 13px; color: var(--pl-accent-2); }

/* ---------- test cards ---------- */
.pl-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.pl-family { display: flex; flex-direction: column; gap: 10px; padding: 0; }
.pl-family--multi { padding: 12px; border-radius: 18px; border: 1px dashed rgba(155, 141, 232, .35); background: rgba(110, 86, 207, .05); }
.pl-family__label { font-size: 12px; font-weight: 700; color: var(--pl-accent-2); padding-inline: 4px; }
.pl-card {
    display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 16px; height: 100%;
    background: var(--pl-surface); border: 1px solid var(--pl-border); transition: border-color .15s;
}
.pl-card:hover { border-color: rgba(155, 141, 232, .45); }
.pl-card__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-card__title { font-size: 16px; font-weight: 800; line-height: 1.7; }
.pl-card__title a:hover { color: var(--pl-accent-2); }
.pl-card__desc { font-size: 13px; color: var(--pl-muted); line-height: 2; }
.pl-card__meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--pl-muted); }
.pl-card__meta span { display: inline-flex; align-items: center; gap: 5px; }
.pl-card__foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--pl-border); }
.pl-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pl-price { font-size: 17px; font-weight: 800; color: var(--pl-text); }
.pl-price small { font-size: 12px; color: var(--pl-muted); font-weight: 500; }
.pl-empty { padding: 32px 20px; text-align: center; border-radius: 16px; border: 1px dashed var(--pl-border-strong); color: var(--pl-muted); }

/* ---------- test page ---------- */
.pl-layout { display: grid; grid-template-columns: 1fr; gap: 20px; }
.pl-panel { padding: 20px; border-radius: 16px; background: var(--pl-surface); border: 1px solid var(--pl-border); }
.pl-panel + .pl-panel { margin-top: 16px; }
.pl-panel__title { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.pl-test-title { font-size: 23px; font-weight: 800; margin-bottom: 6px; }
.pl-test-en { font-size: 13px; color: var(--pl-faint); margin-bottom: 14px; }
.pl-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0; }
.pl-fact { padding: 12px; border-radius: 12px; background: var(--pl-elevated); border: 1px solid var(--pl-border); }
.pl-fact__label { display: block; font-size: 12px; color: var(--pl-muted); }
.pl-fact__value { font-size: 15px; font-weight: 700; }
.pl-rich { font-size: 15px; line-height: 2.1; color: #D6D6DC; }
.pl-rich p { margin-bottom: 12px; }
.pl-rich h2, .pl-rich h3, .pl-rich h4 { margin: 18px 0 8px; font-size: 17px; }
.pl-rich ul, .pl-rich ol { padding-inline-start: 22px; margin-bottom: 12px; }
.pl-rich a { color: var(--pl-accent-2); text-decoration: underline; }
.pl-rich img { max-width: 100%; height: auto; border-radius: 10px; }
.pl-rich table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.pl-rich td, .pl-rich th { border: 1px solid var(--pl-border-strong); padding: 6px 8px; }
.pl-versions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pl-version {
    padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 700; border: 1px solid var(--pl-border-strong); color: var(--pl-muted);
}
.pl-version.is-active { border-color: var(--pl-accent); color: var(--pl-text); background: var(--pl-accent-soft); }
.pl-version:hover { color: var(--pl-text); }
.pl-buy { position: relative; scroll-margin-top: 90px; }
.pl-buy__price { font-size: 26px; font-weight: 800; margin: 4px 0 14px; }
.pl-buy__note { font-size: 13px; color: var(--pl-muted); margin-top: 10px; }
.pl-buy .pl-btn + .pl-btn { margin-top: 8px; }
.pl-attempts { list-style: none; margin: 0; padding: 0; }
.pl-attempts li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--pl-border); font-size: 13px; }
.pl-attempts li:last-child { border-bottom: 0; }

/* ---------- take form ---------- */
.pl-take { max-width: 820px; margin-inline: auto; }
.pl-steps { display: flex; gap: 6px; margin-bottom: 16px; }
.pl-steps__item { flex: 1; text-align: center; font-size: 12px; font-weight: 700; color: var(--pl-faint); padding-top: 8px; border-top: 3px solid var(--pl-border); }
.pl-steps__item.is-active { color: var(--pl-accent-2); border-color: var(--pl-accent); }
.pl-steps__item.is-done { color: var(--pl-muted); border-color: rgba(110, 86, 207, .5); }
.pl-notice {
    display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; font-size: 14px; line-height: 2;
    background: rgba(255, 197, 61, .08); border: 1px solid rgba(255, 197, 61, .35); color: #FFDA85; margin-bottom: 16px;
}
.pl-step[hidden] { display: none !important; }
.pl-form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.pl-field { display: flex; flex-direction: column; gap: 6px; }
.pl-field--full { grid-column: 1 / -1; }
.pl-label { font-size: 14px; font-weight: 700; color: var(--pl-text); }
.pl-label .pl-req { color: var(--pl-red); margin-inline-start: 2px; }
.pl-input, .pl-select {
    width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 10px; font-size: 15px; font-family: inherit;
    color: var(--pl-text); background: var(--pl-elevated); border: 1px solid var(--pl-border-strong); outline: none;
}
.pl-select { appearance: auto; }
.pl-select option { background: #1C1C22; color: #F0F0F2; }
.pl-input:focus, .pl-select:focus { border-color: var(--pl-accent-2); box-shadow: 0 0 0 3px rgba(110, 86, 207, .25); }
.pl-field.has-error .pl-input, .pl-field.has-error .pl-select, .pl-field.has-error .pl-choices { border-color: var(--pl-red); }
.pl-error { font-size: 12px; color: #FF8589; }
.pl-choices { display: flex; flex-direction: column; gap: 8px; border: 1px solid transparent; border-radius: 12px; }
.pl-choice { position: relative; display: flex; }
.pl-choice input { position: absolute; opacity: 0; inset-inline-start: 12px; top: 50%; pointer-events: none; }
.pl-choice span {
    flex: 1; display: block; padding: 10px 14px; border-radius: 10px; font-size: 14px; line-height: 1.8; cursor: pointer;
    background: var(--pl-elevated); border: 1px solid var(--pl-border-strong); color: #D6D6DC; transition: background-color .12s, border-color .12s;
}
.pl-choice span:hover { border-color: rgba(155, 141, 232, .6); }
.pl-choice input:checked + span { background: var(--pl-accent-soft); border-color: var(--pl-accent); color: var(--pl-text); font-weight: 700; }
.pl-choice input:focus-visible + span { outline: 2px solid var(--pl-accent-2); outline-offset: 2px; }
.pl-choices--inline { flex-direction: row; flex-wrap: wrap; }
.pl-choices--inline .pl-choice { flex: 1 1 120px; }
.pl-choices--inline .pl-choice span { text-align: center; }

.pl-instructions { white-space: pre-line; font-size: 15px; line-height: 2.1; color: #D6D6DC; }
.pl-progress {
    position: sticky; top: 64px; z-index: 20; margin: 0 -4px 16px; padding: 10px 4px;
    background: rgba(10, 10, 15, .94); backdrop-filter: blur(6px);
}
.pl-progress__row { display: flex; justify-content: space-between; font-size: 13px; color: var(--pl-muted); margin-bottom: 6px; }
.pl-progress__bar { height: 8px; border-radius: 999px; background: var(--pl-elevated); overflow: hidden; }
.pl-progress__fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--pl-accent), var(--pl-accent-2)); transition: width .2s; }
.pl-items-section { margin: 22px 0 10px; font-size: 15px; font-weight: 800; color: var(--pl-accent-2); }
.pl-item { padding: 16px; border-radius: 14px; background: var(--pl-surface); border: 1px solid var(--pl-border); margin-bottom: 12px; scroll-margin-top: 90px; }
.pl-item.is-missing { border-color: var(--pl-yellow); box-shadow: 0 0 0 1px rgba(255, 197, 61, .35); }
.pl-item.is-answered { border-color: rgba(110, 86, 207, .35); }
.pl-item__head { display: flex; gap: 10px; margin-bottom: 12px; }
.pl-item__num {
    flex: 0 0 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800; background: var(--pl-elevated); color: var(--pl-accent-2);
}
.pl-item__text { font-size: 15px; font-weight: 600; line-height: 2; }
.pl-item__hint { font-size: 12px; color: var(--pl-muted); margin-top: 2px; }
.pl-item__tag { display: inline-block; font-size: 11px; color: var(--pl-yellow); border: 1px solid rgba(255, 197, 61, .35); border-radius: 999px; padding: 0 8px; margin-inline-start: 6px; }
.pl-nav { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin-top: 18px; }
.pl-missing-box {
    padding: 14px 16px; border-radius: 12px; margin-top: 14px; font-size: 14px;
    background: rgba(255, 197, 61, .08); border: 1px solid rgba(255, 197, 61, .35); color: #FFDA85;
}
.pl-missing-box[hidden] { display: none; }
.pl-missing-box a { color: var(--pl-yellow); text-decoration: underline; cursor: pointer; margin-inline-end: 6px; }
.pl-alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; font-size: 14px; background: rgba(229, 72, 77, .1); border: 1px solid rgba(229, 72, 77, .4); color: #FF9A9D; }
.pl-alert ul { margin: 0; padding-inline-start: 18px; }

/* ---------- result ---------- */
.pl-result { max-width: 920px; margin-inline: auto; }
.pl-result__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.pl-result__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pl-status { padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 14px; border: 1px solid; }
.pl-status--warn { background: rgba(255, 197, 61, .08); border-color: rgba(255, 197, 61, .35); color: #FFDA85; }
.pl-status--bad { background: rgba(229, 72, 77, .08); border-color: rgba(229, 72, 77, .4); color: #FF9A9D; }
.pl-summary { font-size: 16px; line-height: 2.1; }
.pl-typology { border-color: rgba(155, 141, 232, .5); background: linear-gradient(180deg, rgba(110, 86, 207, .18), var(--pl-surface)); }
.pl-scales { display: grid; grid-template-columns: 1fr; gap: 12px; }
.pl-scale { padding: 16px; border-radius: 14px; background: var(--pl-elevated); border: 1px solid var(--pl-border); border-inline-start: 4px solid var(--pl-scale-color, var(--pl-accent-2)); }
.pl-scale__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.pl-scale__title { font-size: 14px; font-weight: 700; line-height: 1.8; }
.pl-scale__score { font-size: 20px; font-weight: 800; white-space: nowrap; }
.pl-scale__score small { font-size: 12px; color: var(--pl-muted); font-weight: 500; }
.pl-scale__bar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .06); overflow: hidden; margin: 10px 0 8px; }
.pl-scale__fill { height: 100%; border-radius: 999px; background: var(--pl-scale-color, var(--pl-accent-2)); }
.pl-band { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; color: #0A0A0F; background: var(--pl-scale-color, var(--pl-accent-2)); }
.pl-scale__text { font-size: 13px; color: #C9C9D1; margin-top: 8px; line-height: 2; }
.pl-scale__norm { font-size: 12px; color: var(--pl-muted); margin-top: 4px; }

.pl-gauge { margin: 6px 0 4px; }
.pl-gauge__track { position: relative; height: 18px; border-radius: 6px; overflow: visible; display: block; margin: 30px 0 6px; }
.pl-gauge__seg { position: absolute; top: 0; height: 100%; opacity: .85; }
.pl-gauge__seg:first-child { border-start-start-radius: 6px; border-end-start-radius: 6px; }
.pl-gauge__seg:last-child { border-start-end-radius: 6px; border-end-end-radius: 6px; }
.pl-gauge__marker { position: absolute; top: -8px; width: 4px; height: 34px; margin-inline-start: -2px; background: #fff; border-radius: 2px; box-shadow: 0 0 0 2px #0A0A0F; }
.pl-gauge__marker b { position: absolute; bottom: 36px; inset-inline-start: 50%; transform: translateX(50%); font-size: 13px; background: #fff; color: #0A0A0F; padding: 0 7px; border-radius: 6px; white-space: nowrap; }
.pl-gauge__cutoff { position: absolute; top: -4px; height: 26px; border-inline-start: 2px dashed #fff; opacity: .7; }
.pl-gauge__legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--pl-muted); margin-top: 10px; }
.pl-gauge__legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: middle; }
.pl-gauge__scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--pl-faint); }

.pl-chart { position: relative; width: 100%; min-height: 260px; }
.pl-chart canvas { width: 100% !important; }
.pl-chart-fallback .pl-bar-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 8px; align-items: center; font-size: 12px; margin-bottom: 6px; }
.pl-chart-fallback .pl-bar-row div { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.pl-chart-fallback .pl-bar-row div i { display: block; height: 100%; }

.pl-flag { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 2; margin-bottom: 10px; border: 1px solid; }
.pl-flag--danger { background: rgba(229, 72, 77, .1); border-color: rgba(229, 72, 77, .45); color: #FFB0B2; }
.pl-flag--warning { background: rgba(255, 197, 61, .08); border-color: rgba(255, 197, 61, .35); color: #FFDA85; }
.pl-flag--info { background: rgba(0, 144, 255, .08); border-color: rgba(0, 144, 255, .35); color: #9CD3FF; }
.pl-list { margin: 0; padding-inline-start: 20px; font-size: 14px; line-height: 2.1; color: #D6D6DC; }
.pl-list li { margin-bottom: 6px; }
.pl-refs summary { cursor: pointer; font-weight: 800; font-size: 16px; }
.pl-refs ol { margin-top: 12px; font-size: 12px; color: var(--pl-muted); }
.pl-refs li { margin-bottom: 6px; }
.pl-answers { width: 100%; border-collapse: collapse; font-size: 13px; }
.pl-answers th, .pl-answers td { padding: 8px; border-bottom: 1px solid var(--pl-border); text-align: start; vertical-align: top; }
.pl-answers th { color: var(--pl-muted); font-weight: 600; }

/* ---------- panel ---------- */
.pl--panel { padding: 0; max-width: none; }
.pl-table-wrap { overflow-x: auto; }
.pl-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.pl-table th, .pl-table td { padding: 10px; border-bottom: 1px solid var(--pl-border); text-align: start; }
.pl-table th { color: var(--pl-muted); font-weight: 600; }

/* ---------- breakpoints ---------- */
@media (min-width: 640px) {
    .pl { padding: 36px 20px 88px; }
    .pl-hero { padding: 40px 36px; }
    .pl-hero h1 { font-size: 34px; }
    .pl-collections { grid-template-columns: repeat(2, 1fr); }
    .pl-grid { grid-template-columns: repeat(2, 1fr); }
    .pl-family--multi { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); }
    .pl-family__label { grid-column: 1 / -1; }
    .pl-form-grid { grid-template-columns: repeat(2, 1fr); }
    .pl-facts { grid-template-columns: repeat(4, 1fr); }
    .pl-scales { grid-template-columns: repeat(2, 1fr); }
    .pl-choices--scale { flex-direction: row; flex-wrap: wrap; }
    .pl-choices--scale .pl-choice { flex: 1 1 0; min-width: 110px; }
    .pl-choices--scale .pl-choice span { text-align: center; height: 100%; display: flex; align-items: center; justify-content: center; }
}
@media (min-width: 1024px) {
    .pl-collections { grid-template-columns: repeat(5, 1fr); }
    .pl-collection { flex-direction: column; align-items: flex-start; }
    .pl-grid { grid-template-columns: repeat(3, 1fr); }
    .pl-family--multi { grid-column: span 2; }
    .pl-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
    .pl-layout__side { position: sticky; top: 90px; }
    .pl-mobile-only { display: none !important; }
}
