/* =====================================================================
   PERCTOOLS page layer — auth (login / register), apply, status
   Scoped classes so the global .mr-card rules elsewhere stay untouched.
   ===================================================================== */
:root {
    --pg-accent: #9900CC;
    --pg-glass: rgba(11, 11, 14, 0.66);
    --pg-line: rgba(255, 255, 255, 0.07);
    --pg-text: #f2f2f4;
    --pg-dim: #A6A4AE;
    --pg-faint: #5c5c66;
}

@keyframes pgRise {
    from { opacity: 1; transform: translateY(14px) scale(0.99); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Shared glass surface ---------- */
.pg-glass {
    position: relative;
    background: var(--pg-glass);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    backdrop-filter: blur(22px) saturate(140%);
    border: 1px solid var(--pg-line);
    border-radius: 18px;
    box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.pg-glass::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 18%;
    right: 18%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(153,0,204, 0.75), transparent);
    pointer-events: none;
}

/* ---------- Form controls inside page layer ---------- */
.pg-scope .perctools-input,
.pg-scope input.perctools-input,
.pg-scope textarea.perctools-input,
.pg-scope select.perctools-input {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px !important;
    color: var(--pg-text) !important;
    font-size: 13px !important;
    min-height: 46px;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    box-shadow: none !important;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease !important;
}
.pg-scope textarea.perctools-input { min-height: 96px; }
.pg-scope .perctools-input::placeholder { color: #55555e !important; }
.pg-scope .perctools-input:hover { border-color: rgba(255, 255, 255, 0.14) !important; }
.pg-scope .perctools-input:focus {
    outline: none !important;
    border-color: rgba(153,0,204, 0.7) !important;
    background: rgba(153,0,204, 0.04) !important;
    box-shadow: 0 0 0 4px rgba(153,0,204, 0.12) !important;
}
.pg-scope label.block {
    color: var(--pg-dim) !important;
    letter-spacing: 0.08em !important;
}
.pg-scope input[type="checkbox"] {
    accent-color: var(--pg-accent);
    width: 15px !important;
    height: 15px !important;
}
.pg-scope .ad-btn-primary {
    position: relative;
    overflow: hidden;
    border-radius: 10px !important;
    min-height: 48px;
    font-weight: 800 !important;
    letter-spacing: 0.08em !important;
    box-shadow: 0 12px 30px -12px rgba(153,0,204, 0.85) !important;
    transition: transform .2s ease, box-shadow .25s ease, filter .2s ease !important;
}
.pg-scope .ad-btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: skewX(-20deg);
    transition: left .75s cubic-bezier(.22, 1, .36, 1);
}
.pg-scope .ad-btn-primary:hover::after { left: 120%; }
.pg-scope .ad-btn-primary:hover { box-shadow: 0 16px 36px -12px rgba(153,0,204, 1) !important; }
.pg-scope .ad-btn-primary:active { transform: translateY(1px) scale(0.995); }
.pg-scope .ad-btn-secondary {
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    color: #e6e6ea !important;
    transition: border-color .2s ease, background .2s ease !important;
}
.pg-scope .ad-btn-secondary:hover {
    border-color: rgba(153,0,204, 0.55) !important;
    background: rgba(153,0,204, 0.08) !important;
}

/* ---------- Auth (login / register) ---------- */
.pg-auth {
    flex-grow: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 16px 72px;
}
.pg-auth-card {
    width: 100%;
    max-width: 430px;
    padding: 36px 32px 28px;
    animation: pgRise .8s cubic-bezier(.22, 1, .36, 1) both;
}
.pg-auth-card.is-wide { max-width: 480px; }
.pg-auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 26px;
}
.pg-auth-logo {
    width: 68px;
    height: auto;
    margin-bottom: 18px;
    filter: drop-shadow(0 8px 24px rgba(153,0,204, 0.4));
    animation: pgFloat 6s ease-in-out infinite;
}
@keyframes pgFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
.pg-auth-title {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--pg-text);
}
.pg-auth-foot {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--pg-line);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--pg-faint);
}
.pg-auth-foot a { font-weight: 700; color: #fff; transition: color .2s ease; }
.pg-auth-foot a:hover { color: var(--pg-accent); }
.pg-auth-foot .pg-dot { width: 3px; height: 3px; border-radius: 50%; background: #3a3a42; }
@media (max-width: 480px) {
    .pg-auth-card { padding: 30px 20px 22px; border-radius: 16px; }
}

/* Modal card (forgot password) */
.pg-scope-modal .mr-card {
    background: rgba(11, 11, 14, 0.9) !important;
    border: 1px solid var(--pg-line) !important;
    border-radius: 16px !important;
}
.pg-scope-modal .mr-card-header { background: transparent !important; height: 52px; border-color: var(--pg-line) !important; }

/* ---------- Apply ---------- */
.pg-apply {
    flex-grow: 1;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 56px 16px 90px;
    animation: pgRise .8s cubic-bezier(.22, 1, .36, 1) both;
}
.pg-apply-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.pg-apply-head h1 {
    margin: 0;
    font-size: clamp(24px, 3.2vw, 30px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--pg-text);
}
.pg-apply .mr-card {
    background: var(--pg-glass) !important;
    -webkit-backdrop-filter: blur(22px) saturate(140%) !important;
    backdrop-filter: blur(22px) saturate(140%) !important;
    border: 1px solid var(--pg-line) !important;
    border-radius: 16px !important;
    box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.9) !important;
}
.pg-apply .mr-card-header {
    background: transparent !important;
    height: 54px;
    padding: 0 22px;
    border-color: var(--pg-line) !important;
}
.pg-apply .step-node { border-radius: 8px !important; }

/* Status lookup bar — never overflows */
.pg-lookup {
    padding: 14px;
    margin-bottom: 18px;
    border-radius: 16px;
}
.pg-lookup form {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}
.pg-lookup-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--pg-dim);
    padding: 0 6px;
    white-space: nowrap;
}
.pg-lookup .perctools-input { width: 100%; min-width: 0; }
.pg-lookup button { height: 46px; padding: 0 18px; white-space: nowrap; }
.pg-lookup-msg { margin: 10px 6px 0; font-size: 12px; font-weight: 600; color: var(--pg-accent); }
@media (max-width: 720px) {
    .pg-lookup form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .pg-lookup-label { grid-column: 1 / -1; padding: 2px 4px 0; }
    .pg-lookup button { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
    .pg-lookup form { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Status ---------- */
.pg-status {
    flex-grow: 1;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 56px 16px 100px;
}
.pg-status-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 26px;
    animation: pgRise .7s cubic-bezier(.22, 1, .36, 1) both;
}
.pg-status-head h1 {
    margin: 0;
    font-size: clamp(26px, 3.4vw, 34px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--pg-text);
}
.pg-status-summary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px 9px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: #e8e8ec;
}
.pg-status-summary::before { display: none; }
.pg-status-summary b { color: #2fd27c; font-weight: 800; }
.pg-status-list { display: flex; flex-direction: column; gap: 12px; }
.pg-status-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 16px;
    text-decoration: none;
    animation: pgRise .7s cubic-bezier(.22, 1, .36, 1) both;
    transition: border-color .25s ease, transform .25s ease, background .25s ease;
}
.pg-status-row:hover {
    border-color: rgba(153,0,204, 0.4);
    transform: translateY(-2px);
}
.pg-status-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 120%, rgba(153,0,204, 0.28), transparent 70%), rgba(255, 255, 255, 0.03);
    border: 1px solid var(--pg-line);
    overflow: hidden;
}
.pg-status-icon img.is-photo { width: 100%; height: 100%; object-fit: cover; }
.pg-status-icon img.is-mark { width: 30px; height: auto; }
.pg-status-meta { min-width: 0; flex: 1; }
.pg-status-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--pg-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .2s ease;
}
.pg-status-row:hover .pg-status-name { color: var(--pg-accent); }
.pg-status-sub { margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--pg-faint); }
.pg-status-plans { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pg-status-plan {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--pg-dim);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--pg-line);
    white-space: nowrap;
}
.pg-pill {
    --st: #2fd27c;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px 7px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
    color: var(--st);
    background: color-mix(in srgb, var(--st) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--st) 28%, transparent);
}
.pg-pill i {
    position: relative;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--st);
}
.pg-pill i::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--st);
    animation: pgPing 1.8s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes pgPing { 75%, 100% { transform: scale(2.6); opacity: 0; } }
.pg-pill.st-warn { --st: #9900CC; }
.pg-pill.st-down { --st: #ff4d5e; }
.pg-pill.st-info { --st: #38bdf8; }
.pg-pill.st-idle { --st: #8793AD; }
.pg-status-empty { padding: 48px 20px; text-align: center; color: var(--pg-dim); font-size: 14px; border-radius: 16px; }
@media (max-width: 640px) {
    .pg-status-plans { display: none; }
    .pg-status-row { padding: 14px; gap: 12px; }
    .pg-status-icon { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .pg-auth-card, .pg-apply, .pg-status-head, .pg-status-row, .pg-auth-logo, .pg-rev-card { animation: none !important; }
    .pg-pill i::after { animation: none; }
}

/* ---------- Role & Verified Pills (strictly 20px height, 0px baseline drift) ---------- */
.pg-badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    line-height: 1;
}
.pg-role-pill,
.pg-verified-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px;
    height: 20px !important;
    padding: 0 8px !important;
    border-radius: 999px !important;
    font: 800 9.5px/1 'Sora', sans-serif !important;
    letter-spacing: 0.07em !important;
    text-transform: uppercase !important;
    white-space: nowrap;
    vertical-align: middle;
    box-sizing: border-box;
}
.pg-role-pill i,
.pg-verified-pill i {
    font-size: 12px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.pg-role-pill.is-owner {
    color: #C266FF;
    background: rgba(153,0,204, 0.12);
    border: 1px solid rgba(153,0,204, 0.30);
}
.pg-role-pill.is-dev {
    color: #9900CC;
    background: rgba(153,0,204, 0.12);
    border: 1px solid rgba(153,0,204, 0.28);
}
.pg-role-pill.is-mod {
    color: #b48ef7;
    background: rgba(194,102,255, 0.12);
    border: 1px solid rgba(194,102,255, 0.28);
}
.pg-role-pill.is-support {
    color: #56b6f7;
    background: rgba(86, 182, 247, 0.12);
    border: 1px solid rgba(86, 182, 247, 0.28);
}
.pg-role-pill.is-client {
    color: #e8e8ec;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.pg-role-pill.is-member {
    color: #A6A4AE;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.pg-verified-pill {
    color: #2fd27c;
    background: rgba(47, 210, 124, 0.10);
    border: 1px solid rgba(47, 210, 124, 0.26);
}
.pg-verified-pill.is-staff {
    color: #C266FF;
    background: rgba(153,0,204, 0.10);
    border: 1px solid rgba(153,0,204, 0.26);
}

/* ---------- Reviews Page ---------- */
.pg-reviews {
    flex-grow: 1;
    width: 100%;
    max-width: 1060px;
    margin: 0 auto;
    padding: 56px 16px 104px;
}
.pg-rev-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    animation: pgRise .7s cubic-bezier(.22, 1, .36, 1) both;
}
.pg-rev-head h1 {
    margin: 0;
    font-size: clamp(26px, 3.4vw, 34px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--pg-text);
}
.pg-rev-layout {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
@media (max-width: 900px) {
    .pg-rev-layout { grid-template-columns: minmax(0, 1fr); }
}
.pg-rev-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 80px;
}
@media (max-width: 900px) {
    .pg-rev-side { position: static; }
}
.pg-rev-box {
    padding: 22px;
    border-radius: 16px;
}
.pg-rev-score-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--pg-line);
}
.pg-rev-score-big {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.pg-rev-score-big span {
    font-size: 15px;
    font-weight: 700;
    color: var(--pg-faint);
    margin-left: 2px;
}
.pg-rev-bars { display: flex; flex-direction: column; gap: 11px; }
.pg-rev-bar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--pg-dim);
    margin-bottom: 5px;
}
.pg-rev-bar-top b {
    font-family: 'JetBrains Mono', monospace;
    color: #fff;
    font-size: 11px;
}
.pg-rev-bar-track {
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}
.pg-rev-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #9900CC, #C266FF);
}
.pg-rev-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-radius: 14px;
    margin-bottom: 14px;
}
.pg-rev-select {
    height: 38px;
    padding: 0 30px 0 12px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: var(--pg-text);
    font: 600 12px/1 'Sora', sans-serif;
    cursor: pointer;
    outline: none;
    transition: border-color .2s ease;
}
.pg-rev-select:hover, .pg-rev-select:focus {
    border-color: rgba(153,0,204, 0.55);
}
.pg-rev-select option {
    background: #161619;
    color: #f2f2f4;
}
.pg-rev-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.pg-rev-card {
    padding: 20px 22px;
    border-radius: 16px;
    animation: pgRise .65s cubic-bezier(.22, 1, .36, 1) both;
    transition: border-color .25s ease, transform .25s ease;
}
.pg-rev-card:hover {
    border-color: rgba(153,0,204, 0.32);
    transform: translateY(-1px);
}
.pg-rev-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.pg-rev-author {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.pg-rev-avatar {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}
.pg-rev-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pg-rev-ident {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}
.pg-rev-user {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .2s ease;
}
.pg-rev-user:hover { color: var(--pg-accent); }
.pg-rev-rating {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.pg-rev-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--pg-accent);
    font-size: 14px;
    line-height: 1;
}
.pg-rev-score-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 7px;
    background: rgba(153,0,204, 0.12);
    border: 1px solid rgba(153,0,204, 0.28);
    font: 800 11px/1 'JetBrains Mono', monospace;
    color: #C266FF;
}
.pg-rev-body {
    font-size: 13.5px;
    line-height: 1.65;
    color: #d8d8e0;
    margin: 0 0 14px;
    word-break: break-word;
}
.pg-rev-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--pg-line);
    font-size: 11px;
    font-weight: 600;
    color: var(--pg-faint);
}
.pg-rev-prod {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--pg-dim);
    font-weight: 700;
}
.pg-rev-prod i { color: var(--pg-accent); font-size: 13px; }

