/* ============================================================
   БМ Протекшън ЕООД – стилове
   ============================================================ */

:root {
  /* Червеното е сведено към това в логото (#b70004), но с малко повече
     наситеност, за да не изглежда тухлено на едри площи. */
  --red: #c40f22;
  --red-dark: #8f0a18;
  --ink: #0d1117;
  --ink-2: #161b22;
  --ink-3: #21262d;
  --gray: #5b6470;
  --gray-2: #8a939f;
  --line: #e4e8ec;
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --gold: #ffd34d;
  /* Зелено само за състояние „на линия“ – то се разчита мигновено и затова
     стои извън фирмената гама, както работи и светофарът. */
  --live: #35d07f;
  --white: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 45px -20px rgba(13, 17, 23, .35);
  --shadow-sm: 0 8px 24px -12px rgba(13, 17, 23, .25);
  --maxw: 1180px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  /* Височината на хедъра се ползва на няколко места – лепкавата лента,
     отстъпът при скок към раздел и мобилното меню. Държим я на едно място. */
  --header-h: 88px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: 'Inter', sans-serif; line-height: 1.15; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Текст само за екранни четци (иконките са aria-hidden и не носят смисъл за тях) */
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--red); color: #fff; font-weight: 700; font-size: 14px;
  padding: 10px 16px; border-radius: 999px; transition: top .2s;
}
.skip-link:focus { top: 12px; outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px; font-weight: 700; font-size: 15px;
  cursor: pointer; border: 2px solid transparent; transition: transform .2s var(--ease), box-shadow .2s, background .2s, color .2s;
  white-space: nowrap;
}
.btn--primary { background: var(--red); color: #fff; box-shadow: 0 12px 26px -12px var(--red); }
.btn--primary:hover { background: var(--red-dark); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn--ghost:hover { background: rgba(255,255,255,.12); border-color:#fff; transform: translateY(-2px); }
.btn--block { width: 100%; }

.eyebrow {
  display: inline-block; font-weight: 700; font-size: 13px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--red); margin-bottom: 12px;
}

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 100; background: rgba(13,17,23,.96);
  backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background .3s, box-shadow .3s;
}
.header.scrolled { box-shadow: 0 10px 30px -18px rgba(0,0,0,.6); }
.header__inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 14px; color: #fff; }
.brand__logo { width: 56px; height: 56px; object-fit: contain; }
.brand__text strong { display: block; font-family: 'Inter', sans-serif; font-size: 18px; letter-spacing: .02em; }
.brand__text small { display: block; font-size: 11.5px; color: var(--gray-2); letter-spacing: .02em; }

.nav { display: flex; align-items: center; gap: 24px; }
.nav__link {
  color: #fff; font-weight: 700; font-size: 14.5px; padding: 11px 8px;
  width: 7.6rem; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; position: relative; z-index: 0; white-space: nowrap;
  background: linear-gradient(180deg, #3a4250 0%, #1e242d 55%, #171b22 100%);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.22),
    inset 0 -2px 4px rgba(0,0,0,.35),
    0 2px 6px rgba(0,0,0,.35);
  transition: none;
}
.nav__link:hover {
  color: #fff; z-index: 2;
  transform: scale(1.08);
  background: linear-gradient(180deg, #4a5362 0%, #272e38 55%, #1c2129 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.28),
    inset 0 -2px 4px rgba(0,0,0,.35),
    0 4px 14px rgba(0,0,0,.45);
}
.nav__link:active {
  /* Без свиване – то дава усещане за забавяне при клик. */
  box-shadow:
    inset 0 3px 8px rgba(0,0,0,.5),
    inset 0 1px 0 rgba(255,255,255,.06);
}
.nav__link.is-active {
  color: #fff; z-index: 3;
  transform: scale(1.08);
  background: linear-gradient(180deg, #e82a3c 0%, var(--red) 42%, var(--red-dark) 100%);
  border-color: rgba(255,255,255,.28);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.38),
    inset 0 -2px 5px rgba(0,0,0,.28),
    0 4px 16px rgba(0,0,0,.4);
}
.nav__link.is-active:hover {
  transform: scale(1.08);
  background: linear-gradient(180deg, #f03546 0%, #d41226 45%, #9a0b18 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.42),
    inset 0 -2px 5px rgba(0,0,0,.28),
    0 6px 18px rgba(0,0,0,.42);
}
.nav__link.is-active:active {
  transform: scale(1.08);
  box-shadow:
    inset 0 3px 8px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.14);
}
.burger { display: none; flex-direction: column; gap: 5px; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; align-items: center; justify-content: center; }
.burger span { width: 24px; height: 2.5px; background: #fff; border-radius: 2px; transition: transform .3s, opacity .3s; }
.burger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; height: min(88vh, 720px); min-height: 520px; overflow: hidden; background: var(--ink); }
.hero__slides { position: absolute; inset: 0; }
.hero__slide {
  position: absolute; inset: 0; display: flex; align-items: center;
  opacity: 0; visibility: hidden; pointer-events: none; z-index: 0;
  transition: opacity .45s var(--ease), visibility 0s linear .45s;
  background:
    radial-gradient(1200px 600px at 78% 12%, rgba(255,255,255,.16), transparent 60%),
    linear-gradient(135deg, var(--slide-a), var(--slide-b));
}
.hero__slide::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(ellipse at 70% 40%, #000, transparent 75%); opacity: .5;
}
.hero__slide.is-active {
  opacity: 1; visibility: visible; pointer-events: auto; z-index: 1;
  transition: opacity .45s var(--ease), visibility 0s;
}
.hero__slide--image { background-color: #06090d; background-position: center center; background-size: cover; background-repeat: no-repeat; }
.hero__slide--image::before { display: none; }
.hero__slide--photo1 {
  background-image:
    linear-gradient(90deg, rgba(6,9,13,.80) 0%, rgba(6,9,13,.52) 34%, rgba(6,9,13,.16) 62%, rgba(6,9,13,.38) 100%),
    url('../assets/hero-1.png');
}
/* Тъмен слайд с лого на партньор (слайд 2) */
.hero__slide--dark {
  background:
    radial-gradient(900px 500px at 78% 30%, rgba(196,15,34,.14), transparent 60%),
    linear-gradient(135deg, var(--slide-a), var(--slide-b));
}
.hero__partners-grid { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 64px; width: 100%; }
.hero__cred { flex: 0 0 auto; width: auto; text-align: center; color: #fff; margin: 0; }
.hero__cred--action {
  display: block; padding: 0; border: 0; background: transparent; cursor: pointer;
  font: inherit; color: inherit; transition: transform .25s var(--ease);
}
.hero__cred--action:hover { transform: translateY(-4px); }
.hero__cred--action:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; border-radius: 12px; }
.hero__cred-img { height: min(26vh, 168px); width: auto; margin: 0 auto 16px; display: block; filter: drop-shadow(0 16px 36px rgba(0,0,0,.55)); }
.hero__cred-img--as { border-radius: 14px; }
.hero__cred figcaption,
.hero__cred-caption { display: block; font-size: 13px; color: rgba(255,255,255,.82); line-height: 1.5; white-space: nowrap; }
.hero__cred figcaption strong,
.hero__cred-caption strong { color: #fff; }
.hero__cred-caption small {
  display: block; margin-top: 8px; font-size: 12px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--gold);
}
.hero__content--center { flex: 1 1 auto; max-width: 520px; text-align: center; max-height: none; }
.hero__content--center .hero__eyebrow { margin-left: auto; margin-right: auto; }
.hero__content--center .hero__actions { justify-content: center; }
@keyframes partnerIn { from { opacity: 0; transform: translateY(-50%) scale(.92); } to { opacity: 1; transform: translateY(-50%) scale(1); } }
.hero__content { position: relative; z-index: 2; color: #fff; max-width: 640px; }

.hero__content { transform: translateY(16px); opacity: 0; }
.hero__slide.is-active .hero__content {
  transform: translateY(0); opacity: 1;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}

/* Слайд 3: текст вляво, куполна камера вдясно */
.hero__equip {
  display: flex; align-items: center; justify-content: space-between; gap: clamp(20px, 4vw, 48px);
  width: 100%;
  padding-left: max(72px, calc((100vw - var(--maxw)) / 2 + 20px));
  padding-right: max(72px, calc((100vw - var(--maxw)) / 2 + 20px));
}
.hero__content--equip { flex: 1 1 0; min-width: 0; max-width: 560px; }
.hero__camera-media {
  flex: 0 0 auto; width: min(420px, 38vw);
}
.hero__camera {
  display: block; width: 100%; height: auto;
  filter: drop-shadow(0 28px 40px rgba(0,0,0,.45));
}

.hero__eyebrow { display: inline-block; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; padding: 7px 16px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; margin-bottom: 20px; background: rgba(0,0,0,.15); }
.hero__content h1,
.hero__content h2.hero__title {
  font-size: clamp(30px, 5vw, 54px); font-weight: 800; margin-bottom: 16px;
  text-shadow: 0 4px 24px rgba(0,0,0,.25);
}
.hero__content p { font-size: clamp(16px, 2.2vw, 20px); color: rgba(255,255,255,.9); margin-bottom: 28px; max-width: 540px; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 50px; height: 50px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35);
  background: rgba(0,0,0,.25); color: #fff; font-size: 28px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; transition: background .2s, transform .2s;
}
.hero__arrow:hover { background: var(--red); transform: translateY(-50%) scale(1.06); border-color: var(--red); }
.hero__arrow--prev { left: 18px; }
.hero__arrow--next { right: 18px; }

.hero__dots { position: absolute; left: 0; right: 0; bottom: 24px; display: flex; gap: 10px; justify-content: center; z-index: 5; }
.hero__dots button { width: 12px; height: 12px; border-radius: 50%; border: 0; background: rgba(255,255,255,.4); cursor: pointer; transition: background .2s, width .2s; }
.hero__dots button.is-active { background: #fff; width: 30px; border-radius: 999px; }

/* ---------- Sections ---------- */
.section { padding: 90px 0; }
.section--alt { background: var(--bg-alt); }
.section__head { max-width: 720px; margin: 0 auto 50px; text-align: center; }
.section__head h2 { font-size: clamp(26px, 4vw, 40px); font-weight: 800; margin-bottom: 14px; }
.section__head p { color: var(--gray); font-size: 17px; }
.section__head--light h2 { color: #fff; }
.section__head--light p { color: rgba(255,255,255,.75); }
/* За дълъг ред (партньорът), който трябва да стои цял на един ред.
   max-content го прави точно колкото текста, а max-width го връща
   към нормално пренасяне, когато екранът не стига. */
.section__head--wide { max-width: 1100px; }
.section__head--wide p { width: max-content; max-width: 100%; margin: 0 auto; }

/* ---------- About / Equipment ---------- */
.about__grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 60px; align-items: center; }
.about__grid--rev .about__text { order: 2; }
.about__text h2 { font-size: clamp(24px, 3.5vw, 36px); margin-bottom: 18px; }
.about__text p { color: var(--gray); margin-bottom: 16px; text-align: justify; }
.ticks { list-style: none; margin: 22px 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 34px; font-weight: 500; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; background: var(--red); color: #fff; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; }

.about__media {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.about__badge {
  width: 100%; max-width: 380px; box-sizing: border-box;
  display: flex; align-items: center; gap: 16px;
  background: var(--ink); color: #fff; padding: 36px 22px;
  border-radius: 16px; box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.08);
  min-height: calc((18px * 2 + 32px) * 2);
}
.about__badge-logo {
  width: 56px; height: 56px; object-fit: contain; flex: 0 0 auto;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.35));
}
.about__badge strong { font-family: 'Inter'; font-size: 48px; color: var(--gold); line-height: 1; flex: 0 0 auto; }
.about__badge strong::after { content: "+"; }
.about__badge span { font-size: 16px; color: rgba(255,255,255,.78); display: block; line-height: 1.35; }

.equip-photo {
  width: 100%; max-width: 480px; margin: 0 auto;
  background: var(--ink); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--ink-3);
}
.equip-photo img {
  width: 100%; height: auto; object-fit: contain;
  background: #05070a; padding: 18px 12px 8px;
}
.equip-photo figcaption {
  padding: 14px 18px 18px; color: rgba(255,255,255,.78);
  font-size: 14.5px; font-weight: 600; text-align: center;
}

/* ---------- Cards (services) ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0; overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.card__visual {
  aspect-ratio: 16 / 10;
  background: linear-gradient(145deg, var(--ink-2), var(--ink-3));
  overflow: hidden;
}
.card__visual img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform .45s var(--ease);
}
.card:hover .card__visual img { transform: scale(1.04); }
.card__visual--product {
  background:
    radial-gradient(80% 70% at 50% 40%, rgba(196, 15, 34, .18), transparent 70%),
    linear-gradient(160deg, var(--ink), var(--ink-3));
}
.card__visual--product img {
  object-fit: contain;
  object-position: center 58%;
  padding: 10px 18px 4px;
  transform-origin: center bottom;
}
.card:hover .card__visual--product img { transform: scale(1.05); }
.card__visual--figure {
  background:
    radial-gradient(70% 80% at 50% 30%, rgba(196, 15, 34, .14), transparent 65%),
    linear-gradient(180deg, var(--ink-2), var(--ink));
}
.card__visual--figure img {
  object-fit: cover;
  object-position: center 8%;
}
.card__visual--light {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.card__visual--light img {
  object-fit: contain;
  object-position: center;
  padding: 8px 14px;
}
.card:hover .card__visual--light img { transform: scale(1.04); }
.card__body { padding: 22px 26px 28px; flex: 1; }
.card h3 { font-size: 18.5px; margin-bottom: 10px; }
.card p { color: var(--gray); font-size: 15px; }
.card__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 10px; color: var(--gray); font-size: 15px; line-height: 1.45;
}
.card__list li { position: relative; padding-left: 18px; }
.card__list li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--red);
}
.card--wide {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: minmax(160px, 220px) 1fr; gap: 28px 36px; align-items: center;
  padding: 28px 32px;
}
.card--wide .card__media {
  width: 100%; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.card--wide .card__media img {
  display: block; width: 100%; height: 100%; object-fit: cover;
}
.card--wide .card__body { min-width: 0; padding: 0; }
.card--wide .card__list { grid-template-columns: 1fr 1fr; gap: 12px 28px; }

/* ---------- Stats ---------- */
.stats { padding: 84px 0; background:
    radial-gradient(900px 500px at 15% 20%, rgba(196,15,34,.25), transparent 60%),
    linear-gradient(160deg, var(--ink), #05070a); color: #fff; }
/* minmax(0, 1fr) държи плочките равни - иначе най-дългата стойност разтяга
   своята колона. */
.stats__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px; }
.stat { position: relative; text-align: center; padding: 24px; border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius); background: rgba(255,255,255,.03); }
.stat__num { font-family: 'Inter'; font-size: clamp(38px, 5vw, 54px); font-weight: 800; color: var(--gold); line-height: 1; }
.stat__num[data-since]::after { content: "+"; }
.stat p { color: rgba(255,255,255,.8); margin-top: 8px; font-weight: 500; }

/* ---------- Заверка на фактите ----------
   Числата стоят неподвижни и четими от първия миг. Движи се доказателството:
   върху всяка плочка се отпечатва документът, който стои зад числото. */
.stat--seal { padding-bottom: 34px; }
.seal {
  position: absolute; right: -30px; bottom: -32px; width: 116px; color: var(--red);
  opacity: 0; transform: rotate(var(--rot)) scale(1.9); pointer-events: none;
}
/* Последната плочка опира в ръба на екрана – там печатът минава отляво. */
.seal--left { right: auto; left: -30px; }
.seal svg { width: 100%; height: auto; display: block; }
.is-stamped .seal { animation: press .5s cubic-bezier(.2,.85,.3,1) var(--d) forwards; }
/* Печатът пада отвисоко, притиска се под нормалния си размер и отскача. */
@keyframes press {
  0%   { opacity: 0;   transform: rotate(calc(var(--rot) - 10deg)) scale(1.9); }
  45%  { opacity: 1;   transform: rotate(var(--rot)) scale(.93); }
  70%  { opacity: .98; transform: rotate(var(--rot)) scale(1.04); }
  100% { opacity: .92; transform: rotate(var(--rot)) scale(1); }
}
/* Плочката поема натиска. Без fill-mode, за да не отнеме transform от
   появяването на секцията, което върви със собствен преход. */
.is-stamped .stat--seal { animation: recoil .5s cubic-bezier(.2,.85,.3,1) var(--d); }
@keyframes recoil {
  0%, 38% { transform: none; }
  50%     { transform: translateY(2px) scale(.994); }
  100%    { transform: none; }
}

/* Дежурната част не се доказва с хартия, а с това, че работи в момента. */
.stat--live .stat__num { display: inline-flex; align-items: center; gap: 14px; }
.pulse { width: 13px; height: 13px; border-radius: 50%; background: var(--live); position: relative; flex: 0 0 auto; box-shadow: 0 0 12px rgba(53,208,127,.55); }
.pulse::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(53,208,127,.55); animation: ping 2.4s cubic-bezier(.2,.7,.3,1) infinite; }
@keyframes ping { to { box-shadow: 0 0 0 16px rgba(53,208,127,0); } }
.live { display: block; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--live); }

/* ---------- Licenses ---------- */
.licenses { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; }
.license { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 24px; text-align: center; transition: transform .25s var(--ease), box-shadow .25s; }
.license:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.license__mark { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; font-family: 'Inter'; font-weight: 800; font-size: 18px; color: #fff; background: linear-gradient(135deg, var(--red), var(--red-dark)); }
/* Печатите с прозрачен фон си носят собствената форма – стоят без плочка.
   Извитите им ръбове ги правят оптически по-дребни от плътните форми,
   затова ги правим по-високи от плочката. Водим се по височината, за да
   са наравно независимо от това дали печатът е квадратен или висок.
   Плочката е с фиксиран размер, така че надписите под нея не се местят. */
.license__mark--emblem { background: none; }
.license__mark--emblem img { width: auto; height: auto; max-width: 100%; max-height: 72px; transform: scale(1.16); }
/* Червеният квадрат е част от логото на ISO и остава. Плътната форма тежи
   оптически повече от кръглия печат, затова не я увеличаваме. */
.license__mark--square { background: none; }
.license__mark--square img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }
.license strong { display: block; font-size: 16px; margin-bottom: 4px; }
.license span { color: var(--gray); font-size: 13.5px; }
/* Картата, върху която е курсорът, се вдига над съседните, за да не ги
   застъпи подсказката с документа. */
.license:hover, .license:focus-visible { z-index: 3; }
.license:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
/* Надписът стои винаги: на докосване няма hover и той е единственият знак,
   че картата отваря документа. */
.license__hint { display: block; margin-top: 12px; font-weight: 600; font-size: 13px; color: var(--red); }
.license__hint::after { content: '\2192'; display: inline-block; margin-left: 6px; transition: transform .2s var(--ease); }
.license:hover .license__hint::after { transform: translateX(4px); }

/* Подсказка с документа над картата. Появява се само там, където има
   истински курсор – на телефон и таблет докосването отваря прегледа. */
.license__preview { display: none; }
@media (hover: hover) and (pointer: fine) {
  .license { position: relative; }
  /* Ширината е изрична: без нея кутията се свива, защото глобалното
     img { max-width: 100% } зависи от нея, а тя - от изображението. */
  .license__preview {
    display: block; position: absolute; left: 50%; bottom: calc(100% + 14px); width: 256px;
    padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 26px 50px -24px rgba(13,17,23,.55);
    opacity: 0; visibility: hidden; transform: translate(-50%, 10px) scale(.97); transform-origin: 50% 100%;
    transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
  }
  .license__preview img { display: block; width: 100%; height: auto; border-radius: 8px; }
  .license:hover .license__preview, .license:focus-visible .license__preview { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }
  /* Когато картата е високо в екрана, подсказката минава под нея. */
  .license.is-below .license__preview { top: calc(100% + 14px); bottom: auto; transform-origin: 50% 0; transform: translate(-50%, -10px) scale(.97); }
  .license.is-below:hover .license__preview, .license.is-below:focus-visible .license__preview { transform: translate(-50%, 0) scale(1); }
}

/* ---------- Преглед на документ ---------- */
.doc { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; }
.doc[hidden] { display: none; }
.doc__backdrop { position: absolute; inset: 0; background: rgba(6,9,13,.82); animation: docFade .2s var(--ease); }
/* Височината се мери спрямо екрана, а не в проценти: редът на решетката се
   разтяга по съдържанието и процентът би се смятал спрямо него.
   dvh отчита скриващата се адресна лента на телефоните. */
.doc__panel {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  max-width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  animation: docRise .25s var(--ease);
}
.doc__bar { display: flex; align-items: center; gap: 16px; color: #fff; }
.doc__title { font-size: 16px; font-weight: 600; margin: 0; }
.doc__close { margin-left: auto; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 16px; display: grid; place-items: center; transition: background .2s; }
.doc__close:hover { background: var(--red); }
/* min-height: 0 е задължително – иначе този елемент не се свива под
   височината на документа и панелът излиза извън екрана. */
.doc__stage { flex: 1 1 auto; min-height: 0; display: grid; place-items: center; }
/* Документът се събира по височина сам: 150px е мястото за лентата със
   заглавието, връзката отдолу и отстъпите. */
.doc__img {
  display: block; width: auto; height: auto; max-width: 100%;
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  border-radius: 10px; background: #fff;
}
.doc__link { align-self: center; color: rgba(255,255,255,.85); font-size: 13.5px; text-decoration: underline; }
.doc__link:hover { color: #fff; }
@keyframes docFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes docRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Информационен модал (НАЛСИЧОД) ---------- */
.info { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; }
.info[hidden] { display: none; }
.info__backdrop { position: absolute; inset: 0; background: rgba(6,9,13,.82); animation: docFade .2s var(--ease); }
.info__panel {
  position: relative; width: min(720px, 100%);
  max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column;
  background: #fff; color: var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); animation: docRise .25s var(--ease); overflow: hidden;
}
.info__bar {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 22px 24px 16px; border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.info__title { font-size: clamp(18px, 2.4vw, 22px); font-weight: 800; margin: 0; line-height: 1.3; }
.info__close {
  margin-left: auto; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-alt); color: var(--ink); font-size: 16px; display: grid; place-items: center;
  border: 0; cursor: pointer; transition: background .2s, color .2s;
}
.info__close:hover { background: var(--red); color: #fff; }
.info__body {
  padding: 22px 24px 28px; overflow-y: auto; min-height: 0;
  font-size: 15.5px; color: var(--gray); line-height: 1.65;
}
.info__body p { margin-bottom: 14px; }
.info__body h3 { color: var(--ink); font-size: 16.5px; margin: 22px 0 12px; }
.info__body ul { list-style: none; display: grid; gap: 12px; margin: 0 0 8px; }
.info__body li { position: relative; padding-left: 18px; }
.info__body li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--red);
}
.info__body strong { color: var(--ink); }

/* ---------- Clients (движеща се лента с лога) ---------- */
.clients__marquee {
  overflow: hidden;
  /* Логата избледняват към двата ръба, вместо да се отрязват рязко */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 110px, #000 calc(100% - 110px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 110px, #000 calc(100% - 110px), transparent);
}
.clients__track { display: flex; width: max-content; animation: clientsScroll 55s linear infinite; }
/* Двете групи са еднакво широки, затова -50% връща лентата точно на старта */
.clients__group { display: flex; align-items: center; gap: 60px; padding-right: 60px; flex-shrink: 0; }
.clients__marquee:hover .clients__track,
.clients__marquee:focus-within .clients__track { animation-play-state: paused; }

/* Всяко лого стои в еднаква по размер клетка и се вписва в нея. Така
   високите и широките лога излизат с еднаква оптична тежест – иначе
   квадратните изглеждат дребни до широките надписи. */
.client {
  flex: 0 0 auto; width: 190px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  /* Без това grid/flex пази intrinsic височината на img и лентата го реже */
  min-width: 0; min-height: 0; overflow: hidden;
}
.client-logo {
  max-width: 180px; max-height: 72px; width: auto; height: auto;
  object-fit: contain; object-position: center;
  opacity: .88;
  transition: opacity .3s, transform .3s var(--ease);
}
.client-logo:hover { opacity: 1; transform: scale(1.04); }

@keyframes clientsScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- FAQ ---------- */
.faq {
  max-width: 820px; margin: 0 auto;
  display: grid; gap: 10px;
}
.faq__item {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.faq__q {
  list-style: none; cursor: pointer; position: relative;
  padding: 18px 52px 18px 20px; font-weight: 700; font-size: 16px;
  color: var(--ink); line-height: 1.35;
  transition: background .2s, color .2s;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after {
  content: "+"; position: absolute; right: 18px; top: 50%;
  transform: translateY(-50%); width: 28px; height: 28px;
  border-radius: 50%; background: var(--bg-alt); color: var(--red);
  display: grid; place-items: center; font-size: 20px; font-weight: 700; line-height: 1;
  transition: background .2s, color .2s, transform .2s;
}
.faq__item[open] .faq__q { color: var(--red); }
.faq__item[open] .faq__q::after {
  content: "–"; background: var(--red); color: #fff;
}
.faq__q:hover { background: rgba(196,15,34,.04); }
.faq__a {
  padding: 0 20px 18px; color: var(--gray); font-size: 15px; line-height: 1.6;
}
.faq__a p { margin: 0; }

/* ---------- CTA ---------- */
.cta { padding: 72px 0; background:
    radial-gradient(800px 400px at 85% 20%, rgba(255,255,255,.08), transparent 60%),
    linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff; }
.cta__inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.cta__text { max-width: 620px; }
.cta__text h2 { font-size: clamp(24px, 3.5vw, 34px); margin-bottom: 12px; }
.cta__text p { color: rgba(255,255,255,.9); font-size: 17px; }
.eyebrow--light { color: #fff; opacity: .85; }
.cta__actions { display: flex; flex-direction: column; gap: 12px; }
.cta .btn--primary { background: #fff; color: var(--red); }
.cta .btn--primary:hover { background: #0d1117; color: #fff; }
.cta .btn--ghost { border-color: rgba(255,255,255,.7); }

/* ---------- Contact ---------- */
.contact__grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px; align-items: start; }
.contact__info { display: grid; gap: 18px; }
.contact__item { display: flex; gap: 16px; align-items: center; background: var(--bg-alt); border: 1px solid var(--line); padding: 18px 20px; border-radius: var(--radius-sm); }
.contact__ico { width: 46px; height: 46px; flex-shrink: 0; border-radius: 12px; background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff; display: grid; place-items: center; }
.contact__ico svg { width: 22px; height: 22px; display: block; }
.contact__item a, .contact__item span { font-weight: 600; color: var(--ink); transition: color .2s; }
.contact__item a:hover { color: var(--red); }
/* по-специфично от правилото за span по-горе, за да останат иконите бели */
.contact__item .contact__ico { color: #fff; }

.contact__map {
  position: relative; display: block; margin-top: 6px; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-alt);
  box-shadow: var(--shadow-sm); isolation: isolate;
}
.contact__map img { width: 100%; height: 220px; object-fit: cover; transition: transform .45s var(--ease); }
.contact__map:hover img { transform: scale(1.03); }
.contact__pin {
  position: absolute; left: 58%; top: 48%; width: 18px; height: 18px;
  margin: -9px 0 0 -9px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--red); border: 2px solid #fff;
  box-shadow: 0 6px 16px -4px rgba(196,15,34,.65);
}
.contact__pin::after {
  content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--gold);
}
.contact__map-label {
  position: absolute; left: 12px; bottom: 12px; z-index: 1;
  background: rgba(13,17,23,.88); color: #fff; font-size: 12.5px; font-weight: 700;
  padding: 7px 12px; border-radius: 999px; letter-spacing: .01em;
}

.contact__form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow-sm); }
.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 7px; }
.field input, .field textarea {
  width: 100%; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 15px; color: var(--ink); background: #fff; transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--red); box-shadow: 0 0 0 3px rgba(196,15,34,.12); }
.field textarea { resize: vertical; }
.field--check {
  display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start;
}
.field--check input {
  width: 18px; height: 18px; margin-top: 2px; padding: 0; accent-color: var(--red); cursor: pointer;
}
.field--check__text { min-width: 0; }
.field--check label {
  margin: 0; font-weight: 500; font-size: 13.5px; line-height: 1.45; color: var(--gray); cursor: pointer;
  display: block;
}
.field--check__link {
  display: inline-block; margin-top: 6px; font-size: 13.5px;
  color: var(--red); font-weight: 600; text-decoration: underline; text-underline-offset: 2px;
}
.field--check__link:hover { color: var(--red-dark); }
.field--check.invalid label { color: var(--red); }
.form__trap { position: absolute; left: -9999px; opacity: 0; }
.field input.invalid, .field textarea.invalid { border-color: var(--red); }
.form__note { margin-top: 14px; font-weight: 600; font-size: 14.5px; min-height: 20px; }
.form__note.ok { color: #1a8a3a; }
.form__note.err { color: var(--red); }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #cfd6de; padding-top: 48px; }
.footer__top {
  display: flex; align-items: center;
  padding-bottom: 28px; margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 28px; padding-bottom: 40px; }
.footer__heading { color: #fff; font-size: 15px; margin-bottom: 16px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.footer__col a, .footer__col span { display: block; color: #9aa4b0; font-size: 14.5px; margin-bottom: 10px; line-height: 1.45; transition: color .2s; }
.footer__col a:hover { color: #fff; }
.footer__col p { color: #9aa4b0; font-size: 14.5px; margin-top: 12px; }
.brand--footer { margin-bottom: 0; }
.footer__bar { border-top: 1px solid rgba(255,255,255,.08); padding: 20px 0; }
.footer__bar-inner { font-size: 13px; color: #7d8794; text-align: center; }

/* ---------- Policy pages ---------- */
.policy { padding: 56px 0 72px; background: var(--bg-alt); }
.policy__inner { max-width: 760px; }
.policy h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 10px; }
.policy__meta { color: var(--gray-2); font-size: 14px; margin-bottom: 28px; }
.policy h2 { font-size: 20px; margin: 32px 0 12px; }
.policy p, .policy li { color: var(--gray); font-size: 15.5px; }
.policy p + p { margin-top: 12px; }
.policy ul { margin: 10px 0 0 1.2em; display: grid; gap: 8px; }
.policy a { color: var(--red); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.policy a:hover { color: var(--red-dark); }
.policy__note {
  margin-top: 36px; padding: 16px 18px; border-radius: var(--radius-sm);
  background: #fff; border: 1px solid var(--line); font-size: 14px; color: var(--gray);
}

/* ---------- To top ---------- */
.to-top { position: fixed; right: 22px; bottom: 22px; width: 48px; height: 48px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 22px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .3s, transform .3s, background .2s; z-index: 90; }
.to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { background: var(--red-dark); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .licenses { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .about__grid { grid-template-columns: 1fr; gap: 40px; }
  .about__grid--rev .about__text { order: 0; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .card--wide { grid-template-columns: minmax(140px, 180px) 1fr; gap: 22px; }
  .card--wide .card__list { grid-template-columns: 1fr; }
  .stats__grid, .licenses { grid-template-columns: repeat(2, 1fr); }
  .contact__grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }

  /* Двете лога с надписите си отстрани на централния текст стават
     твърде тесни тук, затова слайдът минава в колона. */
  .hero__partners-grid { flex-direction: column; gap: 18px; }
  .hero__content--center { order: -1; max-width: 100%; }
  .hero__cred { width: auto; }
  .hero__cred-img { height: 88px; margin-bottom: 10px; }
  .hero__cred figcaption,
  .hero__cred-caption { font-size: 12.5px; max-width: 340px; margin: 0 auto; white-space: normal; }
}

/* Седемте връзки плюс логото не се събират на един ред под ~1000px,
   затова тук минаваме към бургер меню, а не чак на телефон. */
@media (max-width: 1000px) {
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; background: var(--ink); flex-direction: column; align-items: stretch;
    padding: 16px 20px 24px; gap: 4px; border-bottom: 1px solid rgba(255,255,255,.08);
    transform: translateY(-140%); transition: transform .35s var(--ease); box-shadow: 0 20px 40px -20px rgba(0,0,0,.7); max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .nav.open { transform: translateY(0); }
  .nav__link { padding: 14px 12px; font-size: 16px; width: 100%; max-width: 20rem; align-self: center; }
  .burger { display: flex; }
}

/* Стрелките застъпват текста на слайдовете при тесен екран –
   точките отдолу остават за навигация. */
@media (max-width: 900px) {
  .hero__arrow { display: none; }
  .hero__equip { padding: 0 24px; gap: 16px; }
  .hero__camera { max-width: 320px; }
  /* На телефон 0.8s фейд от тъмно се усеща като заседнал слайд.
     По-кратко преливане и без подхвръкване на текста. */
  .hero__slide {
    transition: opacity .28s ease, visibility 0s linear .28s;
  }
  .hero__slide.is-active {
    transition: opacity .28s ease, visibility 0s;
  }
  .hero__content,
  .hero__slide.is-active .hero__content {
    transform: none; opacity: 1; transition: none;
  }
  .hero__camera,
  .hero__cred-img { filter: none; }
}

@media (max-width: 720px) {
  :root { --header-h: 74px; }
  .brand { gap: 12px; }
  .brand__logo { width: 48px; height: 48px; }
  .brand__text strong { font-size: 16.5px; }

  .section { padding: 64px 0; }
  .stats { padding: 60px 0; }

  .clients__group { gap: 40px; padding-right: 40px; }
  .client { width: 150px; height: 68px; }
  .client-logo { max-width: 140px; max-height: 60px; }
  .clients__marquee {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  }

  .hero__equip { flex-direction: column; text-align: left; padding: 0 20px 40px; }
  .hero__content--equip { max-width: none; width: 100%; }
  .hero__camera-media { order: -1; width: 100%; flex: 0 0 auto; }
  .hero__camera { max-width: 280px; margin: 0 auto; }
  .hero__partners-grid { gap: 16px; }
  .hero__cred-img { height: 78px; margin-bottom: 8px; }
  .hero__cred figcaption,
  .hero__cred-caption { max-width: 320px; }

  /* На тесен екран подсказката няма къде да се появи, а и докосването
     отваря директно прегледа. */
  .license__preview { display: none; }
}

@media (max-width: 520px) {
  .cards, .stats__grid, .licenses, .footer__grid, .field-row { grid-template-columns: 1fr; }
  .card--wide { grid-template-columns: 1fr; justify-items: center; text-align: left; }
  .card--wide .card__media { max-width: 220px; }
  /* Плочките заемат цялата ширина – печатът се прибира, за да не опира в ръба. */
  .seal { width: 96px; right: -12px; bottom: -26px; }
  .seal--left { left: -12px; }
  /* Дългите надписи на бутоните не се събират на един ред на телефон. */
  .btn { white-space: normal; }
  .hero { min-height: 480px; }
  .footer__bar-inner { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }

  .hero__slide,
  .hero__slide.is-active { transition: none; }
  .hero__content,
  .hero__slide.is-active .hero__content { transform: none; opacity: 1; transition: none; }

  .license__preview { transition: none; }
  .doc__backdrop, .doc__panel { animation: none; }
  .nav__link, .nav__link::before, .nav__link::after { transition: none !important; }
  .nav__link:hover,
  .nav__link:active,
  .nav__link.is-active,
  .nav__link.is-active:hover,
  .nav__link.is-active:active { transform: none; }

  /* Печатите стоят готови, без падане и натиск; индикаторът не пулсира. */
  .seal { opacity: .92; transform: rotate(var(--rot)); animation: none !important; }
  .stat--seal { animation: none !important; }
  .pulse::after { animation: none; }

  /* Без движение лентата се превръща в спокойна статична решетка */
  .clients__track { animation: none; width: 100%; }
  .clients__marquee { -webkit-mask-image: none; mask-image: none; }
  .clients__group { flex-wrap: wrap; justify-content: center; padding: 0 20px; gap: 40px; }
  .clients__group[aria-hidden="true"] { display: none; }
}
