/* =========================================================
   «Лаборатория» - окно бесплатного разбора + плавающие кнопки
   ========================================================= */
.lab { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 16px; }
.lab[hidden] { display: none; }
.lab-bg { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(14px) saturate(120%); -webkit-backdrop-filter: blur(14px) saturate(120%); opacity: 0; transition: opacity .5s var(--ease); }
.lab-panel {
  position: relative; width: min(640px, 100%); max-height: calc(100svh - 32px); overflow: auto; overscroll-behavior: contain;
  border-radius: 30px; padding: 22px 30px 30px;
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 color-mix(in srgb, var(--fg) 14%, transparent), 0 60px 140px -40px rgba(0,0,0,.7);
  opacity: 0; transform: translateY(40px) scale(.96); transition: opacity .5s var(--ease), transform .8s var(--ease);
}
.lab.is-open .lab-bg { opacity: 1; }
.lab.is-open .lab-panel { opacity: 1; transform: none; }
html.lab-open, html.lab-open body { overflow: hidden; }
html.lab-open .fab { opacity: 0; pointer-events: none; }

.lab-head { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 10px; }
.lab-head > span:first-child { flex: 1; display: flex; align-items: center; gap: 8px; }
.lab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.lab-close { width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; transition: background .3s, transform .4s var(--ease); }
.lab-close:hover { background: var(--fg); color: var(--bg); transform: rotate(90deg); }
.lab-progress { height: 2px; margin: 14px -30px 26px; background: var(--line); }
.lab-progress i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(.25); transition: transform .8s var(--ease); box-shadow: 0 0 12px var(--accent); }

.lab-step { display: none; }
.lab-step.is-active { display: grid; gap: 18px; animation: stepIn .7s var(--ease) both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(18px); } }
.lab-step h3 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-track); font-size: clamp(30px, 4.4vw, 46px); line-height: 1; }
.lab-step h3 em { display: block; color: var(--accent-ink); }
.lab-text { color: var(--muted); font-size: 16px; }
.lab-note { color: var(--accent-ink); font-size: 10px; margin-top: -6px; }

.lab-acc, .cta-scan { display: flex; gap: 8px; flex-wrap: wrap; }
.lab-input { flex: 1 1 260px; display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 20px; border-radius: 100px; background: color-mix(in srgb, var(--fg) 6%, transparent); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .3s; }
.lab-input:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent); }
.lab-input span { color: var(--accent-ink); font-weight: 700; font-size: 18px; }
.lab-input input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: var(--fg); font: inherit; font-size: 16px; }
.lab-input input::placeholder { color: var(--muted); }
.lab-acc .btn, .cta-scan .btn { height: 56px; }
.lab-skip { justify-self: start; color: var(--muted); font-size: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 2px; transition: color .3s; }
.lab-skip:hover { color: var(--fg); }
.form-err { min-height: 1em; color: #ff6b6b; font-size: 13px; margin: -6px 0 -6px; }
.form-err:empty { display: none; }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* --- сборка чек-листа --- */
.scan-top { display: flex; justify-content: space-between; align-items: flex-end; }
.scan-top span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.scan-top b { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 26px; letter-spacing: -.02em; }
.scan-pct b { font-family: var(--font-display); font-size: 46px; font-weight: var(--display-weight); color: var(--accent-ink); letter-spacing: -.04em; }
.scan-radar { position: relative; height: 150px; display: grid; place-items: center; }
.scan-radar i { position: absolute; border-radius: 50%; border: 1px solid var(--line); }
.scan-radar i:nth-child(1) { width: 140px; height: 140px; }
.scan-radar i:nth-child(2) { width: 96px; height: 96px; border-style: dashed; animation: spin 6s linear infinite; }
.scan-radar i:nth-child(3) { width: 52px; height: 52px; border-color: var(--accent); }
.scan-radar .sweep { position: absolute; width: 140px; height: 140px; border-radius: 50%; background: conic-gradient(from 0deg, color-mix(in srgb, var(--accent) 55%, transparent), transparent 25%); animation: spin 1.6s linear infinite; -webkit-mask: radial-gradient(circle, transparent 0 25px, #000 26px); mask: radial-gradient(circle, transparent 0 25px, #000 26px); }
.scan-radar .core { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 24px var(--accent); }
.scan-caption { text-align: center; color: var(--muted); font-size: 10px; margin-top: -8px; }
.scan-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.scan-list li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: baseline; font-size: 13px; padding: 7px 0; border-bottom: 1px solid var(--line); opacity: 0; }
.scan-list li span { color: var(--muted); font-size: 9px; }
.scan-list li b { font-weight: 500; font-size: 9px; color: var(--accent-ink); opacity: 0; transform: translateX(-6px); transition: .4s var(--ease); }
.scan-list li.ok b { opacity: 1; transform: none; }

/* --- контакты --- */
#labForm { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span { color: var(--muted); font-size: 10px; }
.field input:not([type=radio]) { height: 54px; padding: 0 18px; border-radius: 16px; border: 0; outline: 0; font: inherit; font-size: 16px; color: var(--fg); background: color-mix(in srgb, var(--fg) 6%, transparent); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .3s; }
.field input:focus { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent); }
.field.invalid input, .consent.invalid { box-shadow: inset 0 0 0 1.5px #ff6b6b; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 18px; box-shadow: inset 0 0 0 1px var(--line); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 13px; font-weight: 600; cursor: pointer; transition: background .3s, color .3s; }
.seg svg { width: 18px; height: 18px; }
.seg input:checked + span { background: var(--fg); color: var(--bg); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: var(--muted); border-radius: 10px; padding: 4px; }
.consent input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent); flex: none; }
.consent a { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }
.btn-wide { width: 100%; height: 58px; font-size: 16px; }
.btn svg { width: 18px; height: 18px; }
.btn.is-loading { pointer-events: none; opacity: .75; }

/* --- готово --- */
.done-mark { width: 110px; height: 110px; justify-self: center; }
.done-mark svg { width: 100%; height: 100%; overflow: visible; }
.done-mark circle, .done-mark path { fill: none; stroke: var(--accent); stroke-width: 2; }
.done-mark .dash { stroke-dasharray: 3 7; opacity: .6; transform-origin: center; animation: spin 10s linear infinite; }
.done-mark path { stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; }
.lab-step[data-step="4"].is-active .done-mark path { animation: draw .9s var(--ease) .3s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done-mark.is-error circle, .done-mark.is-error path { stroke: #ffb020; }
.done-mark.is-error path { d: path("M60 38 L60 66 M60 80 L60 82"); }
.lab-step[data-step="4"] { text-align: center; }
.lab-step[data-step="4"] .lab-text { margin-top: -6px; }
.done-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.done-tips { text-align: left; margin-top: 8px; padding: 18px 20px; border-radius: 20px; background: color-mix(in srgb, var(--fg) 4%, transparent); box-shadow: inset 0 0 0 1px var(--line); }
.done-tips p { color: var(--muted); font-size: 10px; margin-bottom: 10px; }
.done-tips ol { padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
.done-tips li::marker { color: var(--accent-ink); font-family: var(--mono); font-size: 11px; }

/* --- поле аккаунта в финальной секции --- */
.cta-scan { width: min(620px, 100%); }
.cta-alt { color: var(--muted); font-size: 10px; }
.cta-alt a { color: var(--fg); border-bottom: 1px dashed var(--line); }

/* --- плавающие кнопки WhatsApp / Telegram --- */
.fab { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: grid; gap: 10px; transition: opacity .4s; }
.is-loading .fab { opacity: 0; pointer-events: none; }
.fab a { position: relative; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: var(--fg);
  background: color-mix(in srgb, var(--bg-2) 75%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 0 0 1px var(--line), 0 18px 40px -16px rgba(0,0,0,.6); transition: transform .5s var(--ease), background .3s, color .3s; }
.fab a:hover { transform: translateY(-3px) scale(1.06); background: var(--accent); color: var(--on-accent); }
.fab a svg { width: 24px; height: 24px; }
.fab a:first-child::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--accent); animation: ping 2.4s ease-out infinite; }
@keyframes ping { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
.fab a::before { content: attr(data-tip); position: absolute; right: 64px; padding: 6px 10px; border-radius: 8px; background: var(--fg); color: var(--bg); font-size: 12px; font-weight: 600; white-space: nowrap; opacity: 0; transform: translateX(8px); transition: .3s var(--ease); pointer-events: none; }
.fab a:hover::before { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .lab { padding: 0; align-items: end; }
  .lab-panel { border-radius: 26px 26px 0 0; max-height: 94svh; padding: 18px 20px 26px; }
  .lab-progress { margin: 12px -20px 20px; }
  .scan-list { grid-template-columns: 1fr; }
  .scan-list li:nth-child(n+7) { display: none; }
  .fab { right: 12px; bottom: 12px; }
  .fab a { width: 50px; height: 50px; }
}

/* ---------- Cookie-баннер ---------- */
.cookie { position: fixed; left: 18px; bottom: 18px; z-index: 230; width: min(520px, calc(100vw - 36px)); display: grid; gap: 16px; padding: 20px 22px; border-radius: 24px;
  background: var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 color-mix(in srgb, var(--fg) 14%, transparent), 0 40px 90px -30px rgba(0,0,0,.75);
  transform: translateY(30px); opacity: 0; transition: transform .7s var(--ease), opacity .4s; }
.cookie.is-on { transform: none; opacity: 1; }
.cookie-label { color: var(--accent-ink); font-size: 10px; margin-bottom: 6px; }
.cookie-main > p:not(.mono) { font-size: 14px; color: var(--muted); }
.cookie-main a { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }
.cookie-opts { display: grid; gap: 8px; margin-top: 12px; }
.cookie-opts[hidden] { display: none; }
.cookie-opts label { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.cookie-opts input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; margin-top: 1px; }
.cookie-opts b { color: var(--fg); }
.cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cookie-more { color: var(--muted); font-size: 10px; border-bottom: 1px dashed var(--line); margin-left: 6px; }
.cookie-more:hover { color: var(--fg); }
html.lab-open .cookie { opacity: 0; pointer-events: none; }
.footer a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
@media (max-width: 640px) { .cookie { left: 8px; right: 8px; bottom: 8px; width: auto; } .cookie-actions .btn { flex: 1; } }
