/* ==========================================================================
   CraftLauncher — visite guidee (tour) : overlay spotlight + bulle.
   Maison, sans dependance externe (la CSP bloque les CDN).
   ========================================================================== */

:root {
    --clt-z: 2147483000;
}

/* Capte tous les clics de la page pendant la visite (rien n'est cliquable
   sauf la bulle). Transparent. */
.clt-blocker {
    position: fixed;
    inset: 0;
    z-index: calc(var(--clt-z) + 1);
    background: transparent;
    cursor: default;
}

/* Couche d'assombrissement + LEGER flou plein ecran. Un "trou" net est decoupe
   au niveau de la cible via clip-path (calcule en JS). Sans cible (modale
   d'accueil/fin), la couche couvre tout : fond flouté et assombri. */
.clt-dim {
    position: fixed;
    inset: 0;
    z-index: var(--clt-z);
    background: rgba(9, 9, 11, 0.62);
    -webkit-backdrop-filter: blur(2.5px);
    backdrop-filter: blur(2.5px);
    pointer-events: none;
    transition: clip-path .32s cubic-bezier(.4, 0, .2, 1);
    will-change: clip-path;
}

/* Anneau lumineux anime autour de la cible. */
.clt-ring {
    position: fixed;
    z-index: calc(var(--clt-z) + 2);
    border-radius: 14px;
    pointer-events: none;
    box-shadow: 0 0 0 2px rgba(228, 228, 231, 0.9), 0 0 22px 4px rgba(228, 228, 231, 0.35);
    transition: top .35s cubic-bezier(.4, 0, .2, 1),
                left .35s cubic-bezier(.4, 0, .2, 1),
                width .35s cubic-bezier(.4, 0, .2, 1),
                height .35s cubic-bezier(.4, 0, .2, 1);
    animation: clt-pulse 2s ease-in-out infinite;
}

@keyframes clt-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(228, 228, 231, 0.9), 0 0 22px 4px rgba(228, 228, 231, 0.28); }
    50%      { box-shadow: 0 0 0 2px rgba(228, 228, 231, 1),   0 0 30px 8px rgba(228, 228, 231, 0.45); }
}

/* La bulle explicative. */
.clt-bubble {
    position: fixed;
    z-index: calc(var(--clt-z) + 3);
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: 84vh;
    overflow-y: auto;
    background: #18181B;
    border: 1px solid #3F3F46;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.7);
    color: #FAFAFA;
    font-family: 'Inter', system-ui, sans-serif;
    animation: clt-bubble-in .28s cubic-bezier(.16, 1, .3, 1);
    -webkit-overflow-scrolling: touch;
}

@keyframes clt-bubble-in {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Petite fleche de la bulle vers la cible. */
.clt-arrow {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #18181B;
    border: 1px solid #3F3F46;
    transform: rotate(45deg);
}

.clt-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #A1A1AA;
    margin-bottom: 6px;
}

.clt-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 8px;
    color: #FAFAFA;
}

.clt-body {
    font-size: 13.5px;
    line-height: 1.55;
    color: #A1A1AA;
    margin: 0 0 16px;
}

.clt-body strong { color: #E4E4E7; font-weight: 600; }

/* Encart teaser (upsell plan superieur). */
.clt-teaser {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    font-size: 13px;
    line-height: 1.5;
    color: #FBBF7A;
}
.clt-teaser strong { color: #F59E0B; }

/* Barre de progression. */
.clt-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.clt-progress-track {
    flex: 1;
    height: 4px;
    background: #27272A;
    border-radius: 99px;
    overflow: hidden;
}
.clt-progress-fill {
    height: 100%;
    background: #E4E4E7;
    border-radius: 99px;
    transition: width .35s ease;
}
.clt-progress-label {
    font-size: 11px;
    color: #71717A;
    white-space: nowrap;
}

/* Boutons. */
.clt-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.clt-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 11px;
    transition: background .15s, color .15s, border-color .15s, opacity .15s;
}
.clt-btn-primary { background: #E4E4E7; color: #09090B; }
.clt-btn-primary:hover { background: #FFFFFF; }
.clt-btn-ghost { background: transparent; color: #A1A1AA; border: 1px solid #3F3F46; }
.clt-btn-ghost:hover { color: #FAFAFA; border-color: #52525B; }
.clt-btn-text { background: transparent; color: #71717A; padding: 9px 8px; }
.clt-btn-text:hover { color: #A1A1AA; }
.clt-spacer { flex: 1; }

/* Variante detail (proposee sur l'onglet Serveurs). */
.clt-btn-detail { background: rgba(59, 130, 246, 0.12); color: #60A5FA; border: 1px solid rgba(59, 130, 246, 0.3); }
.clt-btn-detail:hover { background: rgba(59, 130, 246, 0.2); }

/* Modale centree (accueil / fin). */
.clt-modal-wrap {
    position: fixed;
    inset: 0;
    z-index: calc(var(--clt-z) + 3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.clt-modal {
    width: 460px;
    max-width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    background: #18181B;
    border: 1px solid #3F3F46;
    border-radius: 22px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 30px 80px -12px rgba(0, 0, 0, 0.8);
    animation: clt-bubble-in .3s cubic-bezier(.16, 1, .3, 1);
    -webkit-overflow-scrolling: touch;
}
.clt-modal .clt-title { font-size: 22px; margin-bottom: 12px; }
.clt-modal .clt-body { font-size: 14.5px; }
.clt-modal .clt-actions { justify-content: center; margin-top: 4px; }
.clt-modal-badge {
    width: 56px; height: 56px;
    margin: 0 auto 18px;
    border-radius: 16px;
    background: #09090B;
    border: 1px solid #27272A;
    display: flex; align-items: center; justify-content: center;
    color: #E4E4E7;
}

/* Bouton "?" flottant par onglet. */
.clt-help-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 40;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #18181B;
    border: 1px solid #3F3F46;
    color: #A1A1AA;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 30px -6px rgba(0, 0, 0, 0.5);
    transition: color .15s, border-color .15s, transform .15s;
}
.clt-help-btn:hover { color: #FAFAFA; border-color: #52525B; transform: translateY(-2px); }

/* Mobile : la bulle devient une "feuille" ancree en bas, pleine largeur. */
@media (max-width: 640px) {
    .clt-bubble {
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        bottom: 10px !important;
        top: auto !important;
        max-height: 62vh;
        padding: 18px;
        border-radius: 20px;
    }
    .clt-arrow { display: none !important; }
    .clt-help-btn { right: 14px; bottom: 14px; width: 40px; height: 40px; font-size: 18px; }
    .clt-modal-wrap { padding: 12px; align-items: flex-end; }
    .clt-modal { padding: 22px; border-radius: 20px; max-height: 82vh; }
    .clt-modal .clt-title { font-size: 19px; }
    .clt-title { font-size: 15px; }
    .clt-actions { gap: 8px; }
    .clt-btn { padding: 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .clt-dim, .clt-ring, .clt-bubble, .clt-modal { transition: none; animation: none; }
}
