/* bg.down-web.ru — background removal service. Matches the down-web / uniq visual family
   (Bootstrap 5.3 + Manrope, soft shadows, rounded cards, primary #0d6efd, light theme). */

:root {
    --accent: #0d6efd;
    --accent-hover: #0b5ed7;
    --ink: #0f172a;
    --muted: #64748b;
    --line: rgba(148, 163, 184, .30);
    --card: #ffffff;
    --bg: #f4f7fb;
    --radius: 16px;
    --shadow: 0 12px 30px rgba(15, 23, 42, .10);
    --shadow-lg: 0 16px 44px rgba(15, 23, 42, .16);
}

* { box-sizing: border-box; }

body {
    font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1100px 520px at 82% -8%, rgba(13, 110, 253, .09), transparent 60%),
        radial-gradient(900px 480px at 8% 4%, rgba(99, 102, 241, .07), transparent 55%),
        var(--bg);
    margin: 0;
    line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Header ── */
.site-header { background: transparent; }
.top-header {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 14px rgba(15, 23, 42, .04);
}
.top-header .container { padding-top: 12px; padding-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.logo-link { font-weight: 800; color: var(--ink); font-size: 1.05rem; }
.logo-link:hover { color: var(--accent); text-decoration: none; }
.site-title h1 { font-size: 1.18rem; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.site-title h1 .accent { color: var(--accent); }

.language-flag { display: inline-flex; align-items: center; }
.language-flag a { display: inline-flex; align-items: center; margin-left: 10px; }
.language-flag img {
    width: 26px; height: 17px; border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .10); object-fit: cover;
    transition: transform .15s ease;
}
.language-flag a:hover img { transform: translateY(-1px); }
.language-flag a.active img { outline: 2px solid var(--accent); outline-offset: 1px; }

.main-menu {
    background: var(--card);
    border-bottom: 1px solid var(--line);
}
.main-menu .nav { gap: 4px; padding: 6px 0; }
.main-menu .nav-link {
    color: var(--muted); font-weight: 600; font-size: .95rem;
    border-radius: 999px; padding: 7px 16px; transition: all .15s ease;
}
.main-menu .nav-link:hover { color: var(--accent); background: rgba(13, 110, 253, .08); text-decoration: none; }

/* ── Banners ── */
.banner_head .container, .banner_bottom .container { max-width: 1000px; }
.banner-card {
    display: block; border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); background: #fff;
    transition: transform .2s ease, box-shadow .2s ease;
}
.banner-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.banner-card img { width: 100%; height: auto; display: block; }

/* ── Section shell ── */
.section { padding: 34px 0; }
.section .container { max-width: 1000px; }
.eyebrow {
    display: inline-block; font-weight: 700; font-size: .8rem; letter-spacing: .08em;
    text-transform: uppercase; color: var(--accent);
    background: rgba(13, 110, 253, .10); padding: 5px 12px; border-radius: 999px; margin-bottom: 12px;
}
h2.section-title { font-weight: 800; font-size: clamp(1.5rem, 3.4vw, 2.05rem); letter-spacing: -.02em; margin: 0 0 10px; }
.lead { color: var(--muted); font-size: 1.06rem; max-width: 760px; }

/* ── Tool card ── */
.tool-wrap { max-width: 940px; }
.tool-card {
    background: var(--card); border: 1px solid var(--line); border-radius: 22px;
    box-shadow: var(--shadow); padding: 26px;
}
.tool-card h2 { font-weight: 800; font-size: 1.5rem; margin: 0 0 6px; letter-spacing: -.01em; }
.tool-sub { color: var(--muted); margin: 0 0 20px; }

.dropzone {
    border: 2px dashed rgba(13, 110, 253, .45);
    border-radius: 18px; background: rgba(13, 110, 253, .035);
    padding: 42px 20px; text-align: center; cursor: pointer;
    transition: all .18s ease;
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent); background: rgba(13, 110, 253, .08);
    transform: translateY(-1px);
}
.dropzone .dz-icon {
    width: 62px; height: 62px; margin: 0 auto 14px; display: grid; place-items: center;
    border-radius: 16px; background: rgba(13, 110, 253, .12); color: var(--accent); font-size: 26px;
}
.dropzone .dz-title { font-weight: 700; font-size: 1.12rem; margin-bottom: 4px; }
.dropzone .dz-hint { color: var(--muted); font-size: .92rem; }
.dropzone .btn { margin-top: 16px; }

/* preview */
.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .preview-grid { grid-template-columns: 1fr; } }
.preview-col { text-align: center; }
.preview-label { font-weight: 700; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.preview-box {
    border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
    min-height: 240px; display: grid; place-items: center; background: #f8fafc;
}
.preview-box img { max-height: 420px; width: auto; display: block; }
/* checkerboard for transparency */
.checkerboard {
    background-image:
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 22px 22px;
    background-position: 0 0, 0 11px, 11px -11px, -11px 0;
}

.tool-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 22px; }
.btn-lg-cta { font-weight: 700; border-radius: 12px; padding: 12px 26px; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: #0b5ed7; border-color: #0b5ed7; }

.progress-wrap { margin-top: 20px; }
.progress { height: 12px; border-radius: 999px; background: #e9eef6; }
.progress-bar { background: var(--accent); }
.progress-note { color: var(--muted); font-size: .9rem; margin-top: 8px; text-align: center; }

.tool-badges { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; margin-top: 20px; color: var(--muted); font-size: .9rem; font-weight: 600; }
.tool-badges span i { color: #22c55e; margin-right: 6px; }

/* ── SEO content ── */
.prose { color: #334155; font-size: 1.04rem; }
.prose h2 { font-weight: 800; font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -.02em; margin: 6px 0 12px; color: var(--ink); }
.prose h3 { font-weight: 700; font-size: 1.22rem; margin: 26px 0 8px; color: var(--ink); }
.prose p { margin: 0 0 14px; }
.prose ul { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin-bottom: 7px; }
.prose img { border-radius: 14px; box-shadow: var(--shadow); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 8px 0 6px; }
@media (max-width: 820px) { .feature-grid { grid-template-columns: 1fr; } }
.feature {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px; box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
}
.feature .f-icon {
    width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
    background: rgba(13, 110, 253, .12); color: var(--accent); font-size: 21px; margin-bottom: 12px;
}
.feature h3 { margin: 0 0 6px; font-size: 1.12rem; }
.feature p { margin: 0; color: var(--muted); font-size: .97rem; }

.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 30px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.steps { counter-reset: step; display: grid; gap: 14px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step .num {
    flex: none; counter-increment: step; width: 38px; height: 38px; border-radius: 50%;
    background: var(--accent); color: #fff; font-weight: 800; display: grid; place-items: center;
}
.step .num::before { content: counter(step); }
.step h3 { margin: 4px 0 4px; font-size: 1.08rem; }
.step p { margin: 0; color: var(--muted); }

/* FAQ */
.faq-item { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; overflow: hidden; background: var(--card); }
.faq-q { width: 100%; text-align: left; background: none; border: 0; padding: 18px 20px; font-weight: 700; font-size: 1.05rem; color: var(--ink); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq-q .chev { transition: transform .2s ease; color: var(--accent); }
.faq-item.open .faq-q .chev { transform: rotate(180deg); }
.faq-a { padding: 0 20px; max-height: 0; overflow: hidden; transition: max-height .25s ease, padding .25s ease; color: var(--muted); }
.faq-item.open .faq-a { padding: 0 20px 18px; max-height: 520px; }

/* ── Telegram FAB (как на down-web.ru: голый логотип-SVG, без фона/рамки, bounce) ── */
.telegram-icon {
    position: fixed; right: 24px; bottom: 54px; width: 84px; height: 84px;
    display: flex; align-items: center; justify-content: center; z-index: 1100;
    animation: bounce 2s ease infinite;
}
.telegram-icon img { max-width: 80%; height: auto; display: block; }
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-15px); }
    60% { transform: translateY(-7px); }
}

/* ── Footer ── */
footer.site-footer {
    text-align: center; color: var(--muted); padding: 28px 16px; border-top: 1px solid var(--line);
    margin-top: 10px; background: var(--card);
}

/* utility */
.mt-sec { margin-top: 8px; }
.text-muted2 { color: var(--muted); }

/* ── Tool heading (above the Lightsweep widget) ── */
.tool-head { text-align: center; max-width: 820px; margin: 0 auto 22px; }
.tool-head h2 { font-weight: 800; font-size: clamp(1.4rem, 3vw, 1.7rem); letter-spacing: -.01em; margin: 0 0 6px; }
.tool-head .tool-sub { color: var(--muted); margin: 0 auto; max-width: 640px; font-size: 1.02rem; }

/* ============ Lightsweep — the background-removal widget ============
   Light theme only. Accent = Bootstrap primary #0d6efd.
   Everything animated is transform / opacity / clip-path → GPU-composited. */
.bgr{
  --accent:#0d6efd; --accent-600:#0b5ed7;
  --ink:#0f172a; --muted:#64748b; --line:#e7edf6; --card:#fff;
  --shadow:0 18px 44px -22px rgba(15,23,42,.30), 0 4px 14px -8px rgba(15,23,42,.12);
  --ease-out:cubic-bezier(.22,1,.36,1);
  font-family:'Manrope',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  color:var(--ink); max-width:820px; margin-inline:auto;
}
.bgr *{ box-sizing:border-box; }
.bgr__drop{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px;
  min-height:340px; padding:44px 28px; text-align:center; cursor:pointer;
  background:linear-gradient(180deg,#fff,#f7faff);
  border:2px dashed #c9d7ec; border-radius:22px; box-shadow:var(--shadow);
  transition:border-color .2s var(--ease-out), background .2s var(--ease-out), transform .12s var(--ease-out);
}
.bgr__drop:hover{ border-color:var(--accent); background:linear-gradient(180deg,#fff,#eef4ff); }
.bgr__drop.is-over{ border-color:var(--accent); background:#eef4ff; transform:scale(1.006); }
.bgr__drop:active{ transform:scale(.996); }
.bgr__dropIcon{
  width:64px; height:64px; display:grid; place-items:center; border-radius:20px;
  font-size:26px; color:var(--accent); background:#e7f0ff;
  box-shadow:inset 0 0 0 1px rgba(13,110,253,.14);
}
.bgr__dropTitle{ font-weight:800; font-size:1.12rem; letter-spacing:-.01em; }
.bgr__dropTitle b{ color:var(--accent); }
.bgr__dropHint{ color:var(--muted); font-size:.85rem; }
.bgr__stage{ background:var(--card); border-radius:22px; box-shadow:var(--shadow); padding:14px; }
.bgr__frame{
  position:relative; width:100%; aspect-ratio:4/3; max-height:72vh;
  border-radius:16px; overflow:hidden; background:#fff;
  isolation:isolate; perspective:1200px; touch-action:none;
}
.bgr__checker,.bgr__result,.bgr__original,.bgr__band,.bgr__fx{ position:absolute; inset:0; }
.bgr__checker{
  z-index:0; background-color:#fff;
  background-image:
    linear-gradient(45deg,#eaeff7 25%,transparent 25%),
    linear-gradient(-45deg,#eaeff7 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#eaeff7 75%),
    linear-gradient(-45deg,transparent 75%,#eaeff7 75%);
  background-size:22px 22px; background-position:0 0,0 11px,11px -11px,-11px 0;
  opacity:0; transition:opacity .5s var(--ease-out);
}
[data-state="revealing"] .bgr__checker,
[data-state="done"]      .bgr__checker{ opacity:1; }
.bgr__result,.bgr__original{
  width:100%; height:100%; object-fit:contain; display:block;
  user-select:none; -webkit-user-drag:none;
}
.bgr__result{ z-index:1; transform-origin:center center; will-change:transform; }
.bgr__original{ z-index:2; will-change:clip-path; }
.is-lifted .bgr__result{ filter:drop-shadow(0 18px 28px rgba(15,23,42,.26)); }
.bgr--compare .bgr__result{ filter:none; }
.bgr__band{
  z-index:3; opacity:0; pointer-events:none; clip-path:inset(0 0 100% 0);
  background:linear-gradient(180deg, rgba(13,110,253,.05), rgba(13,110,253,.14));
  mix-blend-mode:multiply; transition:opacity .3s var(--ease-out);
}
[data-state="processing"] .bgr__band{ opacity:1; }
.bgr__fx{ z-index:4; pointer-events:none; opacity:0; transition:opacity .3s ease; }
[data-state="processing"] .bgr__fx,
[data-state="revealing"]  .bgr__fx{ opacity:1; }
.bgr__scanline{
  position:absolute; left:0; right:0; top:0; height:2px; z-index:5; opacity:0;
  transform:translate3d(0,-4px,0); pointer-events:none; will-change:transform,opacity;
  background:linear-gradient(90deg,transparent,#4c9dff 12%,#dcecff 50%,#4c9dff 88%,transparent);
  box-shadow:0 0 12px 1px rgba(13,110,253,.7), 0 0 34px 6px rgba(13,110,253,.32);
  transition:opacity .2s ease;
}
[data-state="processing"] .bgr__scanline,
[data-state="revealing"]  .bgr__scanline{ opacity:1; }
/* During processing the scan-line sweeps via a compositor CSS animation, so it keeps
   moving even while the wasm inference blocks the main thread (rAF is frozen then). */
@keyframes bgr-sweep { from{ transform:translate3d(0,0,0); } to{ transform:translate3d(0,var(--fh,340px),0); } }
[data-state="processing"] .bgr__scanline{ animation:bgr-sweep 1.7s ease-in-out infinite alternate; }
/* Indeterminate shimmer that runs on the bar while the background is being removed. */
@keyframes bgr-shimmer { from{ transform:translateX(-130%); } to{ transform:translateX(430%); } }
.bgr__track.is-working{ background:#dbe6f7; }
.bgr__track.is-working::after{
  content:''; position:absolute; top:0; bottom:0; left:0; width:34%; border-radius:999px;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.9),transparent);
  animation:bgr-shimmer 1.05s linear infinite;
}
.bgr__handle{
  position:absolute; top:0; bottom:0; left:50%; width:2px; z-index:6; display:none;
  transform:translateX(-1px); border:0; padding:0; cursor:ew-resize;
  background:rgba(255,255,255,.95);
  box-shadow:0 0 0 1px rgba(13,110,253,.35), 0 2px 10px rgba(15,23,42,.28);
}
.bgr--compare .bgr__handle{ display:block; }
.bgr__handle:focus-visible{ outline:none; }
.bgr__handleGrip{
  position:absolute; top:50%; left:50%; width:40px; height:40px;
  transform:translate(-50%,-50%); border-radius:50%; background:#fff; color:var(--accent);
  display:grid; place-items:center; font-size:13px;
  box-shadow:0 6px 18px -4px rgba(13,110,253,.55), inset 0 0 0 1px rgba(13,110,253,.2);
}
.bgr__handle:focus-visible .bgr__handleGrip{ box-shadow:0 0 0 4px rgba(13,110,253,.35); }
.bgr__badge{
  position:absolute; top:12px; z-index:6; font-size:.7rem; font-weight:800; letter-spacing:.02em;
  padding:5px 11px; border-radius:999px; background:rgba(255,255,255,.92); color:var(--ink);
  box-shadow:0 2px 10px rgba(15,23,42,.14); opacity:0; transition:opacity .3s var(--ease-out);
}
.bgr__badge--before{ left:12px; }
.bgr__badge--after{ right:12px; color:var(--accent-600); }
.bgr--compare .bgr__badge{ opacity:1; }
.bgr__bar{
  display:flex; align-items:center; justify-content:center; gap:12px; flex-wrap:wrap;
  padding:16px 6px 6px; min-height:58px;
}
.bgr__cta{ display:inline-flex; align-items:center; }
[data-state="processing"] .bgr__cta,
[data-state="revealing"]  .bgr__cta,
[data-state="done"]       .bgr__cta{ display:none; }
.bgr__progress{ display:none; align-items:center; gap:14px; width:100%; max-width:480px; }
[data-state="processing"] .bgr__progress,
[data-state="revealing"]  .bgr__progress{ display:flex; }
.bgr__track{ position:relative; flex:1; height:8px; border-radius:999px; background:#e9eef7; overflow:hidden; }
.bgr__fill{
  position:absolute; inset:0 auto 0 0; width:0%; border-radius:999px;
  background:linear-gradient(90deg,#0d6efd,#5aa0ff); box-shadow:0 0 12px rgba(13,110,253,.5);
  transition:width .12s linear;
}
.bgr__pct{ font-variant-numeric:tabular-nums; font-weight:800; font-size:.85rem; min-width:42px; text-align:right; }
.bgr__phase{ color:var(--muted); font-size:.8rem; white-space:nowrap; }
.bgr__actions{ display:none; gap:10px; flex-wrap:wrap; justify-content:center; }
[data-state="done"] .bgr__actions{ display:flex; }
@media (max-width:560px){
  .bgr__phase{ display:none; }
  .bgr__frame{ aspect-ratio:1/1; max-height:64vh; }
  .bgr__stage{ padding:10px; }
  .bgr__drop{ min-height:280px; }
}
@media (prefers-reduced-motion:reduce){
  .bgr__scanline,.bgr__fx,.bgr__band{ display:none !important; }
  .bgr__checker{ transition:none; }
}
