/* ============================================================
   Trouve Ici – Video Popup Auto  |  popup.css  v2
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=DM+Sans:wght@300;400;600&display=swap');

/* ── Overlay ────────────────────────────────────────────────── */
#ti-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 15, 30, 0.85);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    z-index: 999999;
    display: none;          /* caché par défaut, JS l'affiche */
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#ti-popup-overlay.ti-visible {
    display: flex;
    animation: tiFadeIn 0.4s ease forwards;
}

@keyframes tiFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Popup box ──────────────────────────────────────────────── */
#ti-popup-box {
    position: relative;
    width: 100%;
    max-width: 800px;
    background: #050f1e;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 32px 90px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.07);
    animation: tiSlideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tiSlideUp {
    from { transform: translateY(50px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Bouton fermeture ───────────────────────────────────────── */
#ti-popup-close {
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 10;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
#ti-popup-close:hover { background: rgba(255,255,255,0.22); }

/* ── Écran intro ────────────────────────────────────────────── */
#ti-intro-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 64px 44px 54px;
    min-height: 320px;
    background: linear-gradient(160deg, #040d1c 0%, #0b1f3a 55%, #0e2d52 100%);
}

/* Logo */
.ti-logo-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 36px;
}

.ti-logo-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2196f3, #0d47a1);
    color: #fff;
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(33,150,243,0.45);
}

.ti-logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    color: #fff;
    letter-spacing: -0.5px;
}
.ti-logo-text span { color: #64b5f6; }

/* Texte typewriter */
#ti-intro-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 17px;
    font-weight: 300;
    color: rgba(255,255,255,0.88);
    line-height: 1.75;
    max-width: 500px;
    margin: 0 0 38px;
    min-height: 60px;
}

/* Barre de progression */
.ti-progress-bar {
    width: 220px;
    height: 3px;
    background: rgba(255,255,255,0.12);
    border-radius: 99px;
    overflow: hidden;
}
.ti-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2196f3, #64b5f6);
    border-radius: 99px;
    transition: width 0.1s linear;
}

/* ── Écran vidéo ────────────────────────────────────────────── */
#ti-video-screen {
    display: none;
    flex-direction: column;
}

#ti-video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
}

#ti-video-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Facebook SDK player */
#ti-video-container .fb-video,
#ti-video-container .fb-video span,
#ti-video-container .fb-video iframe {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

/* CTA bas de page */
#ti-cta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 26px;
    background: #061120;
    flex-wrap: wrap;
}

#ti-cta-bar p {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: rgba(255,255,255,0.65);
    margin: 0;
    flex: 1;
}

#ti-cta-close {
    flex-shrink: 0;
    padding: 10px 24px;
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
#ti-cta-close:hover { opacity: 0.85; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 540px) {
    #ti-intro-screen { padding: 48px 24px 40px; }
    #ti-intro-text   { font-size: 15px; }
    .ti-logo-text    { font-size: 22px; }
    #ti-cta-bar      { flex-direction: column; text-align: center; }
}
