/* No-fork cabinet override CSS. Injected as <link rel=stylesheet /overlay/overlay.css>
   by apply.py (guarded by this file's presence). Keep it minimal and anchored to
   STABLE hooks (router path or semantic attributes), never hashed build class names.

   ── Language switcher: flag → globe ──────────────────────────────────────────
   The pinned SPA renders the switcher trigger as
     <button aria-label="Change language" class="…hashed…">
       <span>{flag}</span><span>RU</span><svg chevron/>
     </button>
   The marketing landing (kot-vpn.best) uses a plain globe icon for language, no flag /
   country code. To read as one product we hide the flag, the country code and the
   chevron, and paint the landing's exact globe glyph via ::before (mask-image, so it
   inherits a solid color and needs no extra asset). Keyed on the human-readable
   aria-label, which is stable across builds — NOT on a hashed class.
   Ceiling: if a digest bump renames/localises that aria-label this becomes an inert
   no-op (switcher keeps its default flag) — re-grep `aria-label":"Change language"`
   in the extracted assets on each bump. */
button[aria-label="Change language"] > span,
button[aria-label="Change language"] > svg {
  display: none;
}
button[aria-label="Change language"]::before {
  content: "";
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
  background-color: #fff; /* landing globe is text-white */
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23000'%20stroke-width='1.7'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Cpath%20d='M3%2012h18'/%3E%3Cpath%20d='M12%203c2.5%202.5%203.8%205.7%203.8%209s-1.3%206.5-3.8%209c-2.5-2.5-3.8-5.7-3.8-9s1.3-6.5%203.8-9z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23000'%20stroke-width='1.7'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Ccircle%20cx='12'%20cy='12'%20r='9'/%3E%3Cpath%20d='M3%2012h18'/%3E%3Cpath%20d='M12%203c2.5%202.5%203.8%205.7%203.8%209s-1.3%206.5-3.8%209c-2.5-2.5-3.8-5.7-3.8-9s1.3-6.5%203.8-9z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
html.light button[aria-label="Change language"]::before {
  background-color: #000;
}

/* ── Info hub: landing-embed iframe full-width host ─────────────────────────
   The four custom info pages (FAQ, Guides, Offer, Privacy) are injected as
   iframes by info-embed.js. The cabinet's content wrapper usually constrains the
   width to ~60%; we expand the immediate host so the iframe can use the full
   available width. Anchored to the injected `data-kvr-embed-host` attribute. */
[data-kvr-embed-host] {
  position: relative;
  width: 100% !important;
  max-width: none !important;
  flex: 1 1 auto !important;
}

/* Loader shown over the placeholder while the iframe is still transparent. */
[data-kvr-embed-loader] {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 1;
}
[data-kvr-embed-loader]::after {
  content: "";
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: #830bf4;
  border-radius: 50%;
  animation: kvr-spin 0.8s linear infinite;
}
@keyframes kvr-spin {
  to { transform: rotate(360deg); }
}

iframe[data-kvr-embed] {
  overflow: hidden;
  background: #0e0a16;
  transition: height 0.25s ease-out, opacity 0.2s ease;
}
html.light iframe[data-kvr-embed] {
  background: #ffffff;
}
iframe[data-kvr-embed-loading] {
  opacity: 0;
  pointer-events: none;
}
html.light [data-kvr-embed-loader]::after {
  border-color: rgba(26, 18, 40, 0.12);
  border-top-color: #830bf4;
}

/* The cabinet Info tab is intentionally SHOWN: custom landing-embed pages for
   FAQ, Guides, Offer and Privacy replace the built-in FAQ/rules/privacy/offer
   tabs via replaces_tab (scripts/bot-node/seed-info-pages.py). Bedolaga's native
   tab icons are preserved; overlay-src/hide-loyalty-tab.ts hides loyalty, relabels
   Rules → Guides and Privacy → Agreement, and swaps the FAQ/Rules tab nodes so Guides is first. */

/* ── Deep-link login: QR popover chip ────────────────────────────────────────
   The deep-link login fallback is forced by login-deeplink.js. The SPA renders a
   white QR box + caption that we wrap and collapse behind a small chip-like
   "QR code" toggle placed UNDER the open-bot button. Hovering the chip shows
   the full-size QR in a popover below; leaving the chip/popover hides it.
   Click is a no-op (no sticky open). The space-y gap the bot button used to
   carry (hidden preceding siblings) is moved onto this chip as margin-top.
   Anchored to the injected `data-kvr-qr-container` / `data-kvr-qr-content`
   attributes, not hashed build classes. */
a[href*="start=webauth_"] {
  margin: 0 auto !important;
}

/* Screenshot-matched compact CTA: auto-width, 12px radius, centered icon+label.
   Telegram stays brand blue; email submit keeps cabinet accent. */
a[href*="start=webauth_"],
[data-kvr-login-submit] {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 10px;
  width: auto !important;
  max-width: 100%;
  padding: 10px 60px !important;
  border: 0 !important;
  border-radius: 12px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  color: #fff !important;
  text-decoration: none !important;
  box-shadow: none !important;
}
a[href*="start=webauth_"] {
  background: #24A1DE !important;
}
a[href*="start=webauth_"]:hover {
  background: #0077b3 !important;
}
a[href*="start=webauth_"]:active {
  background: #229ed9 !important;
}
/* White paper-plane icon: hide the SPA button's own icon and paint a filled plane via
   ::before (mask-image + background-color:#fff), so it matches the screenshot regardless
   of the bundle's icon markup. Same mask pattern as the QR-chip / globe glyphs above. */
a[href*="start=webauth_"] svg {
  display: none !important;
}
a[href*="start=webauth_"]::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  background-color: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' fill='%23000'%3E%3Cpath d='M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480v-83.6c0-4 1.5-7.8 4.2-10.8L331.8 202.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3 .3 300.7 0 288.9s5.9-22.8 16.1-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' fill='%23000'%3E%3Cpath d='M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480v-83.6c0-4 1.5-7.8 4.2-10.8L331.8 202.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3 .3 300.7 0 288.9s5.9-22.8 16.1-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}
[data-kvr-login-submit] {
  background: #7c3aed !important;
}
[data-kvr-login-submit]:hover {
  background: #6d28d9 !important;
}

[data-kvr-qr-container] {
  position: relative;
  display: inline-flex !important;
  flex-direction: column;
  align-items: center;
  align-self: center;
  width: auto;
  margin: 1.25rem 0 0 !important;
}

[data-kvr-qr-toggle] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.4;
  cursor: default;
  user-select: none;
  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
}

[data-kvr-qr-toggle]:hover,
[data-kvr-qr-container]:hover [data-kvr-qr-toggle] {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}

[data-kvr-qr-toggle]::before {
  content: "";
  width: 14px;
  height: 14px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='14' y='14' width='7' height='7'/%3E%3Crect x='3' y='14' width='7' height='7'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='14' y='14' width='7' height='7'/%3E%3Crect x='3' y='14' width='7' height='7'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

[data-kvr-qr-container] > [data-kvr-qr-content] {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(10, 15, 26, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  /* padding-top bridges the visual 8px gap so hover onto the QR stays inside the container */
  padding: 8px 12px 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.2s ease;
}

[data-kvr-qr-container] > [data-kvr-qr-content] > p {
  color: #fff;
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
}

[data-kvr-qr-container]:hover > [data-kvr-qr-content] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ── Login brand: landing carpet + KOVER lockup ─────────────────────────────
   SPA tile is a 48px square (`h-12 w-12`). Overlay JS tags it `data-kvr-logo-box`
   and paints /logo-full.png (white KOVER on the dark plate). Drop the
   square so the lockup fits, and strip the SPA
   tile's dark rounded background so only the lockup shows. */
[data-kvr-logo-box] {
  width: auto !important;
  height: 48px !important;
  overflow: visible;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
[data-kvr-logo-box] img {
  position: static !important;
  height: 100% !important;
  width: auto !important;
  max-width: none;
  object-fit: contain;
}

/* ── Email login: static "или войти по Email" divider (no accordion) ──────────
   login-deeplink.js force-expands the email form and tags its accordion header
   `data-kvr-email-toggle`. It is no longer a collapse control: hide the chevron (the
   button's trailing svg; the leading mail icon stays) and make the header inert so it
   reads as a divider label between the two lines. Anchored to the injected attribute,
   not hashed build classes. Programmatic .click() (force-open) ignores pointer-events. */
[data-kvr-email-toggle] {
  pointer-events: none;
  cursor: default;
}
/* Hide both the leading mail icon and the trailing chevron so the header reads as a
   plain "──── OR ────" divider (the label span is rewritten to a localized "OR"). */
[data-kvr-email-toggle] svg {
  display: none;
}

/* ── Login LegalFooter: drop recurrent-payments ────────────────────────────
   SPA LegalFooter.tsx ships /offer, /privacy, /recurrent-payments. Overlay JS
   retargets the first two at kot-vpn.best/<lang>/{offer,privacy}/; this hides the
   third (and its leading ·) before JS runs. href is a public route, not a
   hashed class. */
footer a[href="/recurrent-payments"],
footer span:has(+ a[href="/recurrent-payments"]) {
  display: none !important;
}

/* ── "Add to Home Screen" suggestion banner ──────────────────────────────────
   Rendered by add-to-home.js (Telegram Bot API 8.0 addToHomeScreen). A fixed,
   dismissible card pinned to the bottom, route-agnostic (no SPA layout hook), keyed
   only on the injected [data-kvr-a2hs*] attributes. Sits above a possible bottom
   nav via the offset + safe-area inset. */
[data-kvr-a2hs] {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 60;
  width: calc(100% - 24px);
  max-width: 420px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(13, 19, 33, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

[data-kvr-a2hs-icon] {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 10px;
}

[data-kvr-a2hs-body] {
  flex: 1 1 auto;
  min-width: 0;
}

[data-kvr-a2hs-title] {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

[data-kvr-a2hs-sub] {
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 2px;
}

[data-kvr-a2hs-add] {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 0;
  border-radius: 9999px;
  background: #3390ec;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

[data-kvr-a2hs-add]:hover {
  background: #2b81d6;
}

[data-kvr-a2hs-close] {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
}

[data-kvr-a2hs-close]::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  margin: 0 auto;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

[data-kvr-a2hs-close]:hover {
  color: #fff;
}
