/* =========================================================
   APPRIM — Pages d'application intégrée en iframe plein écran
   Commun à APPs/APP_Time-loop, APP_Cityonair, APP_CCTV-i360
   (même principe que les pages Discover_ de PHYGITALE)
   ========================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: 'Helvetica Neue', Arial, sans-serif; color: #1f1d86; background: #0f0e46; overflow: hidden; }
[hidden] { display: none !important; }

.app-shell { position: fixed; inset: 0; display: flex; flex-direction: column; }
.app-shell.no-bar .app-bar { display: none; }

.app-bar {
    flex: 0 0 auto; height: 52px; padding: 0 14px;
    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.25); z-index: 2;
}
.app-bar a { color: #fff; text-decoration: none; }
.app-back { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-back img { width: 32px; height: 32px; flex: 0 0 auto; }
.app-back span { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.app-back strong { font-size: 0.88rem; letter-spacing: 0.05rem; }
.app-back small { font-size: 0.72rem; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.app-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;
}
.app-actions a.primary { background: #fff; color: #1f1d86; border-color: #fff; }
.app-actions a:hover { background: rgba(255, 255, 255, 0.15); }
.app-actions a.primary:hover { background: #eef1fc; }

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

.app-loader { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.app-loader::before {
    content: ''; width: 38px; height: 38px; border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.2); border-top-color: #4f7bff; animation: app-spin 0.9s linear infinite;
}
@keyframes app-spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
    .app-actions a.secondary { display: none; }
    .app-back small { max-width: 46vw; }
}
@media (prefers-reduced-motion: reduce) { .app-loader::before { animation: none; } }
