/* =========================================================
   APPRIM — Pages Discover_ (démo intégrée en iframe)
   Feuille de style commune aux 6 pages Discover_*.html
   ========================================================= */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: #1f1d86;
    background: #f7f6f6;
    overflow: hidden;
}
[hidden] { display: none !important; }

/* ---------------------------------------------------------
   Application : barre + démo
   --------------------------------------------------------- */
.demo-app {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    background: #f7f6f6;
}
.demo-bar {
    flex: 0 0 auto; height: 56px; padding: 0 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: #1f1d86; color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.demo-bar a { color: #fff; text-decoration: none; }
.demo-back { display: flex; align-items: center; gap: 10px; min-width: 0; }
.demo-back img { width: 36px; height: 36px; flex: 0 0 auto; }
.demo-back span { display: flex; flex-direction: column; min-width: 0; }
.demo-back strong { font-size: 0.9rem; letter-spacing: 0.05rem; }
.demo-back small { font-size: 0.72rem; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.demo-actions a {
    padding: 7px 12px; border-radius: 6px; font-size: 0.8rem; font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.6); white-space: nowrap;
}
.demo-actions a.primary { background: #fff; color: #1f1d86; border-color: #fff; }
.demo-actions a:hover { background: rgba(255, 255, 255, 0.15); }
.demo-actions a.primary:hover { background: #eef1fc; }

.demo-stage { position: relative; flex: 1 1 auto; background: #f7f6f6; }
.demo-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; }

.demo-loader { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.demo-loader::before {
    content: ''; width: 36px; height: 36px; border-radius: 50%;
    border: 4px solid #e3e9fb; border-top-color: #2851d6; animation: demo-spin 0.9s linear infinite;
}
@keyframes demo-spin { to { transform: rotate(360deg); } }

.demo-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; }
.demo-empty div {
    max-width: 480px; background: #fff; border: 1px solid #e6e6ee; border-radius: 16px;
    padding: 36px 28px; text-align: center;
}
.demo-empty h1 { font-size: 1.4rem; margin-bottom: 10px; }
.demo-empty p { color: #55557a; margin-bottom: 20px; line-height: 1.5; }
.demo-empty a {
    display: inline-block; padding: 12px 24px; border-radius: 8px; background: #2851d6;
    color: #fff; font-weight: 700; text-decoration: none;
}

/* ---------------------------------------------------------
   Popup d'intro : image de la maquette + crash zoom
   --------------------------------------------------------- */
.intro { position: fixed; inset: 0; z-index: 50; }

/* Arrière-plan noir semi-transparent */
.intro-backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.72);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}

/* Popup blanche, centrée (taille calculée par le script) */
.intro-card {
    position: absolute; left: 50%; top: 46%;
    transform: translate(-50%, -50%);
    padding: 12px; background: #ffffff; border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
    overflow: hidden; will-change: width, height, border-radius;
}
/* Fenêtre qui recadre l'image */
.intro-window {
    position: relative; width: 100%; height: 100%;
    overflow: hidden; border-radius: 10px; background: #ffffff;
}
/* Image de la maquette : taille fixe, centrée dans la fenêtre */
.intro-img {
    position: absolute; left: 50%; top: 50%;
    background-repeat: no-repeat; background-size: cover; background-position: center;
    will-change: transform, filter;
}

/* Compte à rebours, en bas au centre */
.intro-countdown {
    position: absolute; left: 50%; bottom: max(20px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    color: #ffffff; text-align: center;
}
.intro-countdown p {
    font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08rem; text-transform: uppercase;
    opacity: 0.9;
}
.intro-ring { position: relative; width: 66px; height: 66px; }
.intro-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.intro-ring circle { fill: none; stroke-width: 5; }
.intro-ring .track { stroke: rgba(255, 255, 255, 0.25); }
.intro-ring .progress { stroke: #ffffff; stroke-linecap: round; }
.intro-ring span {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.intro-ring span.tick { animation: intro-tick 0.45s ease-out; }
@keyframes intro-tick { from { transform: scale(1.45); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }
.intro-skip {
    background: none; border: 0; color: rgba(255, 255, 255, 0.85);
    font: inherit; font-size: 0.8rem; text-decoration: underline; cursor: pointer; padding: 4px 8px;
}
.intro-skip:hover { color: #ffffff; }

/* Confettis */
.confetti { position: fixed; inset: 0; z-index: 60; pointer-events: none; width: 100%; height: 100%; }

@media (max-width: 560px) {
    .demo-actions a.secondary { display: none; }
    .demo-back small { max-width: 46vw; }
    .intro-card { padding: 8px; border-radius: 14px; }
    .intro-ring { width: 58px; height: 58px; }
    .intro-countdown p { font-size: 0.7rem; letter-spacing: 0.04rem; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
    .demo-loader::before { animation: none; }
    .intro-ring span.tick { animation: none; }
}
