/* Blink form guard: terms dialog, send-limit toast, city-screen preview. Shared by every page. */

/* ---------- terms dialog ---------- */
.bg-dlg {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  padding: 0; border: 0; border-radius: 32px;
  background: #fff; color: #0c1135;
  font-family: "Noto Sans Georgian", system-ui, sans-serif; font-weight: 400;
  overflow: hidden;
}
.bg-dlg::backdrop { background: rgb(12 17 53 / .62); }
.bg-dlg[open] { display: flex; }
@media (prefers-reduced-motion: no-preference) {
  .bg-dlg[open] { animation: bg-in .28s cubic-bezier(.2, .8, .2, 1); }
  .bg-dlg[open]::backdrop { animation: bg-fade .28s ease-out; }
}
@keyframes bg-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes bg-fade { from { opacity: 0; } }

.bg-card {
  display: flex; flex-direction: column; gap: 16px;
  width: 100%; max-height: inherit; margin: 0;
  padding: clamp(20px, 4vw, 32px);
}
.bg-head { display: flex; align-items: center; gap: 12px; }
.bg-head svg { width: 40px; flex: none; aspect-ratio: 72.68 / 75.45; fill: #3843cf; }
.bg-head h2 { margin: 0; font-size: clamp(24px, 4vw, 30px); font-weight: 900; line-height: 1.1; }
.bg-note {
  margin: 0; padding: 14px 18px; border-radius: 18px;
  background: #3843cf; color: #fff;
  font-size: 16px; font-weight: 600; line-height: 1.45;
}
.bg-terms {
  flex: 1 1 auto; min-height: 96px; overflow-y: auto; overscroll-behavior: contain;
  padding: 2px 12px 2px 0;
  font-size: 15px; line-height: 1.5;
}
.bg-terms h3 { margin: 10px 0 6px; font-size: 16px; font-weight: 800; }
.bg-terms h3:first-child { margin-top: 0; }
.bg-terms ul { margin: 0; padding-left: 20px; }
.bg-terms li + li { margin-top: 6px; }
.bg-human { display: grid; gap: 8px; }
.bg-label { margin: 0; font-size: 15px; font-weight: 600; }
.bg-ts { min-height: 65px; }
.bg-err { margin: 0; font-size: 14px; color: #b3202a; }
.bg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.bg-btn {
  min-height: 52px; padding: 0 24px; border: 2px solid #0c1135; border-radius: 999px;
  background: #fff; color: #0c1135;
  font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
}
.bg-btn:focus-visible, .bg-terms:focus-visible { outline: 3px solid #3843cf; outline-offset: 3px; }
.bg-ok { position: relative; overflow: hidden; border-color: #3843cf; background: #3843cf; color: #fff; font-weight: 800; }
.bg-ok span { position: relative; z-index: 1; }
.bg-ok:disabled { cursor: not-allowed; border-color: #d3d6f2; background: #d3d6f2; color: #0c1135; }
.bg-ok.counting::after {
  content: ""; position: absolute; inset: 0;
  background: rgb(56 67 207 / .28);
  transform-origin: left; animation: bg-fill 3s linear forwards;
}
@keyframes bg-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (max-width: 480px) {
  .bg-actions .bg-btn { flex: 1 1 100%; }
  .bg-ok { order: -1; }
}

/* ---------- send-limit toast ---------- */
.bg-toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 60;
  max-width: min(460px, calc(100vw - 32px)); margin: 0;
  padding: 14px 20px; border-radius: 18px;
  background: #0c1135; color: #f4efe9;
  font-family: "Noto Sans Georgian", system-ui, sans-serif; font-size: 15px; line-height: 1.4;
  translate: -50% calc(100% + 40px);
  transition: translate .3s cubic-bezier(.2, .8, .2, 1);
}
.bg-toast.on { translate: -50% 0; }

/* ---------- city-screen preview ---------- */
.bg-scr { container-type: inline-size; width: 100%; max-width: 520px; margin: 0; }
.bg-scr-box {
  padding: 2cqi; border-radius: 3cqi; background: #1c2035;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .06), 0 12px 28px -14px rgb(0 0 0 / .55);
}
.bg-scr-face {
  aspect-ratio: 16 / 9; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  padding: 4cqi 6cqi 3.5cqi; border-radius: 1.5cqi;
  background: var(--scr-bg, #3843cf); color: var(--scr-fg, #fff); text-align: center;   /* the topic's colour, set by blink-guard.js */
  font-family: "Noto Sans Georgian", system-ui, sans-serif;
  transition: background-color .2s, color .2s;
}
.bg-scr-eye { width: 11cqi; flex: none; aspect-ratio: 72.68 / 75.45; fill: var(--scr-eye, #0c1135); }
.bg-scr-body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 1.8cqi; width: 100%; }
.bg-scr-text {
  margin: 0; overflow: hidden; overflow-wrap: anywhere;
  font-size: calc(var(--fs, 9) * .55cqi); font-weight: 800; line-height: 1.18;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 7;
}
.bg-scr-name { margin: 0; font-size: 2.6cqi; font-weight: 400; }
.bg-scr-word { width: 18cqi; flex: none; aspect-ratio: 287.82 / 41.96; fill: currentColor; }
.bg-scr.is-empty .bg-scr-body { opacity: .6; }
.bg-scr.is-off .bg-scr-face { filter: grayscale(1); opacity: .45; }
.bg-scr-cap { margin: 10px 0 0; font-size: 14px; font-weight: 400; line-height: 1.4; }
.bg-scr-cap:empty { display: none; }
.bg-scr--mini { max-width: 260px; margin-top: 12px; }
.bg-scr--mini .bg-scr-cap { display: none; }

/* message field + screen side by side, screen drops below when narrow */
.bg-compose { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 18px 24px; }
.bg-compose > :first-child { flex: 1 1 280px; min-width: 0; }
.bg-compose > .bg-scr { flex: 0 1 200px; }
