/* Widgets: cookie banner, exit popup, chat assistant. Uses the page tokens from :root. */

/* Cookie consent */
.lab-consent { position: fixed; left: 16px; bottom: 16px; z-index: 90; max-width: 440px; display: grid; gap: 14px; padding: 18px 20px; border-radius: var(--radius-sm); background: var(--bg-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); color: var(--muted); font-size: 14px; line-height: 1.5; }
.lab-consent div { display: flex; flex-wrap: wrap; gap: 10px; }
.lab-consent button { min-height: 40px; padding: 8px 16px; border-radius: var(--pill); font: 800 14px var(--font); cursor: pointer; border: 1px solid var(--line-2); background: transparent; color: var(--text); transition: background-color .2s ease, border-color .2s ease; }
.lab-consent button:hover { border-color: var(--violet-2); }
.lab-consent .lab-btn-all { background: var(--grad-gold); color: var(--on-gold); border-color: transparent; }
@media (max-width: 560px) { .lab-consent { left: 12px; right: 12px; bottom: 88px; max-width: none; } }

/* Exit popup */
.lab-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(4, 3, 14, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s ease; }
.lab-modal.on { opacity: 1; }
.lab-modal-box { position: relative; width: min(820px, 100%); max-height: calc(100vh - 32px); overflow: auto; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); border-radius: var(--radius); background: var(--bg-3); border: 1px solid var(--line-2); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), 0 0 80px -30px rgba(139, 92, 246, .7); transform: translateY(14px) scale(.98); transition: transform .3s ease; }
.lab-modal.on .lab-modal-box { transform: none; }
.lab-modal-pic img { width: 100%; height: 100%; object-fit: cover; object-position: 35% 40%; min-height: 260px; }
.lab-modal-body { padding: 34px 32px 26px; display: flex; flex-direction: column; gap: 14px; }
.lab-modal-body h2 { font-family: var(--font-display); font-size: 26px; line-height: 1.2; font-weight: 600; }
.lab-modal-text { color: var(--muted); font-size: 16px; line-height: 1.5; }
.lab-exit-form { display: grid; gap: 12px; margin-top: 4px; }
.lab-exit-form input[type=text] { width: 100%; min-height: 52px; font: 600 17px var(--font); color: var(--text); background: rgba(0, 0, 0, .35); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 16px; }
.lab-exit-form input[type=text]:focus-visible { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(34, 211, 238, .18); }
.lab-exit-form input[aria-invalid=true] { border-color: var(--red); }
.lab-exit-form .btn { width: 100%; }
.lab-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lab-seg label { cursor: pointer; }
.lab-seg input { position: absolute; opacity: 0; pointer-events: none; }
.lab-seg span { display: grid; place-items: center; min-height: 44px; border-radius: 12px; border: 1px solid var(--line-2); font-weight: 800; font-size: 15px; color: var(--muted); transition: border-color .2s ease, background-color .2s ease, color .2s ease; }
.lab-seg input:checked + span { border-color: var(--cyan); background: var(--cyan-bg); color: var(--text); }
.lab-seg input:focus-visible + span { outline: 3px solid var(--cyan); outline-offset: 2px; }
.lab-err { color: var(--red); font-size: 14px; font-weight: 700; }
.lab-modal-note { font-size: 13px; color: var(--dim); }
.lab-no { align-self: center; background: none; border: 0; color: var(--dim); font: 700 14px var(--font); text-decoration: underline; cursor: pointer; padding: 6px; border-radius: 6px; }
.lab-no:hover { color: var(--text); }
.lab-modal-body .btn-ghost.lab-no { text-decoration: none; color: var(--text); }
.lab-x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(7, 6, 20, .7); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; }
.lab-x:hover { background: var(--panel-2); }
@media (max-width: 720px) {
  .lab-modal-box { grid-template-columns: minmax(0, 1fr); }
  .lab-modal-pic { background: linear-gradient(90deg, #19162F 0%, #221A3E 50%, #2A1C4A 100%); }
  .lab-modal-pic img { height: min(250px, 62vw); min-height: 0; object-fit: contain; object-position: 50% 50%; margin: 0 auto; }
  .lab-modal-body { padding: 22px 20px 18px; }
  .lab-modal-body h2 { font-size: 21px; }
}

/* Chat launcher */
.lab-launch { position: fixed; right: 20px; bottom: 20px; z-index: 80; width: 72px; height: 72px; padding: 0; border-radius: 50%; border: 3px solid var(--gold-2); background: var(--bg-3); box-shadow: 0 12px 34px -6px rgba(0, 0, 0, .6), 0 0 0 6px rgba(245, 184, 61, .15); cursor: pointer; transition: transform .2s ease; }
.lab-launch:hover { transform: translateY(-2px); }
.lab-launch img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.lab-dot { position: absolute; right: 0; bottom: 2px; width: 18px; height: 18px; border-radius: 50%; background: #3DDC84; border: 3px solid var(--bg); }
.lab-teaser { position: fixed; right: 102px; bottom: 36px; z-index: 80; max-width: 240px; padding: 12px 16px; border-radius: 16px 16px 4px 16px; border: 1px solid var(--line-2); background: var(--text); color: var(--bg); font: 800 15px var(--font); cursor: pointer; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .3s ease, transform .3s ease; }
.lab-teaser.on { opacity: 1; transform: none; pointer-events: auto; }
@media (max-width: 560px) { .lab-launch { width: 62px; height: 62px; right: 14px; bottom: 14px; } .lab-teaser { right: 86px; bottom: 26px; max-width: 200px; font-size: 14px; } }

/* Chat window */
.lab-chat { position: fixed; right: 20px; bottom: 104px; z-index: 85; width: 380px; height: min(620px, calc(100vh - 130px)); display: flex; flex-direction: column; border-radius: 24px; overflow: hidden; background: #F4F3F8; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .75); opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .25s ease, transform .25s ease; }
.lab-chat.on { opacity: 1; transform: none; pointer-events: auto; }
.lab-chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 18px; background: var(--bg-3); color: var(--text); }
.lab-chat-head img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold-2); flex: none; }
.lab-chat-head b { display: block; font-size: 18px; }
.lab-chat-head span { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.lab-online { width: 9px; height: 9px; border-radius: 50%; background: #3DDC84; flex: none; }
.lab-chat-x { margin-left: auto; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); color: var(--text); font-size: 24px; cursor: pointer; flex: none; }
.lab-chat-x:hover { background: rgba(255, 255, 255, .2); }
.lab-chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.lab-msg { max-width: 86%; padding: 12px 15px; border-radius: 18px; font-size: 15.5px; line-height: 1.45; color: #1C1A2E; background: #FFFFFF; box-shadow: 0 1px 2px rgba(20, 16, 50, .06); white-space: pre-line; }
.lab-msg.bot { align-self: flex-start; border-bottom-left-radius: 6px; }
.lab-msg.me { align-self: flex-end; background: var(--gold-2); border-bottom-right-radius: 6px; }
.lab-typing { display: flex; gap: 4px; padding: 14px 16px; }
.lab-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9A97B5; animation: labDot 1s ease-in-out infinite; }
.lab-typing i:nth-child(2) { animation-delay: .15s; } .lab-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes labDot { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.lab-chat-cta { align-self: flex-start; min-height: 44px; padding: 10px 18px; font-size: 15px; }
.lab-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 10px; }
.lab-chips:empty { display: none; }
.lab-chips button { min-height: 38px; padding: 8px 14px; border-radius: var(--pill); border: 1.5px solid #5B2EE0; background: #FFFFFF; color: #3A1FA8; font: 700 14px var(--font); cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.lab-chips button:hover { background: #5B2EE0; color: #FFFFFF; }
.lab-chat-form { display: flex; gap: 10px; padding: 12px 14px 6px; border-top: 1px solid #E2E0EC; background: #FFFFFF; }
.lab-chat-form input[type=text] { flex: 1; min-width: 0; min-height: 50px; padding: 12px 16px; border-radius: var(--pill); border: 2px solid #1C1A2E; font: 500 16px var(--font); color: #1C1A2E; background: #FFFFFF; }
.lab-chat-form input[type=text]:focus-visible { outline: none; border-color: #5B2EE0; }
.lab-chat-form button { width: 50px; height: 50px; flex: none; border-radius: 50%; border: 0; background: var(--grad-gold); color: var(--on-gold); display: grid; place-items: center; cursor: pointer; }
.lab-chat-note { padding: 4px 16px 12px; background: #FFFFFF; color: #6E6B85; font-size: 12px; line-height: 1.4; text-align: center; }
@media (max-width: 560px) {
  .lab-chat { right: 0; left: 0; bottom: 0; width: auto; height: 100%; max-height: 100dvh; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .lab-typing i { animation: none; } }
.lab-chat-form input[type=text]::placeholder { color: #8A879F; }
.lab-msg.op { align-self: flex-start; background: #1C1A2E; color: #FFFFFF; border-bottom-left-radius: 6px; }
/* согласие на обработку персональных данных: окно с промокодом и чат */
.lab-consent a { color: var(--violet-2); }
.lab-agree { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 14px; line-height: 1.45; color: var(--muted); text-align: left; cursor: pointer; }
.lab-agree input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--cyan); cursor: pointer; }
.lab-agree input:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.lab-agree input[aria-invalid=true] { outline: 2px solid var(--red); outline-offset: 2px; }
.lab-agree a { color: var(--violet-2); }
.lab-chat-note.lab-agree { display: grid; padding: 6px 16px 12px; font-size: 13px; color: #4A4763; }
.lab-chat-note.lab-agree a { color: #5B2EE0; }
.lab-chat-note.lab-agree input { accent-color: #5B2EE0; }
.lab-chat-note.lab-need { color: #C0162F; }
.lab-chat-note.lab-need input { outline: 2px solid #C0162F; outline-offset: 2px; }
.lab-agree:has(input[aria-invalid=true]), .lab-agree:has(input[aria-invalid=true]) a { color: var(--red); }
.lab-chat-note.lab-need a { color: #C0162F; }
/* промокод в Telegram-боте */
.lab-or { text-align: center; color: var(--dim); font-size: 14px; margin: -2px 0; }
.lab-modal-body .lab-tg { width: 100%; gap: 10px; }
