/* =============================================================================
   FinLevel Landing — land-specific styles
   ─────────────────────────────────────────────────────────────────────────
   Базова стилізація (hero, for-whom, lessons, price, reviews) → спільний файл:
       /resources/css/course.css  (підключається перед цим файлом).
   Тут лежить ТІЛЬКИ те, що унікальне для FinLevel:
   — одно-рядковий заголовок hero
   — інтерактивний відео-телефон у hero
   — блок гарантії в ціні
   — пульс Telegram-кнопки
   ============================================================================= */

/* Hero — single-line title (одне речення, без поділу name+accent) */
.hero__titles h1 {
  font-family: "Gilroy";
  font-weight: 700;
  font-size: 52px;
  line-height: 56px;
  letter-spacing: -1px;
  color: #212121;
  text-align: center;
}

/* Hero — interactive video phone (права колонка) */
.hero__phone {
  position: relative;
  width: 156px;
  cursor: pointer;
}

.hero__phone:hover .hero__phone-screen {
  background: #1a1a1a;
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.5), 0 0 60px rgba(255, 0, 0, 0.3), 0 0 120px rgba(255, 0, 0, 0.15);
}

.hero__phone-frame {
  position: relative;
  z-index: 2;
  width: 100%;
  height: auto;
  display: block;
}

.hero__phone-screen {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #111;
  border-radius: 18%;
  overflow: hidden;
  transition: background 0.3s ease;
}

.hero__phone-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  /* Приглушення одразу 0.35, щоб постер було видно під час завантаження відео
     (раніше було rgba(0,0,0,1) — суцільний чорний ховав постер до старту відео) */
  background: rgba(0, 0, 0, 0.35);
  z-index: 1;
  transition: background 0.5s ease;
}

.hero__phone-screen.poster-playing::after {
  background: rgba(0, 0, 0, 0.35);
}

.hero__phone-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.hero__play-icon {
  width: 56px;
  height: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease;
}

.hero__phone:hover .hero__phone-play {
  transform: translate(-50%, -50%) scale(1.15);
}

.hero__play-text {
  font-family: "Gilroy";
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.hero__tap-hint {
  position: absolute;
  z-index: 3;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  animation: tap-appear 5s ease 1.5s forwards;
}

.tap-icon {
  width: 72px;
  height: 72px;
  transform: scaleY(-1);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  animation: tap-press 5s ease 1.5s forwards;
}

.tap-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  opacity: 0;
  animation: tap-ripple-anim 5s ease 1.5s forwards;
}

@keyframes tap-appear {
  0% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  8% { opacity: 1; transform: translateX(-50%) translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes tap-press {
  0%, 15% { transform: scale(1); }
  20% { transform: scale(0.82); }
  28% { transform: scale(1); }
  45% { transform: scale(1); }
  50% { transform: scale(0.82); }
  58% { transform: scale(1); }
  100% { transform: scale(1); }
}

@keyframes tap-ripple-anim {
  0%, 18% { opacity: 0; transform: scale(0.5); }
  22% { opacity: 0.7; transform: scale(0.5); }
  35% { opacity: 0; transform: scale(1.8); }
  48% { opacity: 0; transform: scale(0.5); }
  52% { opacity: 0.7; transform: scale(0.5); }
  65% { opacity: 0; transform: scale(1.8); }
  100% { opacity: 0; }
}

.hero__poster-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__phone-screen video,
.hero__phone-screen iframe {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Price — guarantee note */
.price__guarantee {
  margin-top: 16px;
  font-family: "Gilroy";
  font-weight: 400;
  font-size: 14px;
  line-height: 150%;
  color: #888;
}

/* Telegram CTA — attention pulse */
.btn-telegram--pulse {
  animation: cta-pulse 10s ease forwards;
}

@keyframes cta-pulse {
  /* Group 1: 3 pulses */
  0%    { transform: scale(1);    box-shadow: 0 0 0 0 rgba(0,191,165,0); }
  2.5%  { transform: scale(1.06); box-shadow: 0 0 20px 8px rgba(0,191,165,0.3); }
  5%    { transform: scale(1);    box-shadow: 0 0 0 0 rgba(0,191,165,0); }
  7.5%  { transform: scale(1.06); box-shadow: 0 0 20px 8px rgba(0,191,165,0.3); }
  10%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(0,191,165,0); }
  12.5% { transform: scale(1.06); box-shadow: 0 0 20px 8px rgba(0,191,165,0.3); }
  15%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(0,191,165,0); }
  /* 2s pause */
  35%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(0,191,165,0); }
  /* Group 2: 3 pulses */
  37.5% { transform: scale(1.06); box-shadow: 0 0 20px 8px rgba(0,191,165,0.3); }
  40%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(0,191,165,0); }
  42.5% { transform: scale(1.06); box-shadow: 0 0 20px 8px rgba(0,191,165,0.3); }
  45%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(0,191,165,0); }
  47.5% { transform: scale(1.06); box-shadow: 0 0 20px 8px rgba(0,191,165,0.3); }
  50%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(0,191,165,0); }
  /* 2s pause */
  70%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(0,191,165,0); }
  /* Group 3: 3 pulses */
  72.5% { transform: scale(1.06); box-shadow: 0 0 20px 8px rgba(0,191,165,0.3); }
  75%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(0,191,165,0); }
  77.5% { transform: scale(1.06); box-shadow: 0 0 20px 8px rgba(0,191,165,0.3); }
  80%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(0,191,165,0); }
  82.5% { transform: scale(1.06); box-shadow: 0 0 20px 8px rgba(0,191,165,0.3); }
  85%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(0,191,165,0); }
  100%  { transform: scale(1);    box-shadow: 0 0 0 0 rgba(0,191,165,0); }
}

/* -----------------------------------------------------------------------------
   RESPONSIVE — лише унікальні елементи (база → course.css)
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 1279.98px) {
  .hero__titles h1 { font-size: 36px; line-height: 42px; }
  .hero__phone     { width: 126px; }
  .hero__play-icon { width: 40px; }
  .hero__play-text { font-size: 10px; }
  .hero__phone-play { gap: 8px; }
}

@media only screen and (max-width: 743.98px) {
  .hero__titles h1 { font-size: 26px; line-height: 32px; }
  .hero__row       { flex-direction: column; align-items: center; gap: 32px; }
  .hero__phone     { width: 160px; }
  .hero__play-icon { width: 48px; }
  .hero__play-text { font-size: 12px; }
  .hero__phone-play { gap: 10px; }
  .btn-telegram    { width: 100%; max-width: 320px; }
}

/* <picture>-обгортки для WebP не мають впливати на верстку:
   img лишається layout-боксом (картинки в <picture> — лише webp + fallback). */
picture { display: contents; }

/* ═══ Блоки, перенесені з /level (2026-07-21) ═══
   Канонічна копія стилів - /level/css/style.css; правиш тут - синхронізуй там. */

/* Соц-доказ під hero-CTA: реальні цифри з API */
.lv-proof { margin-top: 14px; display: flex; align-items: center; justify-content: center; text-align: center; gap: 8px; font-size: 13.5px; color: var(--color-text-secondary, #5f6b76); }
.lv-proof__stars { color: #f5a623; letter-spacing: 1px; font-size: 14px; }
.lv-proof b { color: var(--color-text, #212121); font-weight: 700; }

/* ── Відео-відгук: без блюру, фоновий автоплей (muted preview), клік = popup зі звуком ── */
.lv-vreview { max-width: 660px; margin: 0 auto; padding: 0 16px; }
/* Заголовки секцій лендінгу - той самий рецепт, що .for-whom h2 у course.css */
.lv-vreview h2, .lv-faq h2 {
    margin: 0 0 var(--space-8);
    font-family: var(--font-family);
    font-weight: var(--font-weight-semibold);
    font-size: var(--text-2xl);
    line-height: 34px;
    color: var(--color-text);
    text-align: center;
}
.lv-vreview__card {
    position: relative; display: flex; background: #fff; border: 1px solid #eef1f3; border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08); overflow: hidden; cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.lv-vreview__card:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12); }
.lv-vreview__media { position: relative; flex: 0 0 185px; }
.lv-vreview__video { width: 100%; height: 100%; min-height: 0; max-height: 300px; object-fit: cover; display: block; background: #0f172a; }
/* Червона play-кнопка (та сама форма, що в hero-телефоні), по центру прев'ю -
   вшиті субтитри внизу відео лишаються видимими */
.lv-vreview__play {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 46px; pointer-events: none;
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.35));
    transition: transform 0.2s ease;
}
.lv-vreview__play svg { display: block; width: 100%; height: auto; }
.lv-vreview__card:hover .lv-vreview__play { transform: translate(-50%, -50%) scale(1.12); }
.lv-vreview__body { padding: 20px 22px; display: flex; flex-direction: column; justify-content: center; }
.lv-vreview__name { font-weight: 700; font-size: 17px; color: #1a242d; }
.lv-vreview__job { font-size: 12.5px; color: #8494a0; margin-top: 2px; }
.lv-vreview__text { margin-top: 10px; font-size: 14.5px; line-height: 1.55; color: #3d4b57; }
/* Clip кутового маскота - повторює форму картки (патерн .guarantee__mascot-clip) */
.lv-vreview__mascot-clip {
    position: absolute; inset: 0; border-radius: inherit;
    overflow: hidden; pointer-events: none; z-index: 0;
}
@media (max-width: 743.98px) {
    .lv-vreview__card { flex-direction: column; }
    .lv-vreview__media { flex: none; }
    .lv-vreview__video { min-height: 0; height: 320px; max-height: none; }
    /* нижній відступ більший, щоб текст не заходив під кутовий маскот */
    .lv-vreview__body { padding: 18px 20px 30px; }
}

/* Popup відео-відгуку: rgba на самому fixed-контейнері (перевірений патерн затемнення) */
.lv-vmodal {
    position: fixed; inset: 0; z-index: 220; background: rgba(15, 23, 42, 0.82);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.lv-vmodal[hidden] { display: none; }
.lv-vmodal__video { max-height: 86vh; max-width: min(92vw, 480px); border-radius: 14px; background: #000; display: block; }
.lv-vmodal__close {
    position: absolute; top: 14px; right: 16px; width: 40px; height: 40px;
    border: none; border-radius: 999px; background: rgba(255, 255, 255, 0.14);
    color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
}
.lv-vmodal__close:hover { background: rgba(255, 255, 255, 0.25); }

/* ── Блок автора (адаптований ev2-author з лендінгів івентів) ── */
.lv-author {
    margin: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 40px;
    align-items: center;
    padding: 40px;
    background: #f0f7f6;
    border-radius: 24px;
}
.lv-author__eyebrow { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: #00a08b; }
.lv-author__name { margin: 8px 0 0; font-size: 32px; font-weight: 700; color: #212121; }
.lv-author__role { margin: 4px 0 0; font-size: 18px; color: #5f6b76; }
.lv-author__stats { margin-top: 24px; display: flex; gap: 32px; flex-wrap: wrap; }
.lv-author__stat { display: flex; flex-direction: column; }
.lv-author__stat b { font-size: 24px; font-weight: 700; color: #00BFA5; line-height: 1.1; }
.lv-author__stat span { font-size: 13px; color: #5f6b76; }
.lv-author__bio { margin-top: 24px; font-size: 16px; line-height: 1.6; color: #5f6b76; }
.lv-author__swiper { width: 100%; min-width: 0; height: 440px; border-radius: 16px; overflow: hidden; box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18); }
.lv-author__swiper .swiper-wrapper { height: 100%; }
.lv-author__swiper .swiper-slide { height: 100%; }
.lv-author__swiper .swiper-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lv-author__dots .swiper-pagination-bullet { background: #fff; opacity: 0.6; }
.lv-author__dots .swiper-pagination-bullet-active { background: #00BFA5; opacity: 1; }
@media (max-width: 1023.98px) {
    .lv-author { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 28px; }
    .lv-author__col--media { order: -1; }
    .lv-author__swiper { height: 360px; }
}
@media (max-width: 743.98px) {
    .lv-author { padding: 22px; }
    .lv-author__name { font-size: 26px; }
    .lv-author__swiper { height: 300px; }
    .lv-proof { font-size: 12.5px; flex-wrap: wrap; }
}

/* ── FAQ: нативний details-акордеон (плавне розкриття - js/blocks.js, WAAPI) ── */
.lv-faq { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.lv-faq__list { margin-top: 0; display: flex; flex-direction: column; gap: 10px; }
.lv-faq__item {
    background: #fff; border: 1px solid #eef1f3; border-radius: 12px;
    padding: 0 18px; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.lv-faq__item summary {
    list-style: none; cursor: pointer; padding: 15px 28px 15px 0;
    font-weight: 600; font-size: 15.5px; color: #1a242d; position: relative;
}
.lv-faq__item summary::-webkit-details-marker { display: none; }
.lv-faq__item summary::after {
    content: '+'; position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
    font-size: 20px; font-weight: 500; color: #00bfa5; transition: transform 0.2s ease;
}
.lv-faq__item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
/* Під час анімації закриття [open] ще стоїть (контент має бути видимим),
   тож іконку повертаємо назад класом одразу з кліку */
.lv-faq__item.is-closing summary::after { transform: translateY(-50%) rotate(0deg); }
.lv-faq__item p { padding: 0 0 16px; margin: 0; font-size: 14.5px; line-height: 1.6; color: #4a5661; }
.lv-faq__item p a { color: #00a890; text-decoration: underline; text-underline-offset: 3px; }
.lv-faq__item p a:hover { color: #00bfa5; }

/* ═══ Єдиний вертикальний ритм секцій (як на /level) ═══
   Блок стоїть у КІНЦІ файлу свідомо: перебиває базові margin-и course.css
   (однакова специфічність - виграє пізніше правило, включно з їх @media). */
.for-whom, .lv-vreview, .lessons-section, .reviews-section,
.lv-author, .lv-faq, .price-section { margin-top: var(--space-20); }
/* Гарантія: візуальний відступ = margin-top + padding-top (40px десктоп / 32px
   від 1280px вниз, course.css) - 28px виступу круглої іконки над карткою. */
.guarantee { margin-top: 68px; }
@media (max-width: 1279.98px) {
    .guarantee { margin-top: 76px; }
}
@media (max-width: 743.98px) {
    .for-whom, .lv-vreview, .lessons-section, .reviews-section,
    .lv-author, .lv-faq, .price-section { margin-top: var(--space-12); }
    .guarantee { margin-top: 44px; }
}

/* «або почни безкоштовно» під кнопкою покупки: другий шлях для тих,
   хто дочитав до кінця, але не готовий платити одразу */
.price__alt { text-align: center; margin-top: 14px; font-size: 15px; color: var(--color-text-secondary, #6b7280); }
.price__alt a { color: var(--color-primary, #57bda5); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.price__alt a:hover { text-decoration: none; }

/* ── Плаваюча CTA (мобайл) ──────────────────────────────────────────────
   Тільки ≤743.98px: на десктопі CTA видно в hero і між секціями.
   Відступ знизу = 16px + env(safe-area-inset-bottom): на iPhone із заокругленим
   екраном і home-індикатором кнопка не залазить під системну смугу (той самий
   патерн, що в тостах лендінгів івентів). Динамічне перекриття панеллю браузера
   (адресний рядок, що виїжджає) докручує js/blocks.js через visualViewport.
   Показ/приховування - клас .is-in (opacity+translate), щоб не смикати layout. */
.fl-sticky, .fl-sticky-scrim { display: none; }

@media only screen and (max-width: 743.98px) {
    /* Дубль CTA: у «Змісті лекції» кнопка ховається - той самий заклик уже
       висить унизу екрана. На десктопі (де sticky немає) вона лишається. */
    .lessons__cta { display: none; }

    /* Підкладка під плаваючою кнопкою: розмите тло від самого низу з плавним
       згасанням догори - контент «тане» під кнопкою замість різкої межі.
       mask-image гасить і саме розмиття, і заливку одночасно; тримаємо на
       окремому шарі (не ::before кнопки), бо backdrop-filter усередині
       трансформованого/напівпрозорого предка глючить у Safari на iOS. */
    .fl-sticky-scrim {
        display: block;
        position: fixed; left: 0; right: 0; bottom: 0;
        height: calc(124px + env(safe-area-inset-bottom, 0px));
        z-index: 59; pointer-events: none;
        background: linear-gradient(to top,
            rgba(246, 246, 246, 0.92) 30%,
            rgba(246, 246, 246, 0.60) 65%,
            rgba(246, 246, 246, 0) 100%);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        -webkit-mask-image: linear-gradient(to top, #000 55%, rgba(0, 0, 0, 0) 100%);
        mask-image: linear-gradient(to top, #000 55%, rgba(0, 0, 0, 0) 100%);
        opacity: 0;
        transition: opacity .25s ease;
    }
    body.has-sticky-cta .fl-sticky-scrim { opacity: 1; }

    .fl-sticky {
        display: flex;
        position: fixed;
        left: 16px; right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        z-index: 60;
        align-items: center; justify-content: center; gap: var(--space-2);
        min-height: 54px; padding: 14px 20px;
        background: var(--color-dark);
        color: #fff; text-decoration: none;
        font-family: var(--font-family);
        font-weight: var(--font-weight-semibold);
        font-size: var(--text-md); line-height: 1;
        border-radius: var(--radius-md);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
        opacity: 0; transform: translateY(calc(100% + 24px));
        pointer-events: none;
        transition: opacity .25s ease, transform .25s ease;
    }
    .fl-sticky.is-in { opacity: 1; transform: translateY(0); pointer-events: auto; }
    .fl-sticky img { width: 22px; height: 22px; }

    /* Відступу під футером НЕ додаємо: біля блоку ціни sticky ховається сама,
       тож наприкінці сторінки перекривати нічого - зайвий padding лишав
       порожню смугу під футером (видно було лише на цьому ленді). */
}

@media (prefers-reduced-motion: reduce) {
    .fl-sticky, .fl-sticky-scrim { transition: none; }
}
