/* css/auth.css — кнопка «По аналогам», бейдж пользователя, модалка */

:root { --a-blue:#0066cc; --a-dark:#1f2733; --a-err:#c02626; --a-ok:#177a37; }

/* ---------- кнопка в шапке ---------- */
.ps-analog-link {
    display:inline-block; padding:8px 16px; background:#7b3fa0; color:#fff;
    border:0; border-radius:6px; font:600 14px/1.4 inherit;
    cursor:pointer; white-space:nowrap; transition:background .15s;
}
.ps-analog-link:hover { background:#653385; }
.ps-analog-link.ps-locked { position:relative; padding-right:32px; background:#8a94a4; }
.ps-analog-link.ps-locked::after {
    content:"🔒"; position:absolute; right:10px; top:50%;
    transform:translateY(-50%); font-size:12px;
}
.ps-analog-link.ps-locked:hover { background:#78828f; }

/* ---------- бейдж пользователя ---------- */
.ps-userbox { display:flex; align-items:center; gap:11px; font-size:13px; color:#667; }
.ps-userbox .ps-ub-name { font-weight:600; color:#334; }
.ps-userbox a { color:var(--a-blue); text-decoration:none; }
.ps-userbox a:hover { text-decoration:underline; }

/* ---------- модалка ---------- */
.ps-modal { position:fixed; inset:0; z-index:9000; display:none;
            align-items:center; justify-content:center; padding:20px; }
.ps-modal.open { display:flex; }
.ps-modal-bg { position:absolute; inset:0; background:rgba(15,22,33,.58);
               animation:psFade .2s ease; }
.ps-modal-box {
    position:relative; background:#fff; border-radius:14px;
    box-shadow:0 18px 60px rgba(0,0,0,.3); padding:34px 32px 28px;
    width:100%; max-width:470px; max-height:92vh; overflow-y:auto;
    animation:psUp .26s cubic-bezier(.2,.8,.3,1);
}
@keyframes psFade { from{opacity:0} to{opacity:1} }
@keyframes psUp { from{opacity:0;transform:translateY(22px) scale(.97)} to{opacity:1;transform:none} }

.ps-modal-x { position:absolute; top:12px; right:14px; background:none; border:0;
              font-size:27px; line-height:1; color:#b3bcc6; cursor:pointer; padding:4px 8px; }
.ps-modal-x:hover { color:#66707c; }

.ps-modal-icon { font-size:40px; text-align:center; margin-bottom:8px; }
.ps-modal-box h3 { margin:0 0 10px; font-size:21px; text-align:center; color:#16202c; }
.ps-modal-lead { margin:0 0 20px; font-size:14px; line-height:1.55; color:#5b6672; text-align:center; }

.ps-modal-box label { display:block; margin:13px 0 5px; font-size:12.5px; font-weight:600; color:#556; }
.ps-modal-box label .req { color:var(--a-err); }
.ps-modal-box input[type=text],
.ps-modal-box input[type=email],
.ps-modal-box input[type=password],
.ps-modal-box textarea {
    width:100%; box-sizing:border-box; padding:10px 13px;
    border:1px solid #d5dae0; border-radius:7px; font-size:14.5px; font-family:inherit;
    transition:border-color .15s, box-shadow .15s;
}
.ps-modal-box input:focus, .ps-modal-box textarea:focus {
    outline:none; border-color:var(--a-blue); box-shadow:0 0 0 3px rgba(0,102,204,.13);
}
.ps-modal-box textarea { resize:vertical; min-height:54px; }

.ps-row { display:flex; gap:11px; }
.ps-row > div { flex:1; }

.ps-check { display:flex !important; align-items:center; gap:7px;
            margin-top:14px !important; font-weight:400 !important; cursor:pointer; }
.ps-check input { width:auto !important; }

.ps-modal-btn {
    display:block; width:100%; margin-top:20px; padding:12.5px;
    background:var(--a-blue); color:#fff; border:0; border-radius:8px;
    font-size:15px; font-weight:600; cursor:pointer; transition:background .15s;
}
.ps-modal-btn:hover:not(:disabled) { background:#0055aa; }
.ps-modal-btn:disabled { opacity:.55; cursor:default; }

.ps-modal-msg { margin-top:12px; font-size:13.5px; text-align:center; color:#667; }
.ps-modal-msg.err { color:var(--a-err); }
.ps-modal-msg.ok  { color:var(--a-ok); }

.ps-modal-alt { margin:18px 0 0; text-align:center; font-size:13.5px; color:#778; }
.ps-modal-alt a { color:var(--a-blue); text-decoration:none; font-weight:600; }

.ps-modal-done { text-align:center; padding:22px 0 8px; font-size:42px; }
.ps-modal-done p { font-size:14.5px; color:#445; margin:14px 0 0; line-height:1.55; }
.ps-modal-done .ps-modal-hint { font-size:12.5px; color:#8a94a0; margin-top:9px; }

/* ---------- honeypot ---------- */
.ps-hp { position:absolute !important; left:-9999px !important; top:-9999px !important;
         width:1px; height:1px; opacity:0; overflow:hidden; pointer-events:none; }

/* ---------- toast ---------- */
.ps-toast {
    position:fixed; left:50%; bottom:26px; transform:translate(-50%,20px);
    background:var(--a-dark); color:#fff; padding:13px 24px; border-radius:9px;
    font-size:14px; z-index:9500; opacity:0;
    transition:opacity .3s, transform .3s; box-shadow:0 8px 26px rgba(0,0,0,.28);
}
.ps-toast.show { opacity:1; transform:translate(-50%,0); }

@media (max-width:520px) {
    .ps-modal-box { padding:28px 20px 22px; }
    .ps-row { flex-direction:column; gap:0; }
    .ps-analog-link { width:100%; text-align:center; }
}
/* ============================================================
   ПОДБОР ПО АНАЛОГАМ
   ============================================================ */
.an-modal { position:fixed; inset:0; z-index:9200; display:none; }
.an-modal.open { display:block; }
.an-bg { position:absolute; inset:0; background:rgba(15,22,33,.62); }
.an-box {
    position:absolute; inset:24px; max-width:1180px; margin:0 auto;
    background:#f7f9fc; border-radius:14px; display:flex; flex-direction:column;
    box-shadow:0 20px 70px rgba(0,0,0,.35); overflow:hidden;
    animation:psUp .26s cubic-bezier(.2,.8,.3,1);
}
.an-head {
    background:#1f2733; color:#fff; padding:15px 22px;
    display:flex; align-items:center; gap:14px; flex-wrap:wrap; flex:0 0 auto;
}
.an-head b { font-size:16px; }
.an-sub { font-size:13px; opacity:.72; }
.an-x { margin-left:auto; background:none; border:0; color:#9fb0c4;
        font-size:28px; line-height:1; cursor:pointer; padding:0 6px; }
.an-x:hover { color:#fff; }

.an-body { flex:1 1 auto; overflow-y:auto; padding:20px 22px 26px; }

.an-search { position:relative; max-width:620px; }
.an-search input {
    width:100%; box-sizing:border-box; padding:13px 16px;
    border:2px solid #ccd5e0; border-radius:9px; font-size:15.5px;
    transition:border-color .15s, box-shadow .15s;
}
.an-search input:focus {
    outline:none; border-color:#0066cc; box-shadow:0 0 0 4px rgba(0,102,204,.11);
}
.an-sug {
    position:absolute; left:0; right:0; top:calc(100% + 5px); z-index:20;
    background:#fff; border:1px solid #d5dde7; border-radius:9px;
    box-shadow:0 10px 30px rgba(0,0,0,.14); max-height:320px; overflow-y:auto; display:none;
}
.an-sug.on { display:block; }
.an-sug-i { padding:11px 15px; cursor:pointer; border-bottom:1px solid #f0f3f7; font-size:14px; }
.an-sug-i:last-child { border-bottom:0; }
.an-sug-i:hover { background:#eef5ff; }
.an-sug-m { display:block; font-size:11.5px; color:#8a94a0; margin-top:2px; }
.an-sug-none { padding:14px 15px; font-size:13.5px; color:#8a94a0; }

.an-status { margin:16px 0 4px; font-size:13.5px; color:#4a5665; }
.an-err { color:#c02626; }

.an-result { margin-top:14px; }
.an-chart-wrap {
    background:#fff; border:1px solid #e2e8f0; border-radius:10px;
    padding:14px; height:340px; margin-bottom:16px;
}
@media (max-width:700px) { .an-chart-wrap { height:260px; } }

.an-tbl-wrap { background:#fff; border:1px solid #e2e8f0; border-radius:10px; overflow:auto; }
.an-tbl { width:100%; border-collapse:collapse; font-size:13px; }
.an-tbl th {
    background:#f2f6fb; padding:10px 12px; text-align:left;
    font-weight:600; color:#4a5665; white-space:nowrap; border-bottom:1px solid #e2e8f0;
}
.an-tbl td { padding:11px 12px; border-bottom:1px solid #f0f3f7; vertical-align:top; }
.an-tbl tbody tr { cursor:pointer; transition:background .12s; }
.an-tbl tbody tr:hover { background:#f6faff; }
.an-tbl tbody tr.on { background:#e9f2ff; }
.an-tbl tbody tr:last-child td { border-bottom:0; }

.an-score {
    display:inline-block; min-width:50px; text-align:center;
    padding:4px 9px; border-radius:13px; font-weight:700; font-size:13px; color:#fff;
}
.an-score.an-ok  { background:#2e9e44; }
.an-score.an-mid { background:#d68910; }
.an-score.an-low { background:#8a94a4; }

.an-model b { color:#16202c; }
.an-note { display:block; font-size:11.5px; color:#8a94a0; margin-top:3px; }
.an-art { font-family:monospace; font-size:12px; color:#556; white-space:nowrap; }
.an-price { white-space:nowrap; }
.an-link { color:#0066cc; text-decoration:none; font-size:12px; }
.an-link:hover { text-decoration:underline; }

.an-legend { margin-top:12px; font-size:12px; color:#8a94a0; line-height:1.55; }
.an-empty { padding:36px 20px; text-align:center; font-size:16px; color:#4a5665; }
.an-empty span { display:block; margin-top:10px; font-size:13.5px; color:#8a94a0; }

@media (max-width:640px) {
    .an-box { inset:0; border-radius:0; }
    .an-sub { display:none; }
    .an-tbl th:nth-child(5), .an-tbl td:nth-child(5) { display:none; }
}